Go Down

Topic: 1284p Bootloader w/Arduino as ISP (Read 1 time) previous topic - next topic

FedorAdarichev

Hello,

I'm trying to upload a bootloader to a 1284p TQFP44 with a standard layout.  I'm using as my guideline this post here: https://forum.arduino.cc/index.php?topic=321805.0.  I'm using Arduino IDE v1.6.3 and Arduino as ISP.  I chose "avr-developers.com pinout 16MHz using Optiboot" for my board selection.

A picture of my hardware setup is attached. I have a green wire soldered to my reset pin because I realized my FTDI header reset port will be going through a 0.1uF capacitor, so I bypassed it by just soldering the wire from the Arduino straight to the reset switch leg (which is directly connected to the reset pin of the 1284p).  Also, I lost one of the 22pF SMT capacitors for the oscillator, so that is why I have a THT one soldered there instead.

A .txt file of my error message in the Arduino IDE is attached.

Alternatively, I also tried this guideline: https://github.com/MCUdude/MightyCore.  I used Arduino IDE v1.6.11 for that version instead.  I was getting the same sync issue.

The 1284p is getting 5V at VCC, and there no signs of any faulty wiring connections.  The Arduino Uno that I am using is uploading other sketches no problem.

Any idea what my issue is?

Thank you,


pert

Did you upload File > Examples > 11.ArduinoISP > ArduinoISP to your Uno?

DrAzzy

#2
Jan 08, 2018, 02:16 am Last Edit: Jan 08, 2018, 02:20 am by DrAzzy
You have not uploaded Arduino as ISP to the arduino being used as a programmer, or you have not disabled reset on the Arduino (the easy way is to put 10uF cap between reset and ground on the programmer.). This sometimes seems to be necessary, and sometimes not; I've been told the behavior here was improved in a somewhat-recent version of the IDE. (I recommend MightyCore with 1.8.5 of the IDE - current release is excellent; the whole 1.8.x series has been solid, unlike 1.6.x which had a lot of bad releases)

I have a green wire soldered to my reset pin because I realized my FTDI header reset port will be going through a 0.1uF capacitor, so I bypassed it by just soldering the wire from the Arduino straight to the reset switch leg (which is directly connected to the reset pin of the 1284p). 
NO! It sounds like you had it wired correctly, and then went out of your way to break it.


There is no reset pin on an FTDI adapter.

The DTR (or RTS) output of the FTDI (or other USB-serial) adapter goes to one side of a 0.1uF cap, and the other side of the cap goes to the reset pin of the AVR. You MUST have the 10k pullup resistor from the reset pin to Vcc.

