Author Topic: Littlewire AVR programmer issue  (Read 1425 times)

DrPinball

  • Newbie
  • *
  • Posts: 2
Littlewire AVR programmer issue
« on: September 29, 2017, 04:34:10 am »
Hi

I've just started using Digispark and thought I'd try using it to program an atmega328p that is in my Arduino Uno board.

I uploaded a blink sketch to the atmega in the uno and saw the led flash. I then took the chip from the uno and plugged into a breadboard with a 20MHz crystal and led and saw that the sketch still worked.

I then connected the digispark to the atmega328p as follows:
P0 to pin 17 MOSI
P1 to pin 18 MISO
P2 to pin 19 SCK
P3 not connected
P4 not connected
P5 to pin 1 RESET

I set up the Arduino IDE to use USBTinyISP. When I try to upload the blink sketch again I get rc=-1 - i.e. communication between PC and Digispark is fine, but digispark to atmega is not working.

I can see in Device Manager on the PC that I have the libusb device USBTinySPI, so I think the comms to the digisparl/little wire is fine.

I connected my logic analyzer to all pins on the digipspark and can see the SPI data and the USB data, but the reset line remains high in all cases. I am wondering if I've misunderstood something about the reset line.

I looked at the code for little wire and can see the following comment:
// to reduce pin count so that this can fit in a 8 pin tiny
// . no power nor ground pins to target, they are to be connected always
// . no reset control pin to target, target reset always grounded
//   * this had caused problem and there are two solutions
//     1. provide a toggle switch to off-on-off target reset to ground
//     2. introduce reset control and use reset pin as io

Does this mean the reset pin is not controlled as part of the programming?

Any help gratefully received.

David.

DrPinball

  • Newbie
  • *
  • Posts: 2
Re: Littlewire AVR programmer issue
« Reply #1 on: September 29, 2017, 05:57:56 am »
Oops, no problem. Mine was a clone with the RESET pin still set. Updated the fuses and now it works fine.