ECE473 x_Lab2 (f2023): Purpose: *Learn to access Xmega ports/pins and set i/o configuration. *Time multiplex a display *Share i/o pins with push buttons to save pins. *Debouncing push button switches. *Use a software timing loop to create delays *Understand the limitations of using software timed loops Project Specifications: *Implement a four-digit multiplexed LED display with eight push button switches. *Program uC to display (on LEDs) values created by the push button switches. *Leading zero suppression should be implemented. *Initially the count indicates a single zero. *The display operates in base ten. *The I/O board push buttons will be utilized as follows: Button S0 increments the value displayed on the display by one. Button S1 increments by two, button S2 by four, etc. Button S7 increments by 128. The display max count is 1023, followed by 0. Calculations, Drawings and Questions before lab: *Draw a complete schematic diagram of how you are going to hook up the display and switch board to port A and C. This is a board level schematic except where some detail of on-board circuitry is helpful. *Port A will be used to "sink" segment currents AND also to sense the state of the push button switches. *Port C bits 4-6 will select the digit to display via the 74HC138 3-to-8 decoder. Note that the colon is considered a "digit". *Port C bit 7 will be used to implement PWM dimming control in a following lab. It will be driven continuously low for now to saturate Q1. *Can the XMega total port/device current capacity be exceeded with our circuit? *Other PORT C bits are not to be used at this time. Assembly notes: *Use a ribbon cable to make the connection between the display board to PORTA to the uC. *Place and solder the LED display on the _TOP_ or component side of the board. *Power and ground on the XMega board will provide power through the connectors. Software Notes: *Copy over the Makefile from lab1 and edit the project name. *Write some test code to test the display and the push buttons. This will check your wiring and avoid you spending too much time fiddling with software that is exercising broken hardware. This code will take you only a few minutes to write and will possibly save you hours or days. *This is most easily done with C preprocessor #ifdef statements. That way, your test code is always available in the future with the change of one constant. *Strongly recommend writing out pseudo-code or flowchart for your lab2 code. Don't start by first writing code. *Use of interrupts or timers is not allowed. We will add more grief later. :^) Testing: *Test and debug code and hardware. Write the test software first. You can add the rest of your code later. Turn into COE TEACH: *A _COPY_ of your schematic diagram of your circuit. Neatly done hand-drawn schematics are preferable. If we can't read them, its zero points. *The file to submit is created with the linux tar command: tar -cvfz lab2.tar.gz file1 file2 file3 ..... This would create a single file "lab2.tar.gz" from the listed files after compression by gzip. Synopsis: (tar)tape archive, (c)create, (v)verbose, (f)use given tar file name, (z)compress with gzip You will demonstrate the functionality of your board and code. This will happen in person, in lab. Grading: *Circuit function +80% (demo system in lab) -performs as expected,switches debouncing cleanly -if count "jumps" -deduct 10% -dim display/flickers -deduct 5% -other abnormality -deduct 5% *Documentation +20% -complete, neat, correct -code well written, commented, including test code -sloppy/missing documentation -deduct 10% -poorly commented code -deduct 10% Lab weighting = 0.15