You need to design a system based on the MSP-430 microcontroller to display the
ID: 2079610 • Letter: Y
Question
You need to design a system based on the MSP-430 microcontroller to display the number of the next customer to serve in a commercial environment. Your system must display customer numbers from zero to 99 using two seven-segment LED display devices. Upon reset, the system must scroll the message "HELPING CLIENT 0". The user will then be able to press a button to increment the displayed counter. Every time the counter changes, the system must scroll the message "HELPING CLIENT X", where X will cover the range up to 99 and flash three times before becoming stably on. Once the counter reaches 99, the next increment must set the counter to zero. To indicate this wraparound transition, the system must display the following sequence twice at a visible speed: Write an MSP430 C program to control your system. For testing and demo purposes, the actual counter sequence to be displayed must be: 0, 1, 2, 98, 99, 0, 1, 2, and so on. Your program must have at least three functions.Explanation / Answer
#include "msp430g2553.h" void main (void) { WDTCTL = WDTPW + WDTHOLD; //stop WDT P1DIR = 0xFF; // P1DIR set as output,connected to LED segments // Single step through the code below to view all the characters //---------------------------------------// // 7 segments of the Display // //---------------------------------------// P1OUT = 0x00; // No Segments ON P1OUT = 0x01; // Segment a ON P1OUT = 0x02; // Segment b ON P1OUT = 0x04; // Segment c ON P1OUT = 0x08; // Segment d ON P1OUT = 0x10; // Segment e ON P1OUT = 0x20; // Segment f ON P1OUT = 0x40; // Segment g ON P1OUT = 0x80; // Segment dp ON P1OUT = 0xFF; // All Segments ON //--------------------------------------// // Alpha Numeric Characters 0-F // //--------------------------------------// P1OUT = 0x3F; //0 P1OUT = 0x06; //1 P1OUT = 0x5B; //2 P1OUT = 0x4F; //3 P1OUT = 0x66; //4 P1OUT = 0x6D; //5 P1OUT = 0x7D; //6 P1OUT = 0x07; //7 P1OUT = 0x7F; //8 P1OUT = 0x6F; //9 P1OUT = 0x77; //A P1OUT = 0x7C; //b P1OUT = 0x39; //C P1OUT = 0x5E; //d P1OUT = 0x79; //E P1OUT = 0x71; //F //--------------------------------------------// // Some Extra English Characters // //--------------------------------------------// P1OUT = 0x76; //H P1OUT = 0x38; //L P1OUT = 0x54; //n P1OUT = 0x73; //P P1OUT = 0x78; //t P1OUT = 0x3E; //U P1OUT = 0x72; //Y }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.