2009-12-19

SolarLight (3) - First Prototype


Well after the initial breadboard, I decided to do some extra work on the Solarlight. I built a perfboard/smd board prototype and as usual I had to do some "adjustments".
Since my ATTiny45U in DIP are "precious" I wanted to use instead one of my ATTiny15L that I had around (a previous buy in ebay).

There are some major differences between the Tiny45 and the Tiny15L:
- Software - the Tiny15L does not have RAM and has a fixed length stack (3), programming it using avr-gcc is difficult and involves "tweaking" the code (see more here). The Tiny15L also does not have the debugwire interface, so debugging is a bit more difficult. Therefore I decided to develop the code in AVRStudio in windows (bah!) in assembler, as much as I like linux the simulators available are still far from perfect. One final remark on the simulator in AVRStudio, always read the notes about your processor, in the case of the ATTiny15L the watchdog is not simulated and the noise reduction sleep/wake-up on ADC conversion complete is not simulated!!
- Hardware - the pins and ADC input PB3/PB4 are switched (mentioned here), the ADC converter internal reference is fixed to 2.56V (ATTiny45U has 2.56V and 1.1V), the ATTiny45U has more power saving options and the frequency of the maximum PLL frequency (important for a high speed converter) is higher on the Tiny45 (8x8MHz=64MHz) than on the Tiny15 (16x1.6MHz=25.6MHz), the CPU clock also higher on the Tiny45 (8MHz) against the Tiny15 (16MHz).

The light is working but there are still some software issues to solve. As I mentioned the ATtiny15L does not have the debugwire interface, in order to debug the project I decided to encode data in the status LED as a bit-banged serial port (like this one), when I want to see a value of a conversion or get a check point or value, I change the code and wait for it to show up on the scope.
I also decided that I had to have a way of forcing a full light mode and a half light mode (both independent of the battery and charging) in case I connected the light using an adaptor (no solar light mode). For this I thought of using this same status pin, curiously this pin is placed between VCC and GND in the programming connector, so a simple jumper could activate these modes in the final product.

No comments: