Single sided serial board with Pololu USB ICSP Issues

Hello,

I've been using the single sided board that i built a while ago, but i no longer have a serial port! So for a few reasons i got the Pololu USB AVR Programmer (http://www.pololu.com/catalog/product/1300) and planned to use it to program the single sided serial board using ICSP, but i cant seem to get it to work.

I've successfully installed the programmer (prog on COM3, TTL comms on COM4), and can run the pololu config util which connects and i can change settings ok. When i plug the programming into the serial boards icsp header the programmer responds with flashing yellow indicating it has detected correct voltage and is ready for programming.

So, i have configured the Arduino IDE to use COM3, and the board to "Arduino Duemilanove or Nano w/ ATmega328" (I have the 328), but i get the timeout message as if i have the wrong COM port selected (stk500_disable(): protocol error, expect=0x14, resp=0x51). I currently have the log output set to verbose, and it doesn't really tell me much except:

         Using Port            : \\.\COM3
         Using Programmer      : stk500v1
         Overriding Baud Rate  : 57600

I have configured COM3 to 57600 to match. When i attempt to program the green programmer led flashes a few times (sending 0 [30] [20] 3 times) but then nothing else for maybe 5 seconds, then another flash (Sending Q [51]) and then protocol error. It appears the auto reset isn't working (should it with ICSP?), and even manual reset doesn't seem to make a difference (I've manually reset in the past programming with serial).

So, i've tried most options i think. I'm trying to use the serial board with Arduino Bootloader (I don't want to have to re-flash the bootloader in the future) and ICSP.

I have looked through the forum but i cant find anything related. Sorry this is a long post but im trying to cover eveything i've done so hopefully someone can help me :)

Thanks in advance, James

Ok, so i've been working on this and heres where im at:

You cannot use ICSP to load a sketch if you are using the bootloader. This is because the bootloader is expecting serial data through the tx and rx lines. So you eaither:

  1. Program with ICSP, not using the bootloader,
  2. Use the bootloader and use serial to communicate with the bootloader to load sketches.

So i have been able to program an ATtiny85 on braedboard using ICSP and wroks great. I have not flashed teh ATmega328 in the single sided serial board yet though. But i did manage to load sketches using the Pololu USB programmer!

To use the programmer i added a header to the Pololu programmer board and hooked the TX and RX lines to the serial arduino. I also hooked up GND and port A. I configured port A as DTR and connected this to the reset header on the arduino, then programmed using the Pololu TTL Serial port, not the programmer serial port. I had to load 1.03 firmware onto the programmer as the previous firmware inverted the signals. However, i had to manually reset to get it to work.

It looks like it's resetting the arduino (its pulling low), but stays low until its finished, as if its trying to flash using ICSP. Obviously when you manually reset sets reset low temporarily, then inits the avr allowing the bootloader to load over serial.

Is there a way i can make DTR pull low only until its about to load, or will i always have to manually reset??

Next step is to try ICSP on the serial arduino, without the bootloader!!

cheers

You need to set up the Pololu AVR Programmer: it's not STK500v1.

http://www.pololu.com/docs/0J17/3

Set it up and use the programmer with the correct Atmel microcontroller you're using: (ATMega328P or ATMega128)

Hi Aeturnalus, thanks for the reply.

I did try that in the beginning, but from what i understand, if i am to use the arduino bootloader, i need to have the line 'upload.using=bootloader' in my prefs file, which is default for all boards to tell it to use the bootloader method of flashing. If i change a board to use upload.using=avripsv2, then aren't i telling it that i want to use ICSP to flash instead of using the bootloader?

I just tried setting avrispv2 again though (I had made changes to add another board to allow me to program an ATtiny85 with arduino ide), and it does issue a DTR, but its keeps waiting for a respone that it never gets and i have to kill the ide to break out of it.

At least it does drops the DTR momentarily to reset the board, just looks like it doesn't get the serial comms to init bootloading :(

Is there a way i can make DTR pull low only until its about to load, or will i always have to manually reset??

Did you include the reset of the circuit? I believe the auto-reset circuit includes a resistor and a capacitor.

[quote author=Coding Badly link=topic=56335.msg405165#msg405165 date=1301033135] Did you include the reset of the circuit? I believe the auto-reset circuit includes a resistor and a capacitor. [/quote]

Ha, of course. I'm basically emulating the serial port. On the arduino the dtr goes through the 100n cap and 10k resister and onto the reset pin of avr!! I've been running the dtr straight into the reset header on the arduino. Now that i've run it straight into the dtr line of the serial port it works a charm!!

If i continue to use the bootloader with the sss arduino i might have to knock up a serial cable for it :)

Thank you for your help!

(Now to flash the ATmega328 on the arduino with ICSP!! At least i can always re-flash the bootloader down the track)