Spinning LED Display Andrew Petersen + JP Skeath Purpose of the Project Demonstrate Proficiency with precision timing, the HCS12 microcontroller, and mechanical interfacing Design and interface a system that has a stator and rotor Reproduce a modern method of displaying data Background Information ● ● ● ● Platform gives form and support LED’s turn on and off for a set period of time Motor rotates the platform faster than your eye “refresh rate” ○ Higher RPM increases the resolution ○ Faster blinks increase the sharpness of the image Turning specific LED’s on at precise timings provide the message http://hackedgadgets.com/2010/05/03/rotating-led-globe/ Physical Construction 16 LED’s on 2 vertical panels 1 300 RPM DC motor HCS12 Nanocore module standalone 9V battery supply LED driver with constant current sink (We used MAX6969ANG) Letter Patterns - 38 Supported characters A-Z, 0-9, :, . 5x8 pixels each Write each column one at a time to display with time delay in between - LED’s correspond to vertical resolution Timing between displayed LED columns determines horizontal spacing All patterns stored in #definitions in C-code - Display Timing -By utilizing each LED panel we effectively double the framerate compared to motor rotation speed (2*300rpm -> 10Hz theoretical) -Matching programmed half rotation time (T_hrot) results in stable image -Variations in half rotation timing cause characters to “spin” around display Display Timing cont. Writing data to LED panels: -Utilizes SPI interface -Uses MAX6969 LED Driver -Provides 16 current sinks. 8 used for each panel -This functionality encapsulated in DriveLED() function Pseudocode of Program Main Program Configure DDRT and DDRM Initialize SPI loop forever print string to display end Printing Character write delay write delay ... write delay delay 1st column corr. to char T_b 2nd column corr. to char T_b 5th column corr. to char T_b T_b Pseudocode cont. Printing a string for each char in string print char to one panel on display end delay (half rotation time)- (elapsed string time) for each char in string print char to other panel on display end delay (half rotation time)- (elapsed string time) - Utilize free running counter to keep track of elapsed time to display message on 1st panel - Subtract elapsed time from half rotation time to determine when to display message again on 2nd panel C Code Snippets switch(type){ case(0): driveLED((unsigned int)(_A0)); DelayuSec(t); driveLED((unsigned int)(_A1)); DelayuSec(t); driveLED((unsigned int)(_A2)); DelayuSec(t); driveLED((unsigned int)(_A3)); DelayuSec(t); driveLED((unsigned int)(_A4)); DelayuSec(t); driveLED(0x0000); DelayuSec(t); break; ... void driveLED(unsigned int data){ PTT = PTT & 0xFE; //Sets PT0 (LE) to low putcharSPI((char)(data >> 8)); putcharSPI((char)(data & 0x00FF)); PTT = PTT | 0x01; //Sets PT0 (LE) to high PTT = PTT & 0xFE; //Sets PT0 (LE) to low } printStrLED("HELLO"); Current Results - Can display characters Currently limited to 4 characters (more in advanced version) - Due to half rotation delay calculation, 4 characters fit comfortably in a semicircle on our display NOTE: Image continuous with eyes. Video camera caused disruption due to rolling shutter. Difficulties Encountered ● ● ● ● Brightness of the LEDs and visibility of project in general Nanocore module failure during one test (unsure of cause) Power supply for the motor(stall current of about 2A. Start of .7 A) Noisy Power supply DC voltage (fluctuations cause different RPMs) ○ ● Coupling Capacitor solution Weight Constraints ○ ○ Wobbling Possible loss of RPM Questions?