Issues with Atmega1284p - Page 1
Forum section: electronics / general

author: tyguy2
author_rank: Unknown
timestamp: June 14, 2015, 04:13:33 am
content: So I recently decided to try out other micro-controllers besides the Atmega328p. I recently purchased an Atmega1284p, and plugged it up. I usedhttp://www.gammon.com.au/breadboardas a setup guide. Everything was running smoothly, until I tried to upload a program using the serial port. I am using the Arduino IDE and bootloader provided in order to easily upload code to the chip. Oddly enough, when my connections are correct, the program begins to upload, but stops between the 1st and 4th bits. (Screenshots below) Arduino ISP doesn't seem to work either. I remember reading somewhere that Arduino FTDI chips can't address AVR devices with large memory capacity and that I should buy a dedicated USB to Serial chip. Is that correct? Can anyone help out? Screenshots of my connections are also posted below.

author: Bruce Abbott
author_rank: Frequent Contributor
timestamp: June 15, 2015, 01:35:28 am
content: Quote from: tyguy2 on June 14, 2015, 04:13:33 amSo the bootloader went in OK? Which bootloader did you install?I notice that you haven't installed any capacitors. You should have 0.1uF from Vcc to GND close to the chip, and 18-22pf from each crystal pin to GND. Without these caps the Atmega may run erratically.Your first screenshot shows avrdude sending STK_GET_SYNCH, Sync_CRC_EOP (Hex bytes  ) 3 times, receiving the correct response STK_INSYNC, STK_OK ( ). However the third screenshot shows no response from command STK_GET_PARAMETER, STK_HW_VER (  ). This indicates that the 1284p either didn't receive the second command correctly, didn't understand it, or went to sleep since replying to the first command. This could be due to mismatched baud rates (wrong oscillator frequency? incorrect bootloader?) commands not being sent fast enough (causing watchdog time out), noisy power supply or bad wiring.QuotePut the Uno back to stock and check that it still works properly (particularly the pins used for ISP). Then install the recommended capacitors on the 1284p and try reinstalling the bootloader into it. If that doesn't work then either the crystal or the 1284p itself may be faulty.QuoteThe Arduino Uno does not have an FTDI chip. It uses an ATMEGA8U to create the USB to Serial bridge.

author: SL4P
author_rank: Super Contributor
timestamp: June 15, 2015, 02:38:34 am
content: FTDI (FT232) are level converters and don't affect the payload at all.

author: matseng
author_rank: Frequent Contributor
timestamp: June 15, 2015, 02:54:25 am
content: Quote from: SL4P on June 15, 2015, 02:38:34 amNo... FT232 are more Protocol converters than Serial converters. USB and Serial are two completely different protocols - although they also differ slightly in the 0 & 1 bits voltage levels but that is inconsequential here.

author: SL4P
author_rank: Super Contributor
timestamp: June 15, 2015, 07:14:31 am
content: Quote from: matseng on June 15, 2015, 02:54:25 amYes - sorry - I should really have said as far as the PC application is concerned - it is a COM-port 'bridge' ! Levels come into it, but not relevant to the question.

author: tyguy2
author_rank: Unknown
timestamp: June 15, 2015, 03:39:29 pm
content: Thanks for the replies, I'll look around for the right caps and get back to you.

author: mikerj
author_rank: Super Contributor
timestamp: June 15, 2015, 04:06:14 pm
content: Quote from: Bruce Abbott on June 15, 2015, 01:35:28 amThis is important, how did you program the bootloader onto the Atmega1284p?

author: tyguy2
author_rank: Unknown
timestamp: June 15, 2015, 04:23:03 pm
content: Optiboot from the sketch provided by Nick Gammon.

author: Asim
author_rank: Regular Contributor
timestamp: June 15, 2015, 07:40:18 pm
content: I had a similar issue with the 328p, I was able to burn the bootloader . But then i wasn't able to uploade any sketch to the chip. After a lot of searching around it turned out the baud rate was the problem( i was playing with the fuses, changed the 8mhz crystal to 4mhz which caused the problem for me ) after dividing the baud rate by two everything was good

author: retrolefty
author_rank: Super Contributor
timestamp: June 15, 2015, 07:55:53 pm
content: I worked a lot with several users of the 1284P boards on the arduino forum a couple of years ago. Seems the 40 pin DIP version of the 1284P chip can suffer from clock noise as one of the crystal pins in adjacent to the serial port 0 receive pin. This is somewhat sensistive to specific board layout and not all users experianced the problem, but several did. There were two effective 'fixes' to this:Change the LOW fuse byte from 0xff to 0xf7, this enables full clock swing and seems to work well. The second method is to have the bootloader utilize the 2nd serial port instead of the first, but this requires a modified bootloader to implement.

author: tyguy2
author_rank: Unknown
timestamp: June 15, 2015, 07:57:36 pm
content: I'll have to look into it. Does anyone have any reconditions for a similar (and easier to use) Amtel chip, in case this one doesn't work?

author: retrolefty
author_rank: Super Contributor
timestamp: June 15, 2015, 08:08:29 pm
content: Quote from: tyguy2 on June 15, 2015, 07:57:36 pmNot in a DIP package, the 1284P is kind of unique in having 16kB of sram and is why many chose this 'non-standard' arduino chip. If you can change the fuse byte I referred to I'm sure this will fix your symptom as it did work for everyone we were working with that had that same symptom.

author: tyguy2
author_rank: Unknown
timestamp: June 15, 2015, 11:19:55 pm
content: So I accidentally grabbed the wrong cap and put them to the crystal, and I think I may have screwed myself over. None of my crystals work with the chip now, and the bootloader only uploads if I use the 8 mhz output on pin 9. Any ideas? I think I'm just going to order a new chip and try again.