; º º ; º _\\|//_ º ; º (` o-o ') º ; º------ooO-(_)-Ooo----------------------------------------------------º ; º º ; º www.todopic.com.ar º ; º .oooO Oooo. º ; º ( ) ( ) obtenga su email gratis º ; º_____\ (_______) /___________________________________________________º ; º \_) (_/ º ; ; LIST P=PIC16F84 include Sonido.inc ORG 0000h ; ;********************************************************** ;*** Macro Sonido: ;*** Reproduce un sonido por el puerto, pin especificado ;*** y con la nota y duracion especificada ;*** Usa 4 variables, las cuales son mapeadas en la ram + dos pocisiones ;*** Las cuales son: ;*** Puerto = 22h, Pin = 20h, Nota = 0Eh, Duracion = 0F, 0Dh y 0Ch ;*** Estas variables son necesarias para reproducir el sonido ;*** En cuanto al los pines, hay que nombrarlo del 1 al 8 por el hecho ;*** de que trabaja con un comf........... ;*** Las notas son de 0 a 80 y del 80 al FF es NOISE o RUIDO ;*** Y a duracion se especifica en milisegundos ;********************************************************* ;** En este ejemplo se recorre infinitamente por todas las notas Inicio ;PUERTO B movlw 06h movwf Puerto ;PIN 0 movlw 01h movwf Pin ;INCREMENTO DE LA NOTA Una A UNA incf Nota ;DURACION 1 Milisegundo movlw 01h movwf Duracion ;LLAMO MACRO Sound Goto Inicio end