Wednesday, October 04, 2006

Microcontroller board update

Good news, with Brian's (of www.bdmicro.com) patience I have successfully run a test program on the Mavric board. Of course had I done everything right last night I could have reached this step sooner. Here's what all I had to do to get this thing to blink the LED as it should:

1. After soldering the rest of the thru-hole components on the board and getting the go ahead from Brian about the missing (but in the mail) caps I decided on an RC reciever battery (5V DC) to connect the Vcc and GND pins bypassing the LDO regulator.
2. I installed AVRStudio 4 and it's service pack, WinAVR (except PN), and AVRLib
3. Following along with the ICE Cube quick start guide, I atteched it to the JTAG header, connected the battery, and ran AVRStudio.
4. Using the Tools menu I selected AVR Prog to loag the JTAG ICE image to the ICE CUBE. Worked perfectly
5. Using the command line ran make on the Hello World sample from Brian's site. Compiled fine.
6. Using the JTAGICE under Tools programmed the board with the .hex file generated. Programmed fine.
7. Nothing ... no blinking. After an hour or so, I decided to look at it with fresh eyes and went to bed
8. I decided to read the user help in AVRStudio (I know ... wierd isn't it) and read the following under known issues: "ATmega128 in ATmega103 compatibility mode: Not supported, but will be available in a later version of AVR Studio 4." I remembered seeing, reading, something about 103 compatibility mode and found it under the Fuses tab in the JTAG ICE screen. Cleared the fuse and now was seeing a very slow (say 8hz blinking LED). Ok, so it works ... kinda.
9. Read the ATMega datasheet and run ferquency calc in Excel to confirm register settings.
10. Brian's email telling me that the chip has not been programmed for the 16MHz external clock and that the fuse sertting are in the Mavric user manual. DOH! That's where I saw them.
11. Set the fuses per the manual, reset the code fro the Hello World same program ... viola!

Next step, figure out how to use JTAG debugging. Oh, and I've noticed what may be a solder bridge on two of PortB's pins that need to be inspected closer.

Onward,
Jay