bitbang on Arduino 0009

Hello all,

I recently assembled a BBB from www.moderndevice.com. The ATmega168 comes preloaded with ADABOOT and the blink sketch. I powered it up, plugged it into my breadboard and voila a led on pin 13 blinks. After fighting with vista a bit, I got Arduino 0009 to be happy and compiled a new sketch of blink with different timings.

Being cheap, I remembered LadyAda’s minipov3 kit that has a DB9 female connector right on board hooked up via a 3 resistors and diodes. I started to compare the Atmel spec sheets for the ATtiny2313 and the ATmega168. looking at the schematic for the BBB I realized that the ICSP header is hooked up to reset, SCK, MISO and MOSI already.

so I wired it up

DB9 female pin 3 → 4.7k resistor & 5.1v zenner → ICSP 4 → MOSI (pin 17)
DB9 female pin 4 → 4.7k resistor & 5.1v zenner → ICSP 3 → SCK (pin 19)
DB9 female pin 5 → ground
DB9 female pin 7 → 4.7k resistor & 5.1v zenner → ICSP 5 → Reset (pin 1)
DB9 female pin 8 → ICSP 1 → MISO (pin 18)

in preferences.txt I set upload.programmer=dasa
I also turned the baud rate down to 9600 and verbose output on. from the output it looks like it is successful. however pin 13 no longer blinks at all. I’ll attach the meat of the verbose output in a reply to this message.

any other bitbangers out there?

thoughts?

thanks!
-Erik

the output log:

Binary sketch size: 1112 bytes (of a 14336 byte maximum)

C:\Users\Erik\sandbox\arduino-0009\tools/avr/bin/avrdude -CC:\Users\Erik\sandbox\arduino-0009\tools/avr/etc/avrdude.conf -v -v -v -v -pm168 -F -cdasa -PCOM1 -b9600 -D -V -Uflash:w:C:\Users\Erik\Documents\Arduino\Blink\applet\Blink.hex:i

avrdude: Version 5.3.1, compiled on May 15 2007 at 17:05:10 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

System wide configuration file is "C:\Users\Erik\sandbox\arduino-0009\tools/avr/etc/avrdude.conf"

Using Port : COM1 Using Programmer : dasa Overriding Baud Rate : 9600 avrdude: ser_open(): opened comm port "COM1", handle 0x104 AVR Part : ATMEGA168 Chip Erase delay : 9000 us PAGEL : PD7 BS2 : PC2 RESET disposition : dedicated RETRY pulse : SCK serial program mode : yes parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 ByteDelay : 0 PollIndex : 3 PollValue : 0x53 Memory Detail :

Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


eeprom 65 5 4 0 no 512 4 0 3600 3600 0xff 0xff Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


flash 65 6 128 0 yes 16384 128 128 4500 4500 0xff 0xff Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : SERBB Description : serial port banging, reset=rts sck=dtr mosi=txd miso=cts

bitbang_cmd(): [ AC 53 00 00 ] [ 00 00 53 00 ] avrdude: AVR device initialized and ready to accept instructions

Reading | bitbang_cmd(): [ 30 00 00 00 ] [ 00 30 00 1E ] bitbang_cmd(): [ 30 00 01 00 ] [ 00 30 00 94 ]

##########bitbang_cmd(): [ 30 00 02 00 ] [ 00 30 00 06 ]
############################ | 100% 0.00s

avrdude: Device signature = 0x1e9406 bitbang_cmd(): [ A0 01 FC 00 ] [ 00 A0 01 FF ] bitbang_cmd(): [ A0 01 FD 00 ] [ 00 A0 01 FF ] bitbang_cmd(): [ A0 01 FE 00 ] [ 00 A0 01 FF ] bitbang_cmd(): [ A0 01 FF 00 ] [ 00 A0 01 FF ] avrdude: reading input file "C:\Users\Erik\Documents\Arduino\Blink\applet\Blink.hex" avrdude: writing flash (1112 bytes):

Writing | bitbang_cmd(): [ 40 00 00 0C ] [ 00 40 00 00 ] bitbang_cmd(): [ 48 00 00 94 ] [ 0C 48 00 00 ] etc...

| 100% 1.02s

avrdude: 1112 bytes of flash written avrdude: ser_close(): closed comm port handle 0x104

avrdude done. Thank you.

So I decided to just load the sketch straight and it works great.

avrdude -c dasa -p m168 -B 25 -P COM1 -v -U flash:w:C:\Users\Erik\ Documents\Arduino\Blink\applet\Blink.hex:i

I guess it leaves me wondering why maintain a bootloader? what fabulousness am I missing out on?