30 September 2008

My first Atmel program

I have been able to program an ATtiny2313 with a very simple setup:
  • 1 DB25, 3 resistors and one 20-pin socket
  • avreal32 Win software
  • computer with a parallel port ("LPT")
Even the laptop was able to drive the programmer. Although the female lab personnel (AKA wife) said the programmer doesn't look trustworthy, it did the job.

I can both read and write the uC. The "reading" ability is a huge improvement from my serial PIC16F84 write-only programmer, since I can write the chip and then verify what was written on it. This is how I know the chip was programmed with my code.

The commands for my LPT1 and my programmer:
READ: avreal32 +TINY2313 -ap -p1(0x378) -o0 -r a.hex
WRITE: avreal32 +TINY2313 -ap -p1(0x378) -o0 -w -c b.hex

Reading the chip displays:

v1.26rev0 (Aug 7 2008 17:52:48) http://www.ln.ua/~real/avreal
bug-reports, suggestions and so on mail to [censored]
Command: +TINY2313 -ap -p1(0x378) -o0 -r aaa.hex
Power ON
Device connected, TINY2313 detected
Chip not locked
Fuses
OSCCALs = 68 6A
CKDIV = 0
CKOUT = 1
SUT = 2
CKSEL = 4
DWEN = 1
EESAVE = 1
WDTON = 1
BODLEVEL = 7
RSTDISBL = 1
SELFPRGEN = 1
Reading CODE memory
.... done
Reset pin released
Power OFF


Fuse values are displayed in decimal, while the datasheet lists their meaning bitwise.

Unfortunately the success was only partial, since the uC didn't seem to produce any activity out of the programmed code.

1 comment:

Paolo said...

By the way, the system says this was the 100th post in this blog!