110 likes | 230 Views
Microcomputer Systems I ECE 3551 MOHAMMED ALYAMANI 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. Solution and Operation:.
E N D
Microcomputer Systems IECE 3551MOHAMMED ALYAMANIInstructor: 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.
Solution and Operation: • Press PF8 once: mute the sound and all LEDs off. Second press plays sound the, 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
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 (Mohammed < 5) // if Mohammed greater than 5 stop loading data { Mohammed++; // let Mohammed increase }
ISR.c decrease volume { *pFIO_FLAG_C = 0x0400; // confirm PF10 interrupt handling if (Mohammed != 0) // if Mohammed = 0 stop loading data { Mohammed--; // decreases Mohammed } }
Main.c int pf8 = 0; //The pf8 is a variable interger for the mute. intMohammed= 1; //The Mohammed is a variable interger for decreasing and increasing . int pf11=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 intMohammed; extern int volume1; extern short pf11; • Prototypes void Process_Data(void);
Problems • C++
References • Dr. Keputska’s web page • http://my.fit.edu/~vkeputska/ece3551/