Question
Project : Read the Dragon12-Light board Users Manual on seven segment display. Study this example program, Simple.txt. Compile, download, and test your program. Be sure
Project: Read the Dragon12-Light board Users Manual on seven segment display. Study this example program, Simple.txt. Compile, download, and test your program. Be sure you understand how it works. Then, write a assembly program to display a set of words/numbers in four different ways (or four different patterns).
Your program must have the following two display patterns:
- Flash four characters/numbers at once (think of a blinking light) for six times.
- Present characters/numbers one at time in succession on all four units for six times.
You have the freedom to choose two additional ways (or patterns). Each pattern must be displayed for at least six times or four seconds. No two people should have the exact same words/numbers, and no two people should have the exact same display patterns. Try to use functions to make your program short and readable. Repeatedly coping and pasting the same or similar codes is bad programming practice.
Here are some examples: ECPI ROCS, EET430 ROCS, ECPI IS COOL, EET 430 IS Fun. Be creative and have fun.
Example
//***************************************************************** // Include derivative-specific definitions //***************************************************************** //The microcontroller chip used by Dragon12-Light boards #include
//***************************************************************** // Function Prototype //***************************************************************** void InitSevenSegs(void); void KillTime(unsigned int, unsigned int);
//***************************************************************** // Main program section //***************************************************************** void main(void) { unsigned int i = 0; InitSevenSegs(); PORTB = 0x00; //turn off all segments //do this forever for (;;) { for (i=0; i<800; i++){ PTP = 0x2E; //set PTP0 low to enable Dig3 PORTB = 0x76; //display 'H' KillTime(40, 180); PTP = 0x2D; //set PTP1 low to enable Dig3 PORTB = 0x3E; //display 'U' KillTime(40, 180); } for (i=0; i<6; i++){ PTP = 0x2B; //set PTP2 low to enable Dig1 PORTB = 0x76; //display 'H' KillTime(30, 65000); PTP = 0x27; //set PTP3 low to enable Dig0 PORTB = 0x3E; //display 'U' KillTime(30, 65000); } } }
//***************************************************************** // Function: InitSevenSegs //***************************************************************** void InitSevenSegs(void) { //Seven segments are connected to PORTB on Dragon12-Light DDRB = 0xFF; //make port B an output port DDRP = 0xFF; //make port P an output port //PTP0, PTP1, PTP2 and PTP3 of port P control the 4 units of the seven seg. display //GRB LED is controlled by PTP4-PTP6: PTP4=1, red; PTP5=1, blue; PTP6=1, green PTP = 0x40; //make PTP0-PTP3 low to enable the seven seg. dispaly //and make PTP6 high to turn on green RGB LED }
//***************************************************************** // Function: KillTime //***************************************************************** void KillTime(unsigned int limit1, unsigned int limit2) {
unsigned int n=0; unsigned int m=0; for (n=0; n
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started