Presentation 7

Download Report

Transcript Presentation 7

Digi-Brush
Software Narrative
Presenter: Caleb Ayew-ew
Team Members:
Josh Long
Katie Schremser
Software Design Considerations
• Two Major Devices to be Programmed
– Freescale MC9S12DP512MPVE
• Handles Color Changing, Touch Screen, and Force
Resistor ATD conversions
• “Debounces” Save and Clear buttons
• Generates I2C packets for Brush’s LED Driver
• SPI communication with FPGA
– Cyclone II FPGA
• Process SPI from Micro
– Generates Analog VGA signal for VDAC
– Saves image to SD card via SPI
Flow Main()
Start
Initialize
Peripherals
and Registers
getTouchScreen()
Save()
updateDisplay()
Clear()
getColorPots()
Update()
Function?
decodeSPI()
updateLEDDriver()
save()
Clear()
Micro Process
FPGA Comm.
FPGA Process
Micro-Controller Narrative
• To get the touch screen information 5 ATD conversions are collected for
the X coordinate and averaged, then the STDx is taken. If STDx<10 it is not
a touch. If it is >10 it will continue to get Y then repeats the process.
• After a touch is recognized a packet is formed and sent via SPI to the
Cyclone II device. This packet contains the current color and coordinates
just calculated.
• Analog inputs for the Color pots will continuously be converted and
polled. When a pot is selected, the microcontroller will recognize it by
determining the change in ATD value. The current color will then average
with the recently pressed color to simulate mixing.
• The current color will be sent to the LED driver when it changes via IIC
protocols.
• Then two GPIO pins are used as interrupts to save or clear the image.
These are “debounced” in software by comparing previous values with
current ones. If pressed another packet will be formed and sent to the
FPGA. This packet will simply state that a save or clear request has
occurred.
FPGA Narrative
• Once a packet is received from the Micro it decodes it.
– Save will check to see if an SD card is there if so it will fetch
all the information stored in the external RAM, convert to
viable format(unsure which yet) then write it onto the SD
card. If no SD is present, it will do nothing.
– Clear will send 3FFh to all RGB pins to create a new white
screen.
– Update Display operates using double buffering. It will
write the coords. and colors from the Micro into external
RAM then when finished transfer that information from
RAM into the VDAC.
Hierarchy Main()
Main
getTouchPanel
getColorPots
changeColor
updateLEDDriver
frATD
updateDisplay
isrVrti
Save/Clear
Questions / Discussion