Microcomputer Systems I ECE 3551 – Fall 2010 Ryan M. Winget
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.
Used Digital Sinusoids for the sound synthesis. f s = Hz f 0 = note frequency
Notef 0 (Hz)ω0ω0 Max n for 2pi b c# d# e f# g# b c#
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 files used: ◦ Talkthrough.h ◦ main.c ◦ Initialize.c ◦ ISR.c ◦ Process_data.c
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)
Music Control extern int count; //initialize counter for Auld Lang Syne extern int speedUp; //initialize counter for speeding up extern int slowDown; //initialize counter for slowing down Counter for button PF8 extern int pf8_state;
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.
Initializes: ◦ Init_EBIU ◦ Init_Flags ◦ Init_Flash ◦ Init1836 ◦ Init_Sport0 ◦ Init_DMA ◦ Enable_DMA_Sport0 ◦ Init_Interrupts ◦ Init_Timers
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
FlagA_ISR (Cont.) ◦ *pFlashA_PortB_Data Controls the LEDs Timer0_ISR ◦ Controls timing for the notes
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.
An else if statement was used to cycle through the notes of the song.
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.
Xerxes Beharry for helping me realize that the value of *pSIC_IAR2 should be 0xffff5ff4. Ben Lishman for helping me debug my project. Haren Lachland for helping me understand the board throughout the course.