Pages: [1]   Go Down
Author Topic: ATMega 1284 & Optiboot (Board Programmer)  (Read 1655 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I picked up a couple of ATMega 1284 instead of the 1284P versions. When I run the Board Programmer sketch to install the Optiboot bootloader, it does not recognize the signature. I get the following message on serial:

"Atmega chip programmer.
Written by Nick Gammon.
Entered programming mode OK.
Signature = 0x1E 0x97 0x06
Unrecogized signature.
LFuse = 0x62
HFuse = 0x99
EFuse = 0xFF
Lock byte = 0xFF
Clock calibration = 0x4D
Type 'C' when ready to continue with another chip ..."

I noticed the 0x1E 0x97 0x06 are different than the 0x1E 0x97 0x05 signature bytes in the example. I'm wondering how to change the sig bytes so the bootloader installs?

You're help is much appreciated!!

Thanks
Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 159
Posts: 2916
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah, I did the same thing. Got 1284s. I used ArduinoISP running from a -UNO to burn my
bootloaders, but I imagine the following change will work for a regular programmer:

Just find the avrdude.conf file, and change the sig to 0x05 in the file, and the bootloader
should burn ok.

If you're using the Arduino IDE on WinXXX, avrdude.conf should be in your IDE directory in
subdirectory ..\hardware\tools\avr\etc.

However, after burning the bootloader, then change the sig BACK to 0x06 and leave it there
"forever", when you want to upload sketches to the chip. At least this is what I found to do
via T&E for the Arduino IDE.

BTW, which specific bootloader file are you burning? Maniacbug, avr developers, Bobuino, etc?



Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you could just modify the difference in Nick's board_programmer sketch to work with the 1284 non P version. Just try changing the 0x05 to a 0x06 in the section of the sketch shown here in the second line:

Code:
// ATmega1284P family
  { { 0x1E, 0x97, 0x05 }, "ATmega1284P", 128 * kb,   1 * kb,
        optiboot_atmega1284p_hex,
        0x1FC00,      // start address
        sizeof optiboot_atmega1284p_hex,      
        256,          // page size (for committing)
        0xFF,         // fuse low byte: external clock, max start-up time
        0xDE,         // fuse high byte: SPI enable, boot into bootloader, 1024 byte bootloader
        0xFD,         // fuse extended byte: brown-out detection at 2.7V
        0x2F },       // lock bits: SPM is not allowed to write to the Boot Loader section.
  

Nick's sketch is really great, programs the bootloader code in about 2 seconds where the arduinoISP sketch takes quite a while to perform the same task.

Lefty
« Last Edit: January 24, 2013, 12:32:15 am by retrolefty » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you both for your reply! I ended up following your lead retrofly and it worked!

....now onto loading a sketch
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

im using an FTDI cable to upload sketches and anything ive tried at 25kb or larger i get the following error:


avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x62
avrdude: stk500_cmd(): programmer is out of sync

im going to try the rc filter suggested in the other thread sometime in the next day or so

Thanks
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

im using an FTDI cable to upload sketches and anything ive tried at 25kb or larger i get the following error:


avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x62
avrdude: stk500_cmd(): programmer is out of sync

im going to try the rc filter suggested in the other thread sometime in the next day or so

Thanks

Let us know how it works out for you.

Lefty
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ugh....so ive tried just about all the tricks ive read about....ive tried different board types, different programming methods....even going to the RXD1 & TXD1 pins to see if those would work...nada

to recap:
bootloaded the 1284 using the Atmega Board Programmer sketch and my Uno Rev 3...had to change one of the sig bytes but got it to give me a successful bootload

i used the USB FTDI TTL-232R 3.3V cable i picked up from adafruit that i use to upload sketches to my boardinos with and connected via male header in breadboard to these pins:


Pin 1 (GND)     Gnd (blue)
Pin 2 (CTS)     not connected
Pin 3 (Vcc)     +5V (red)
Pin 4 (TxD      Pin 14 (RxD0) (white)
Pin 5 (RxD)     Pin 15 (TxD0) (orange)
Pin 6 (RTS)     To Reset via 0.1 uF capacitor (green)

i then installed the maniacbug-mighty-1284p download and selected the "Mighty 1284p 16MHz using Optiboot) board in the tools menu

this allows me to upload sketches up to around 20-25kb and then i get the following error messages:

avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x62
avrdude: stk500_cmd(): programmer is out of sync

ive since tried:

including LEDs on the RXD0 & TXD0 pins...nada
swapping to the XD1 pins...nada
selecting other boards in the tools menu....nada
installing a 10k ohm and .1 uF cap as a low pass filter on the RXD0 pin (cap from pin to ground, resistor in series to cable)
looking up the devcode for stk500 in the avrdude config file...its the same for all the similar ATMega chips
taking my 328p chip from my Uno, selecting the Arduino as ISP in the programmer menu under tools and then upload using programmer in the file menu

im clearly a noob at all this...but i thought i would be able to get this thing singing and can only make it grunt

the reason i went to the 1284 chip was more sketch space...my bad that i didnt pick up the 1284p chip but from what ive been learning, this isn't the real issue....its an atmega 1284(p) DIP issue...which bites

is there a solution that does exist? keep in mind, im not that talented, im very busy, and extremely lazy

any and all insight is welcomed!!!

THANKS!!

ps....i think the 64kb would be ok for my current projects...i just thought id be a little greedy with the 1284kb seeing how the chip cost is pretty close....should i just go with the 644p? are there known issues there too? i just need some space...

double PS...im using a 16 MHz crystal (digikey P/N X433-ND) if that means anything to the "out of sync" portion to the error code

Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 159
Posts: 2916
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Not sure this will fix things, but I see 2 very definite problems here,

"10k ohm and .1 uF cap as a low pass filter on the RXD0 pin" - s/b 100 pF cap, yours is
lightyears too large a value.

"(digikey P/N X433-ND) " - this is a "series" crystal, you must use a parallel crystal, which
calls for approx 20 pF caps.

[following is supposed to be low profile]
http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?freeText=325139&langId=-1&storeId=10001&productId=325139

http://www.digikey.com/product-detail/en/ECS-160-20-4X/X1103-ND/827594


Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i will certainly try this....the new caps and crystals are on the next digikey order, thanks!

also on the list:

ceramic oscillator(s)...ive read things about these vs the crystals that may be worth the $2 to put a few in the box and investigate

ATMEGA644P-20PU-ND....what the heck, the $8 is worth my curiosity...would i use the same X1103-ND crystal for the 644P as well?

btw, why do both cut sheets of the two crystals you linked list a "series resistance" value? is this just a common spec to include, even for "parallel" crystals?

thanks!!

Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 159
Posts: 2916
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There is some info here about the different crystals, series-cut will operate at a slightly
different frequency than parallel-cut. Parallel-cut is what is always specified by uC
manufacturers.

http://www.foxonline.com/techfaqs.htm

You normally do not need a resistor in series or parallel with the crystal. I think some older
crystals needed series-R to prevent damage from over driving by the oscillator.

Some people use ceramic resonators all the time, but they have a 0.5% frequency tolerance,
while crystal tolerance is 20-50 PPM, which is 0.002-0.005%. So, crystals give better timing
accuracy.
Logged

Pages: [1]   Go Up
Jump to: