Создаем программу генерирования звука с выводом на пьезоизлучатель
Длительный звук
Код:
beep.asm http://www.talkingelectronics.com/projects/5x7Display/Display_08_Piezo_experiments_page1.html Start ORG 0x00 BSF 03,5 ;Go to page1 for setting-up the ports MOVLW 00h ;Put 00 into W MOVWF 05h ; to make all RA lines output MOVWF 06h ;to make all RB lines output BCF 03,5 ;Go to Page0 for programming Tone1 BSF 06,7 ;this is the piezo line. Turn it ON CALL Delay ;Call Delay BCF 06,7 ;Turn off the piezo CALL Delay ;Call Delay GOTO Tone1 ;Repeat the routine Delay DECFSZ 1Ah,1 ;Delay for tone GOTO Delay RETURN END beep.hex :100000008316003085008600831286170A20861327 :0A0010000A2005289A0B0A280800B0 :00000001FF