Uploading troubles to 1284p

To read the fuses, if you have another board handy, you should be able to use this:

http://arduino.cc/forum/index.php/topic,105089.0.html

Just connect it up as advised in the linked-to page.

@nick
Thanx. Tried it out... :slight_smile: This is what I got.

Atmega fuse calculator.
Written by Nick Gammon.
Entered programming mode OK.
Signature = 0x1E 0x97 0x05 
Processor = ATmega1284P
Flash memory size = 262144
LFuse = 0xFF 
HFuse = 0xDE 
EFuse = 0xFD 
Lock byte = 0xCF 
OCD Enable.............................. [ ]
JTAG Enable............................. [ ]
Enable Serial (ICSP) Programming........ [X]
Watchdog Timer Always On................ [ ]
Preserve EEPROM through chip erase...... [ ]
Boot into bootloader.................... [X]
Divide clock by 8....................... [ ]
Clock output............................ [ ]
Bootloader size: 1024 bytes.
Start-up time: SUT0: [X]  SUT1: [X] (see datasheet)
Clock source: low-power crystal.
Brownout detection at: 2.7V.

Any ideas on what I should do now?

Hi I more doubt if is it possible to upload to Atmega1284p via a Duminalove using 6pin cable ISP? If thats possible I think i can adjust with that...
OR if I buy a AVR ISP programmer will I be able to upload program written in Arduino (I mean the hex file) to the device.

Yes to both.
The chip does not care what is driving the Reset & SPI lines (SCK, MISO, MOSI).
Depending on the AVR ISP, power may or may not be supplied to the Vcc pin of the ICSP header.

For instance, this one does supply power
http://www.mdfly.com/index.php?main_page=product_info&cPath=5&products_id=415
but is a little slower programming as the IDE seems to write the whole 128K of memory.

This one does not, it reads the Vcc pin to know what levels to control the IO pins at, so Vcc must be supplied elsewhere to the board/chip.

but it does have a nice software interface if you use AVR Studio (I have 5.1) for doing things. Also lets you select the bootload speed (needs to be slower for initial bootload programming, I used 125K).
I did 50 '1284 boards recently - powered the board via the USB interface, then programmed the Fuses, lockbits, and downloaded the bootloader. Went real quick because it only loaded the bootloader, and not all 128K of memory.

@Crossroads
Thanx for the reply... :slight_smile: If possible can someone explain the steps involved for uploading programs(Not bootloaders) to Atmega1284p board via a Duminalove using 6pin cable ISP without any extra programmer. From my knowledge, it doesnt require a bootloader for this right? If I had already burnt the bootloader in a chip will this work?

@Crossroads
Can you please take a look at the fuse settings of my Atmega1284p and see if anything is of a problem? Because I cant seem to upload it to it consistently... :frowning:

Part 1 - I don't know, I just used an inexpensive tool, then programmed using the "File:Upload using Programmer" menu choice in IDE 1.0 with this programmer
http://www.mdfly.com/index.php?main_page=product_info&cPath=5&products_id=415
You are left with no bootloader after that (if you had one, it will be gone), but your sketch starts immediately.

Part 2 - how are you programming? The times I've had issues programming, it has always turned out to be a mismatch between the data rate the bootloader is using and the data rate the IDE is using. Did this to myself recently. Bootloaded with Optiloader, then attempted to download with Duemilanove selected as board type. Nick Gammon solved it for me - changed board type to Uno, now the bootload speed matched the boards.txt upload speed, and I could load programs.

You might also try putting a diode across the reset pullup resistor, reverse biased (cathode to +5, anode to the reset pin).

I'll check the fuse settings that my '1284 demo board uses with maniacbug's 1284 cores and the Bobuino board type.

Thanx for a fast reply... :smiley:

Insert Quote
Part 1 - I don't know, I just used an inexpensive tool, then programmed using the "File:Upload using Programmer" menu choice in IDE 1.0 with this programmer
http://www.mdfly.com/index.php?main_page=product_info&cPath=5&products_id=415
You are left with no bootloader after that (if you had one, it will be gone), but your sketch starts immediately.

Hmmm.. So its not possible without an external programmer? :frowning: Can someone else confirm if this possible without an ext Programmer.

