130 likes | 279 Views
Microcomputer Systems I ECE 3551 Fahad Alqasim Instructor: Dr. Kepuska. Purpose:. To use the knowledge learned in ECE-3551, to make a final project. The project is to do the following : Mute the sound. Increase volume . Decrease volume. FIR High Pass filter and FIR low Pass filter.
E N D
Microcomputer Systems IECE 3551Fahad AlqasimInstructor: Dr. Kepuska
Purpose: • To use the knowledge learned in ECE-3551, to make a final project. The project is to do the following : • Mute the sound. • Increase volume . • Decrease volume. • FIR High Pass filter and FIR low Pass filter.
Solution and Operation: • Press PF8 once: mute the sound and all LEDs off. Second press plays soundthe, and LED1 ON. • Press PF9 once: increase the volume, also LED1 and LED2 ON. Second press increases the volume more , Also, LED1to LED3 ON. Third press increases the volume more, also, LED1to LED4 ON. Fourth press increase the volume to the maximum. also, LED1 to LED5 ON • Press PF10 once: decrease the volume, also LED1 to LED 4 ON. The volume will decrease by pressing more until it is mute. Also, the LEDs decrease as well • Press PF11 once: a FIR low pass filter data is sent to the output, also, LED4, LED5, LED8 and LED9 ON . Second press a FIR high pass filter data is sent to the output. Also, LED6 and LED7 ON
Code ISR .c Mute the sound { if (*pFIO_FLAG_D == 0x0100) // PF8 switch { *pFIO_FLAG_C = 0x100;// Confirm interrupt handling workaround pf8++; // Mute variable, self-increment if (pf8 == 2) //If mute =1, stop loading data. { pf8 = 0; } mute(); // apply the mute function if pf8=1 }
ISR.c Increase volume if (*pFIO_FLAG_C == 0x0200) // PF89switch { *pFIO_FLAG_C = 0x0200; // Confirm interrupt handling workaround if (fahad < 5) // if fahad greater than 5 stop loading data { fahad++; // let fahad increase }
ISR.c decrease volume { *pFIO_FLAG_C = 0x0400; // confirm PF10 interrupt handling if (fahad != 0) // if fahad = 0 stop loading data { fahad--; // decreases fahad } }
ISR.c high pass and low pass filter else if (*pFIO_FLAG_C == 0x0800) { *pFIO_FLAG_C = 0x0800; // confirm PF11 interrupt handling pf11++; // filter variable, self-increment if (pf11 > 2) //If filter greater than 2, stop loading data. { pf11 = 0; } } }
ISR.c high pass and low pass filter if(pf11==1) { iChannel0LeftIn = iRxBuffer1[INTERNAL_ADC_L0]; //Data from DAC left to left channel-in iChannel0RightIn = iRxBuffer1[INTERNAL_ADC_R0]; //Data from DAC right to right channel-in Lowpass(); // apply low pass filter to the data iTxBuffer1[INTERNAL_DAC_L0] = iChannel0LeftOut; //Data from channel-out to DAC. iTxBuffer1[INTERNAL_DAC_R0] = iChannel0RightOut; //Data from channel-out to DAC } if(pf11==2) { iChannel0LeftIn = iRxBuffer1[INTERNAL_ADC_L0]; //Data from DAC left to left channel-in iChannel0RightIn = iRxBuffer1[INTERNAL_ADC_R0]; //Data from DAC right to right channel-in Highpass(); // apply high pass filter to the data iTxBuffer1[INTERNAL_DAC_L0] = iChannel0LeftOut; //Data from channel-out to DAC. iTxBuffer1[INTERNAL_DAC_R0] = iChannel0RightOut; //Data from channel-out to DAC }
Main.c int pf8 = 0; //The pf8 is a variable interger for the mute. intfahad = 1; //The fahadis a variable interger for decreasing and increasing . intpf11=0; //The pf11 is a variable interger for the filter short led= 0;
Talkthrough.h • Global variables extern int iChannel0LeftIn; extern int iChannel0RightIn; extern int iChannel0LeftOut; extern int iChannel0RightOut; extern short hp; extern short led; extern intfahad; extern int volume1; extern short pf11; • Prototypes void Process_Data(void); void Lowpass(void); void Highpass(void);
Problems • C++
References • Dr. Keputska’s web page • http://my.fit.edu/~vkeputska/ece3551/