Nano bootloader + watchdog reset + Parallel port programmer hell

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good day All,

 Up until a week or so ago I was convinced that my Arduino Nano's (V3) were unkillable (R), not so it seems!

Shorting 5V to GND was one way, but the lights all blink in a fantastic semi random way, so not a total loss. But an understandable death...

THe not so great death was adding a watchdog timer with what I thought was a sensible timeout, and having it lockup the Arduino in a 15ms rest loop... Turns out it is possibly a bootloader issue...

 Anyway, that aside, no worries can make a parallel port programmer and just flash it with a new bootloader. Its funny having to get a parallel port card, where even a PCI slot is getting rare!

This didnt work, and I am stuck.

 

Here is what I did:

 

Using http://www.mtcnet.net/~henryvm/wdt/wd.h

Modifyng a bit to make it more compatible by adding the following lines:

#define init_watchdog(mode, timeout) WD_SET(mode, timeout)
#define wdt_reset WD_AVR_RESET()
#define wd_reset() WD_AVR_RESET()

Then in my project:

#include "wd.h"
...
void init_hardware(void ) {
    init_clock();
    init_usart(38400, F_CPU);   //Initialise USART with speed 38400baude
    i2c_init(400000,F_CPU);     //Initilise I^2C with speed 100kHz
    init_io_ports();            //Initialise IO ports
    init_watchdog(WD_RST_IRQ,WDTO_4S);
    wd_reset();
}

...

int main() {    
    init_hardware();
    cli();
    wd_reset();
    ...

}

Compiled and uploaded fine, followed by the light blinking rapidly. Unable to programme or communicate with the device over serial or FTDI->USB (internal )

 

I built an ISCP programmer as per:

http://arduino.cc/en/Hacking/ParallelProgrammer without the 220R

And as per

http://www.allmyit.com.au/programming-avr-parallel-port-ltp where the difference seems to be GND being pin 21 instead of 18.

I powered the Nano with the USB cable

 Using avrdude as:

avrdude -p m328p -P /dev/parport0 -c dapa

get:

avrdude: AVR device not responding
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Strangely, my 'fried' arduino 'worked' with the programmer for a bit, as in could be erased, programmed, have the program downloaded etc... still was a mess on the outputs... stopped doing this this morning whilst trying another parallel port programmer... so I think the hardwawre is good, and am wondering if the continual resets are interrupting the programming.

I tried a loop to see if I could get it to programme if just at the right spot... didnt work 8(
 

until $(avrdude -p m328p -P /dev/parport0 -c dapa -e); do A=b; done

I will try the same again now with usb cable..

 

Anyway, Any ideas??? This is driving me nuts. No more arduinos/AVR's until more come from aliepress in two weeks.

Cheers

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Where are you located? The easiest answer would be to find someone who owns an STK500 and just send them the chip to reset to defaults for you.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Clawson

Sad but probably true 8(

(I am in Christchurch, New Zealand)

 So nothing immediatly obvious that I am doing wrong?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Parallel programmer were the spawn of Beelzebub !

 

Thankfully these days everyone can just buy a $2/$3 USBAsp from ebay and get a totally reliable ISP programmer for virtually nothing so no one has to bother with parallel any more. As they all come from HK/China you are probably better placed than most for a reasonable delivery time for a USBAsp - in Europe it can take anywhere from 7 to 30 days!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you!

 Of course this is the answer. It would be great in its own sticky, but there are already sooooooo many of them .

 

The race from china is on, USBAsp VS new Arduino's. The new arduino's have a head start 8)