Part 2 - how are you programming? The times I've had issues programming, it has always turned out to be a mismatch between the data rate the bootloader is using and the data rate the IDE is using. Did this to myself recently. Bootloaded with Optiloader, then attempted to download with Duemilanove selected as board type. Nick Gammon solved it for me - changed board type to Uno, now the bootload speed matched the boards.txt upload speed, and I could load programs.

How can I check this? I mean how to know the date rate of the IDE and of the board?
from boards.txt I got

mighty_opt.upload.speed=115200

for the bootloader I use. Whats the IDE data rate?

You might also try putting a diode across the reset pullup resistor, reverse biased (cathode to +5, anode to the reset pin).

Thats already there in the board... Not much change with or without it. (Anyways what does that diode do?)

Programming sketches via ICSP is possible, I've just never done it without a bootload programmer.
For example,

http://arduino.cc/forum/index.php/topic,68183.0.html see the vidoe in the thread

could likely be used, if it was modified to know where to get the file from.

"Whats the IDE data rate?" 115,200 from boards.txt.
What you need to know is the data rate the bootload code is using.

Re: diode:
From AVR042, see first & last paragraph:

  1. To enter programming mode (for some parts also the PEN line is used to enter
    programming mode). Furthermore it is possible to enter high-voltage/parallel
    programming mode by drawing the RESET pin “very” high, where very high means
    11.5 – 12.5V (refer to the datasheet of the device for more information).

The reset line has an internal pull-up resistor, but if the environment is noisy it can be
insufficient and reset can therefore occur sporadically. Refer to datasheet for value of
pull-up resistor on specific devices.

Connecting the RESET so that it is possible to enter both high-voltage programming
and ordinary low level reset can be achieved by applying a pull-up resistor to the
RESET line. This pull-up resistor makes sure that reset does not go low unintended.
The pull-up resistor can in theory be of any size, but if the Atmel®AVR® should be
programmed from e.g. STK500/AVRISP the pull-up should not be so strong that the
programmer cannot activate RESET by draw the RESET line low. The recommended
pull-up resistor is 4.7k? or larger when using STK500 for programming. For
debugWIRE to function properly, the pull-up must not be smaller than 10k?.

To protect the RESET line further from noise, it is an advantage to connect a
capacitor from the RESET pin to ground. This is not directly required since the AVR
internally have a low-pass filter to eliminate spikes and noise that could cause reset.
Applying an extra capacitor is thus an additional protection. However, note that this
capacitor cannot be present if debugWIRE or PDI is used.

If not using High Voltage Programming it is recommended to add an ESD protecting
diode from RESET to Vcc, since this is not internally provided due to High Voltage
Programming. Alternatively, or in addition, a zener diode can be used to limit the
RESET voltage relative to GND. The zener diode is highly recommended in noisy
environments. The components should be located physically close to the RESET pin
of the AVR. Figure 3-1 shows the recommended circuit on the RESET line.

000:
@nick
Thanx. Tried it out... :slight_smile: This is what I got.

...

Any ideas on what I should do now?

That looks OK. At least the chip looks good, and the fuses look reasonable. You might want to try this next:

That will read in the bootloader, display it, and take a sumcheck. We can at least work out which bootloader you have.

Hmmm.. So its not possible without an external programmer? Can someone else confirm if this possible without an ext Programmer.

With a bootloader it should be possible to upload sketches.

@CrossRoads

Programming sketches via ICSP is possible, I've just never done it without a bootload programmer.
For example,

GitHub - WestfW/OptiLoader: Arduino sketch for burning new bootloaders
http://arduino.cc/forum/index.php/topic,68183.0.html see the vidoe in the thread

could likely be used, if it was modified to know where to get the file from.

Doesnt that video show how to bootload a Atmega chip with an Arduino? I can do that(I bootload this way only :slight_smile: ) but What I wanted to know was with the SAME setup used in the video can I upload programs as such Blink or anything else to an arduino? If so what all changes should I make?

"Whats the IDE data rate?" 115,200 from boards.txt.

So for me IDE data rate is 115200(As its written in my boards.txt)? Earlier you mentioned something like mismatch of speeds. What is the other comparing term I should check with?

What you need to know is the data rate the bootload code is using.

Any way to find this out?

@nick Thanx for that calculator :slight_smile:
This is what I got. I am using Maniacbug's optiloader.