When the port is opened, DTR goes low and stays low. The cap and pullup form an R-C circuit to convert that high to low edge into a low pulse - which is what we need, because we must bring the reset line low, but then release it (if we don't release it, the chip will be held in reset state and do nothing).

Of course, you're not getting the bootloader uploaded, so you're well before the point that this becomes an issue.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

ron_sutherland

Quote
I lost one of the 22pF SMT capacitors for the oscillator
I have had crystals get thermal shocked when soldering, it is risky to solder near those things. Also, I think the crystal load capacitors both need to have a good temperature coefficient (e.g. an NPO).

https://www.digikey.com/product-detail/en/murata-electronics-north-america/GRM1885C1H220JA01D/490-1411-1-ND/587624
I use an R-Pi Zero on an RPUpi shield to have a tool-chain at the network edge.

FedorAdarichev

@Pert:

Yes, I was using that sketch, but I did not actually upload it.

@ron_sutherland

I was not aware, thanks for the tip.  However, I was able to upload the bootloader (see below), so I am not sure if this indicates that the oscillator is shocked or not?

@DrAzzy:

I was naming my pins incorrectly.  We are on the same page about the DTR pin, which is what I meant when I said "reset" pin.  I have the DTR pin connected through a 0.1uF capacitor to the reset pin on the 1284p, and I have a 10k pull-up resistor from that reset line going to VCC, which I verified is actually giving me 5V to pull-up with using a multimeter.

That being said, I tried your recommendations and I got the bootloader burned! These are the changes I made:

1. Installed Arduino v1.8.6
2. Followed the instructions of this site: http://www.instructables.com/id/Arduino-18x-Clone-With-Atmega-853532644p1284p-the-/
3. Selected the ArduinoISP sketch, and uploaded it successfully with "Arduino Uno" selected under boards.
4. Connected all my wires to the 1284p clone board that I have, with reset still soldered to the leg of the reset switch so its a direct connection.
5. Selected board: "ATmega 1284", variant "p", B.O.D. 2.7V, pinout standard, 16MHz crystal.
6. Selected Programmer "Arduino as ISP (MightyCore)", and hit burn bootloader.

Now, the problem is that I cannot upload my sketches using the FTDI adapter I have.  I have two adapters, and they were both working before on my 328p clone board, so I do not think they are at fault.  I have selected "1284" under boards, and all the same settings that I had when I burned the bootloader.  I'm getting the following error message when I try to upload:

vrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x01

That same "resp=0x01" repeats 10 times.

Any idea what my issue is now?

Thanks,

DrAzzy

How do you have DTR and reset wired now? What's connected to reset? It should only be connected to one side of that cap (the other side of which goes to DTR on FTDI adapter), and the pullup (and optionally one side of a reset button).

If there is a reset line on your FTDI adapter, it should not be connected to the Arduino at all.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

FedorAdarichev

It's wired like this:

DTR-------- 0.1uF cap ------- Reset on 1284P
                                    |
                                    |----Reset Switch (N.O.) ----GND
                                    |
                                10K Resistor
                                    |
                                    |
                                    |
                                 Vcc

The arduino is not not involved in any way anymore, I'm just trying to use the FTDI adapter to upload my sketch to the 1284p clone board.

DrAzzy

ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

FedorAdarichev

When I'm uploading sketches using my FTDI adapter, what do I need to have selected under Programmer? Does it still matter in this case or this selection only relevant when I burn the bootloader?

kprims

"It's wired like this:

DTR-------- 0.1uF cap ------- Reset on 1284P
                                    |
                                    |----Reset Switch (N.O.) ----GND
                                    |
                                10K Resistor
                                    |
                                    |
                                    |
                                 Vcc
"

Any possibility you have a capacitor tied across your reset button? On some minimum system boards I have with the capacitor on the reset I am able to get the FTDI to work by tying a 10uF Cap between the DTR and reset instead of the 0.1uF Cap.


pert

this selection only relevant when I burn the bootloader?
It's only relevant for Tools > Burn Bootloader and Sketch > Upload Using Programmer for standard uploads it makes no difference.

FedorAdarichev

#11
Jan 08, 2018, 11:09 pm Last Edit: Jan 08, 2018, 11:21 pm by FedorAdarichev
I do not have any capacitors tied across my reset switch.  I have tried using a 10uF capacitor instead of the 0.1uF capacitor from DTR to Reset, and its still giving me an error. 

Would a damaged oscillator be the problem, as ron_sutherland was mentioning? Because I was able to upload my bootloader, so I'm assuming at this point that the hardware on my clone board is OK, but is the crystal being used during the bootload burning?

pert

Try connecting your ISP programmer again and doing another Tools > Burn Bootloader as a test. The first time you did it the microcontroller was likely running on the internal clock, as that is the factory default setting.  But when you did the first Burn Bootloader, if you had Tools > Clock set to 16 MHz external oscillator then it changed the fuses to use the external clock source. If your crystal isn't working this will cause the second attempt at Burn Bootloader to fail since the microcontroller now requires an external clock source to run.

FedorAdarichev

I tried again, using the Arduino Uno to burn the bootloader.  The bootloader was successful.  I tried again to upload the sketch using the FTDI adapter, and still getting same error.

ron_sutherland

#14
Jan 09, 2018, 03:38 am Last Edit: Jan 09, 2018, 03:39 am by ron_sutherland
Perhaps if you have an LED on the 1284p board burn a blink sketch with the ISP and see if the LED blinks with the timing you expect. May also want a duplicate blink running on the Uno so you can see if the rate is drifting apart.
I use an R-Pi Zero on an RPUpi shield to have a tool-chain at the network edge.

Go Up