AVR Drivers: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
Some drivers have an Atmel microprocessor on board to control different modes. This microprocessor controls the number of modes, the brightness of the modes, the different flashing modes (strobe, SOS, etc.), mode memory, and low battery warnings. Atmel processors are programmable therefore the same driver can be loaded with different settings to customize the light with whatever features you want. This page will summarize some of the things you will need if you want to program your own drivers. This is based on a [http://budgetlightforum.cz.cc/node/799 Budget Light Forum discussion thread] where you can go for help or to get answers to your questions. This whole thing was started by a BLF member, Tido.
[[File:Avrisp.jpg|thumb|200px|SOIC 8 clip attached to flashlight driver board for AVR ISP programming]]Some drivers have an Atmel microprocessor on board to control different modes. This microprocessor controls the number of modes, the brightness of the modes, the different flashing modes (strobe, SOS, etc.), mode memory, and low battery warnings. Atmel processors are programmable therefore the same driver can be loaded with different settings to customize the light with whatever features you want. This page will summarize some of the things you will need if you want to program your own drivers. This is based on a [http://budgetlightforum.cz.cc/node/799 Budget Light Forum discussion thread] where you can go for help or to get answers to your questions. This whole thing was started by a BLF member, Tido.


All of this is based on AVR tools developed for Atmel chips, which is mostly open source (free). [http://en.wikipedia.org/wiki/Atmel_AVR Wikipedia article]. ISP means "In Sytem Programming," in other words, the chip can be reprogrammed while still soldered in place.
All of this is based on AVR tools developed for Atmel chips, which is mostly open source (free). [http://en.wikipedia.org/wiki/Atmel_AVR Wikipedia article]. ISP means "In Sytem Programming," in other words, the chip can be reprogrammed while still soldered in place.
Line 7: Line 7:
===Drivers===
===Drivers===


[[File:Avrisp.jpg|thumb|200px|SOIC 8 clip attached to flashlight driver board for AVR ISP programming]]
Of course you will need a flashlight driver circuit board first. There are several NANJG drivers available that include an Atmel TINY13A chip that can be programmed. These chips can also be locked down so they can't be changed, but so far none seem to be. However, some variants of NANJG drivers use a PIC chip that can not be programmed with AVR tools. See [[Popular drivers]] to see some of the drivers people have been using. Most of these use current regulators to limit the current delivered to the LED while the Atmel chip itself turns the power on and off very quickly, leaving it on for full power, or flashing on and off quickly to simulate a lower mode. As the percentage of off time increases, the light gets dimmer. By setting the on-off cycles to a high frequency, the eye just sees this as a lower mode even when the LED is barely lit. This is called Pulse Width Modulation (PWM). By slowing the flashing more, you get a visible strobe mode or SOS modes. So essentially the Atmel chip is just a computer-controlled on-off switch.
Of course you will need a flashlight driver circuit board first. There are several NANJG drivers available that include an Atmel TINY13A chip that can be programmed. These chips can also be locked down so they can't be changed, but so far none seem to be. However, some variants of NANJG drivers use a PIC chip that can not be programmed with AVR tools. See [[Popular drivers]] to see some of the drivers people have been using. Most of these use current regulators to limit the current delivered to the LED while the Atmel chip itself turns the power on and off very quickly, leaving it on for full power, or flashing on and off quickly to simulate a lower mode. As the percentage of off time increases, the light gets dimmer. By setting the on-off cycles to a high frequency, the eye just sees this as a lower mode even when the LED is barely lit. This is called Pulse Width Modulation (PWM). By slowing the flashing more, you get a visible strobe mode or SOS modes. So essentially the Atmel chip is just a computer-controlled on-off switch.