Author Topic: Issues with Atmega1284p  (Read 4800 times)

0 Members and 1 Guest are viewing this topic.

Offline tyguy2Topic starter

  • Supporter
  • ****
  • Posts: 303
  • Country: us
Issues with Atmega1284p
« on: June 14, 2015, 04:13:33 am »
So I recently decided to try out other micro-controllers besides the Atmega328p. I recently purchased an Atmega1284p, and plugged it up. I used http://www.gammon.com.au/breadboard as 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.
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 

Offline Bruce Abbott

  • Frequent Contributor
  • **
  • Posts: 627
  • Country: nz
    • Bruce Abbott's R/C Models and Electronics
Re: Issues with Atmega1284p
« Reply #1 on: June 15, 2015, 01:35:28 am »
Everything was running smoothly, until I tried to upload a program using the serial port.
So 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 [30] [20]) 3 times, receiving the correct response STK_INSYNC, STK_OK ([14] [10]). However the third screenshot shows no response from command STK_GET_PARAMETER, STK_HW_VER ([41] [80] [20]). 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. 

Quote
Arduino ISP doesn't seem to work either.
Put 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.

Quote
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.
The Arduino Uno does not have an FTDI chip. It uses an ATMEGA8U to create the USB to Serial bridge.

 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: Issues with Atmega1284p
« Reply #2 on: June 15, 2015, 02:38:34 am »
FTDI (FT232) are level converters and don't affect the payload at all.
Don't ask a question if you aren't willing to listen to the answer.
 

Offline matseng

  • Frequent Contributor
  • **
  • Posts: 563
  • Country: se
    • My Github
Re: Issues with Atmega1284p
« Reply #3 on: June 15, 2015, 02:54:25 am »
FTDI (FT232) are level converters and don't affect the payload at all.
No... 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.
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: Issues with Atmega1284p
« Reply #4 on: June 15, 2015, 07:14:31 am »
FTDI (FT232) are level converters and don't affect the payload at all.
No... 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.
Yes - 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.
Don't ask a question if you aren't willing to listen to the answer.
 

Offline tyguy2Topic starter

  • Supporter
  • ****
  • Posts: 303
  • Country: us
Re: Issues with Atmega1284p
« Reply #5 on: June 15, 2015, 03:39:29 pm »
Thanks for the replies, I'll look around for the right caps and get back to you.
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: Issues with Atmega1284p
« Reply #6 on: June 15, 2015, 04:06:14 pm »
Everything was running smoothly, until I tried to upload a program using the serial port.
So the bootloader went in OK? Which bootloader did you install?

This is important, how did you program the bootloader onto the Atmega1284p?
 

Offline tyguy2Topic starter

  • Supporter
  • ****
  • Posts: 303
  • Country: us
Re: Issues with Atmega1284p
« Reply #7 on: June 15, 2015, 04:23:03 pm »
Optiboot from the sketch provided by Nick Gammon.
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 

Offline Asim

  • Regular Contributor
  • *
  • Posts: 171
Re: Issues with Atmega1284p
« Reply #8 on: June 15, 2015, 07:40:18 pm »
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
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: Issues with Atmega1284p
« Reply #9 on: June 15, 2015, 07:55:53 pm »
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.

 

Offline tyguy2Topic starter

  • Supporter
  • ****
  • Posts: 303
  • Country: us
Re: Issues with Atmega1284p
« Reply #10 on: June 15, 2015, 07:57:36 pm »
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?
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: Issues with Atmega1284p
« Reply #11 on: June 15, 2015, 08:08:29 pm »
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?

 Not 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.

 

Offline tyguy2Topic starter

  • Supporter
  • ****
  • Posts: 303
  • Country: us
Re: Issues with Atmega1284p
« Reply #12 on: June 15, 2015, 11:19:55 pm »
 |O 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.  :-- :--
[Sarcastic comment] clever joke [/sarcastic comment]
Bitcoin:
12oV4dWZCAia7vXBzQzBF9wAt1U3JWZkpk
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf