Extras din referat
TEMA:
Sa se conceapa si sa se proiecteze la nivel de program si de circuit, un system cu un microcontroller PIC care sa genereze o melodie formata din 5 note musicale cu frecventele date intr-o secventa aleasa de dumneavoastra.
Frecventele notelor unei claviaturi:
http://ro.wikipedia.org/wiki/Gam%C4%83_muzical%C4%83
Am ales notele musicale DO,RE,MI,FA,SOL.
Pentru generarea sunetelor se foloseste urmatoarea secventa de program folosind Matlab:
#include p16f84.inc
REG1 equ 0x10 ; contor1
REG2 equ 0x11 ;contor2
i equ 0x12 ; de cate ori se repeat nota
BSF STATUS,RP0
BCF STATUS,RP1; bank1
MOVLW B'00000000'
MOVWF TRISB
BCF STATUS,RP0 ;bank0
MOVLW 0X20
MOVWF i
LOOPdo:BCF PORTB,1 ; pinul 1 este setat 0
CALL DELAY1 ; se apeleaza secventa”delay1”care mentine semnalul in 0 timp
:de 1.8ms
BSF PORTB,1 ; se seteaza pinul 1 pe 1
CALL DELAY1 ; se interzie cu 1.8ms
DECFSZ i,1 ;
GOTO LOOPdo
LOOPre:BCF PORTB,1
CALL DELAY2 ; se mentine in 0 timp de 1.7ms
BSF PORTB,1
CALL DELAY2; se mentine in 1 timp de 1.7ms
DECFSZ i,1
GOTO LOOPre
LOOPfa:BCF PORTB,1
CALL DELAY3 ; se mentine in 0 timp de 1.43ms
BSF PORTB,1
CALL DELAY3; se mentine in 1 timp de 1.43ms
DECFSZ i,1
GOTO LOOPfa
LOOPsol:BCF PORTB,1
CALL DELAY4 ; se mentine in 0 timp de 1.25ms
BSF PORTB,1
CALL DELAY4
DECFSZ i,1
GOTO LOOPsol
LOOPmi:BCF PORTB,1
CALL DELAY5 ; se mentine in 0 timp de 1.5ms
BSF PORTB,1
CALL DELAY5
DECFSZ i,1
GOTO LOOPmi.
Preview document
Conținut arhivă zip
- Sistem cu un Microcontroller PIC Care Sa Genereze o Melodie Formata din 5 Note Muzicale.docx