100 likes | 268 Views
System Software Design and Documentation. Western Washington University By: Anthony Zarate. General System Design. Atmel ATMEGA 2560 16MHz Available Memory: 256Kbytes Flash 8Kbytes SRAM 4096 bytes EEPROM Memory Usage: 10Kbytes Flash (currently at 5.22Kbytes ) 400 Bytes SRAM
E N D
System Software Design and Documentation Western Washington University By: Anthony Zarate
General System Design • Atmel ATMEGA 2560 • 16MHz • Available Memory: • 256Kbytes Flash • 8Kbytes SRAM • 4096 bytes EEPROM • Memory Usage: • 10Kbytes Flash (currently at 5.22Kbytes) • 400 Bytes SRAM • Timeslice Kernel
Calibrate() • Function that takes baseline light to voltage values from all 28 sensors to create an array, then sends array to the Tolerance() function. When a sensor value is taken, the value is compared to an acceptable sensor input range. If value is ok, ring blinks twice; if value is off, ring stays on during calibration. • Only called once during initialization. • Period: ---- • Execution Time: Blink Time * # Rings = 75ms * 28 = 728ms • CPU Load: Not factored, not part of timeslice.
Tolerance() • Function that multiplies values in baseline array by appropriate reflection coefficients to create a light tolerance level. Reflection coefficients are different depending on sensor placement. • Only called once during initialization. • Period: ---- • Execution Time: 5us • CPU Load: Not factored, not part of timeslice.
Main() • Runs Timeslice loop. • Period: 10ms • Total Execution time: 20us • Total CPU Load: .2%
SensorInput() • Function that gets sensor input from onboard ADC’s and multiplexing ADC and stores in an array to be passed to RingOutput(). • Period: 10ms • Execution Time: 10us • CPU Load: L = 10us/10ms = .001 or .1%
RingOutput() • Functions that compares the sensor input array and the tolerance array to determine whether a ring should be turned on. • Period: 10ms • Execution Time: 10us • CPU Load: L = 10us/10ms = .001 or .1%
CPU Load • Lmax = 10us + 10us = .2% 10ms 10ms
DataFlow Diagrams • Z:\Senior Project\system software design