Atmega chip detector.
Entered programming mode OK.
Signature = 1E 97 05 
Processor = ATmega1284P
Flash memory size = 262144
LFuse = FF 
HFuse = DE 
EFuse = FD 
Lock byte = CF 
Bootloader in use: Yes
EEPROM preserved through erase: No
Watchdog timer always on: No
Bootloader is 1024 bytes starting at 3FC00

Bootloader:

3FC00: 0F 92 CD B7 DE B7 11 24 84 B7 14 BE 81 FF F1 D0 
3FC10: 85 E0 80 93 81 00 82 E0 80 93 C0 00 88 E1 80 93 
3FC20: C1 00 86 E0 80 93 C2 00 80 E1 80 93 C4 00 8E E0 
3FC30: CA D0 20 9A 26 E0 80 E3 9C EF 31 E0 90 93 85 00 
3FC40: 80 93 84 00 36 BB B0 9B FE CF 18 9A A8 95 21 50 
3FC50: A9 F7 00 E0 10 E0 EE 24 E3 94 E1 E1 DE 2E F3 E0 
3FC60: FF 2E A5 D0 81 34 71 F4 A2 D0 89 83 B2 D0 89 81 
3FC70: 82 38 09 F4 8B C0 81 38 11 F4 84 E0 01 C0 83 E0 
3FC80: 8F D0 8B C0 82 34 11 F4 84 E1 03 C0 85 34 19 F4 
3FC90: 85 E0 A7 D0 82 C0 85 35 91 F4 89 D0 A8 2E BB 24 
3FCA0: 86 D0 08 2F 10 E0 10 2F 00 27 0A 29 1B 29 81 2F 
3FCB0: 88 1F 88 27 88 1F 8B BF 00 0F 11 1F 6D C0 86 35 
3FCC0: 21 F4 84 E0 8E D0 80 E0 DB CF 84 36 09 F0 40 C0 
3FCD0: 6E D0 6D D0 C8 2E 6B D0 80 EE 00 30 18 07 18 F4 
3FCE0: F8 01 F7 BE E8 95 A1 2C 51 E0 B5 2E 60 D0 F5 01 
3FCF0: 81 93 5F 01 CE 16 D1 F7 F0 EE 00 30 1F 07 18 F0 
3FD00: F8 01 F7 BE E8 95 65 D0 07 B6 00 FC FD CF F8 01 
3FD10: A0 E0 B1 E0 2C 91 30 E0 11 96 8C 91 11 97 90 E0 
3FD20: 98 2F 88 27 82 2B 93 2B 12 96 0C 01 E7 BE E8 95 
3FD30: 11 24 32 96 82 E0 A0 30 B8 07 61 F7 85 E0 F8 01 
3FD40: 87 BF E8 95 07 B6 00 FC FD CF D7 BE E8 95 25 C0 
3FD50: 84 37 A9 F4 2C D0 2B D0 B8 2E 29 D0 3A D0 CB 2C 
3FD60: 48 01 F4 01 86 91 1C D0 08 94 81 1C 91 1C CA 94 
3FD70: C1 F7 0F 5F 1F 4F BA 94 0B 0D 11 1D 0E C0 85 37 
3FD80: 39 F4 27 D0 8E E1 0C D0 87 E9 0A D0 85 E0 78 CF 
3FD90: 81 35 11 F4 88 E0 17 D0 1C D0 80 E1 01 D0 61 CF 
3FDA0: 90 91 C0 00 95 FF FC CF 80 93 C6 00 08 95 80 91 
3FDB0: C0 00 87 FF FC CF 80 91 C0 00 84 FD 01 C0 A8 95 
3FDC0: 80 91 C6 00 08 95 E0 E6 F0 E0 98 E1 90 83 80 83 
3FDD0: 08 95 ED DF 80 32 19 F0 88 E0 F5 DF FF CF 84 E1 
3FDE0: DF CF CF 93 C8 2F E3 DF C1 50 E9 F7 F2 DF CF 91 
3FDF0: 08 95 80 E0 E8 DF EE 27 FF 27 09 94 FF FF FF FF 
3FE00: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FE10: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FE20: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FE30: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FE40: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FE50: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FE60: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FE70: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FE80: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FE90: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FEA0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FEB0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FEC0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FED0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FEE0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FEF0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FF00: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FF10: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FF20: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FF30: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FF40: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FF50: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FF60: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FF70: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FF80: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FF90: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FFA0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FFB0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FFC0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FFD0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FFE0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
3FFF0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 

