180 likes | 319 Views
Auld Lang Synthesis. Microcomputer Systems I ECE 3551 – Fall 2010 Ryan M. Winget. Purpose. To synthesize the old Scottish poem song “Auld Lang Syne ” using the ADSP-BF533 board. To be able to be able to start and stop the song using the button PF8
E N D
Auld Lang Synthesis Microcomputer Systems I ECE 3551 – Fall 2010 Ryan M. Winget
Purpose • To synthesize the old Scottish poem song “Auld Lang Syne” using the ADSP-BF533 board. • To be able to be able to start and stop the song using the button PF8 • To be able to slow down and speed up the song using the buttons PF9 and PF10.
Sound Synthesis • Used Digital Sinusoids for the sound synthesis. • fs = 48000 Hz • f0 = note frequency
Interrupts Used • Sport0 • Used to send the audio signals to the speakers • FlagA • Used for control of the buttons PF8-PF10 in this project • Timer0 • Added to this project to control the timing of the song.
Code • Code files used: • Talkthrough.h • main.c • Initialize.c • ISR.c • Process_data.c
Talkthrough.h • Bit Manipulation: #define bit_get(p,m) ((p) & (m)) #define bit_set(p,m) ((p) |= (m)) #define bit_clear(p,m) ((p) &= ~(m)) #define bit_flip(p,m) ((p) ^= (m)) #define bit_write(c,p,m) (c ? bit_set(p,m) : bit_clear(p,m)) #define BIT(x) (0x01 << (x)) #define LED9 BIT(5) #define LED8 BIT(4) #define LED7 BIT(3) #define LED6 BIT(2) #define LED5 BIT(1) #define LED4 BIT(0)
Talkthrough.h • Music Control extern int count; //initialize counter for Auld Lang Syne extern intspeedUp; //initialize counter for speeding up extern intslowDown; //initialize counter for slowing down • Counter for button PF8 extern int pf8_state;
Main.c • Uses a while loop to run the code indefinitely until it is halted. • Initializes the values for count, speedUp, slowDown and pf8_state to be 0.
Initialize.c • Initializes: • Init_EBIU • Init_Flags • Init_Flash • Init1836 • Init_Sport0 • Init_DMA • Enable_DMA_Sport0 • Init_Interrupts • Init_Timers
ISR.c • Interrupt Service Register • Sport0_RX_ISR • Sends audio to the speakers in this project • FlagA_ISR • *pFIO_FLAG_C == 0x0100 • PF8 • *pFIO_FLAG_C == 0x0200 • PF9 • *pFIO_FLAG_C == 0x0400 • PF10
ISR.c • FlagA_ISR (Cont.) • *pFlashA_PortB_Data • Controls the LEDs • Timer0_ISR • Controls timing for the notes
Process_data.c • I initialized the values for the radial frequencies of the notes and some other values used for the digital sinusoid equation for synthesizing the notes.
Process_data.c • An else if statement was used to cycle through the notes of the song.
Improvements • Timing for the notes sounds off and can use work. • Need to add a slight pause between notes with the same frequencies that are back to back. • Clean up unused code from the lab I initially used.
Special Thanks: • Xerxes Beharryfor helping me realize that the value of *pSIC_IAR2 should be 0xffff5ff4. • Ben Lishmanfor helping me debug my project. • HarenLachlandfor helping me understand the board throughout the course.