User Tools

Site Tools


projects:advent

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
projects:advent [2016-02-10 20:58]
robert [Circuit]
projects:advent [2016-02-10 21:11]
robert [Firmware]
Line 70: Line 70:
  
 ====Firmware==== ====Firmware====
-Coming ​soon.+Like the hardware, the firmware is really quite simple - It primarily consists of a state machine that deals with the switch input and turns on LEDs accordingly. The current number of LEDs that are on, and the sequence in which the LEDs turn on are kept in files on the mbed's embedded flash (accessible through the mass storage device).  
 + 
 +One of the very few aspects of note about the firmware is the bit-bang PWM: When an LED turns on, it fades in slowly over a second or so. Since the mbed doesn'​t have 24 PWM channels and the LEDs aren't multiplexed,​ I had to implement a software PWM generator. This will works on any one pin at a time and is reasonably accurate and stable because the state machine is clocked and the time taken to execute it is fairly constant. The fade-in of the LEDs follows a quadratic duty cycle in order to get a perceived linear (well, close enough) fading effect. Again, thanks to the computing power provided by the mbed this task did not even pose a remote challenge. 
 + 
 +<WRAP center round info 60%> 
 +Github repo coming ​soon. 
 +</​WRAP>​ 
projects/advent.txt · Last modified: 2016-02-10 21:14 by robert