MD5 sum of bootloader = 71 DD C2 84 64 C4 73 27 D2 33 01 1E FA E1 24 4B 

First 256 bytes of program memory:

0: 0C 94 87 00 0C 94 B2 00 0C 94 B2 00 0C 94 B2 00 
10: 0C 94 B2 00 0C 94 B2 00 0C 94 B2 00 0C 94 B2 00 
20: 0C 94 B2 00 0C 94 B2 00 0C 94 B2 00 0C 94 B2 00 
30: 0C 94 B2 00 0C 94 B2 00 0C 94 B2 00 0C 94 B2 00 
40: 0C 94 B2 00 0C 94 B2 00 0C 94 7B 12 0C 94 B2 00 
50: 0C 94 66 14 0C 94 FC 14 0C 94 B2 00 0C 94 B2 00 
60: 0C 94 B2 00 0C 94 B2 00 0C 94 B2 00 0C 94 B2 00 
70: 0C 94 9F 14 0C 94 49 15 0C 94 B2 00 0C 94 B2 00 
80: 0C 94 B2 00 0C 94 B2 00 0C 94 B2 00 00 00 21 00 
90: 24 00 27 00 2A 00 00 00 22 00 25 00 28 00 2B 00 
A0: 00 00 20 00 23 00 26 00 29 00 02 02 02 02 02 02 
B0: 02 02 04 04 04 04 04 04 04 04 03 03 03 03 03 03 
C0: 03 03 01 01 01 01 01 01 01 01 01 02 04 08 10 20 
D0: 40 80 01 02 04 08 10 20 40 80 01 02 04 08 10 20 
E0: 40 80 01 02 04 08 10 20 40 80 00 00 00 01 02 00 
F0: 08 09 00 00 00 00 04 03 07 06 00 00 00 00 00 00

Thanx Crossroads for clearing up the Reset pin doubt. :slight_smile:

What file, exactly, did you upload as your bootloader?

@nick
I followed the steps here.. Arduino on ATmega1284P | maniacbug
and followed the ArduinoISP tutorial and burnt that in arduino dumilanove and connected SCK,MOSI,MISO,RESET pins and gave burn bootloader option in IDE with "Mighty 1284p 16Mhz using optiboot" selected as board. I dont know which file exactly though...

I can see why people are enthusiastic about this chip. I've ordered one, and if all goes well, which I doubt, it will arrive before the weekend.

Then I'll try it for myself.

I'll keep you posted. :slight_smile:

I can see why people are enthusiastic about this chip. I've ordered one, and if all goes well, which I doubt, it will arrive before the weekend.

If possible one those long tutorials for 1284p versions too... :wink:

It really does have fantastic potential. I don't understand why Arduino proper hasn't picked it up for an official board. I see it as more applicable than the Mega in many cases, and certainly easier to use in DIP format. For all you get (RAM, raw I/O, various dedicated hardware serial I/O, flash space), it's dirt cheap, too.

It really does have fantastic potential. I don't understand why Arduino proper hasn't picked it up for an official board. I see it as more applicable than the Mega in many cases, and certainly easier to use in DIP format. For all you get (RAM, raw I/O, various dedicated hardware serial I/O, flash space), it's dirt cheap, too.

+1 for that... :smiley: RAM + no. of I/O is what attracted me to it... still now couldnt get it to make it work smoothly though... :frowning:

I've been saying for ages that the 1284 is a natural for an Arduino and of course a few people are using them (or the 644). I've got a design on the drawing board at present that uses one.


Rob

Yes indeed, the 1284 makes a fine board!


(PL shows MIKROE589, list has been updated for the correct MIKROE483 with FT232 chip, waiting on ISP to refresh the website)
http://www.crossroadsfencing.com/BobuinoRev17/

some new pics being added too ...

"@crossroads which bootloader are u currently using?"

This one, which I think is what sets up with the maniacbug cores.

optiboot_atmega1284p.hex (1.47 KB)

Thanx :slight_smile:
Tried it out... Still getting not in sync errors... :frowning: