Go Down

Topic: atMega1284P-AU @ 20Mhz (Read 3 times) previous topic - next topic

WanaGo

Reloaded bootloader, took another 5 minutes or so (is this normal?) and now I can program over serial, strange. But Yay :)

Tom Carpenter

yeah, it takes quite some time to burn the bootloader. I think there is a mistake in the avrdude.conf file, but i can't be bothered to find it as you only have to burn the bootloader once.
~Tom~

WanaGo

Processor seems to be locking up constantly, not sure what is going on.

Changed to 16Mhz version of "Mighty 1284p 16MHz using Optiboot", but I cant get that to let me upload over the uART0.
Not sure if this is setup for UART0 or UART1.

Programming over ICSP at the moment, and it seems stable.
Not sure whats going on at 20 Mhz

Which is the prefered 16Mhz 1284P bootloader for UART0 ?

Thanks
J

Tom Carpenter

The reason I used UART1 is from what I have read there is some obscure glitches between optiboot and UART0 for the 1284. The UART1 works flawlessly.

In what way is it locking up?
~Tom~

WanaGo

Code stops executing.
Im writing to the serial port, and now and then it just stops dead in its tracks, LED stops blinking (that I have to indicate it being alive) and it just grinds to a halt.

Sadly I cant use UART1 as I have my 4 layer PCB already printed :(

Found an Optiboot version 4.5 using UART0 @ 16Mhz which seems to be working so far, for the few minutes of testing I have done.
Ideally would like a 20Mhz version working though, but such is life.

Thanks
J

Tom Carpenter

If you have the source code for it, it should just be a case of changing the AVR_FREQ entry in the makefile and then recompiling it.

(The line should look something like this: "atmega1284: AVR_FREQ = 20000000L")
~Tom~

westfw

The bootloader takes a long time to program because it does a verify of the whole 128k of memory...

Tom Carpenter


The bootloader takes a long time to program because it does a verify of the whole 128k of memory...


I suppose so, but I seem to recall it taking a lot longer to program the bootloader than when I did an atmega1280. Perhaps that was because I used a different programmer for the '1280.
~Tom~

jbaum81

#23
Mar 17, 2013, 07:02 am Last Edit: Mar 17, 2013, 07:10 am by jbaum81 Reason: 1

I have optiboot for atmega1284p at 20MHz - I needed the extra 4MHz to make an application fast enough. I will upload it this evening.

Edit:
This is my boards.txt entry. Use it as a guide for fuses, etc. The bootloader uses 115200 Baud, using UART1, the TX1 and RX1 pins. The status led is on PD7. If you want UART0 or a different LED pin and I will recompile it for you.
Code: [Select]

cube1284p_20.name=Cube 1284P (PCB, 20MHz)
cube1284p_20.upload.protocol=arduino
cube1284p_20.upload.maximum_size=130560
cube1284p_20.upload.speed=115200
cube1284p_20.bootloader.low_fuses=0xFF
cube1284p_20.bootloader.high_fuses=0xDE
cube1284p_20.bootloader.extended_fuses=0xFD
cube1284p_20.bootloader.path=optiboot
cube1284p_20.bootloader.file=optiboot_atmega1284_20.hex
cube1284p_20.bootloader.unlock_bits=0x3F
cube1284p_20.bootloader.lock_bits=0x0F
cube1284p_20.build.mcu=atmega1284p
cube1284p_20.build.f_cpu=20000000L
cube1284p_20.build.core=arduino
cube1284p_20.build.variant=Cube


@Tom:

Sorry if I'm way off base here but I've been bouncing around the datasheet for the 1284, and it appears the chip @ 20Mhz will be unstable at lower voltages, you have your brownout set to 2.7v in efuse, I would think a value of 0xFC (4.3V) would make more sense for the the efuse? Am I missing something?

My only guess here is maybe out here in arduino land we regularly give our caps a workout and seeing below 4.3v isn't going to be that uncommon? If this is the case what does the chip do when its underpowered for the current speed? just miss a few steps and pick right back up?

Also shouldn't the Low fuse be set for a full swing oscillator? Something like 0xD7 for a 20mhz crystal?

Tom Carpenter

The full swing would be better for noisy environments, but it also consumes more power. I found that the low power crystal oscillator worked fine in my project, though I didn't try it on breadboard, the circuit was built directly onto a PCB. I imagine with a breadboard there will be much more noise and so the full swing setting could be useful.

The brownout probably should be 4.3V, or not on at all, however the powersupply I was using at the time was rather crappy and kept triggering the brownout - the circuit drew large currents at times and the supply couldn't hold its voltage, dropping on occasion to around 4v. The chip still worked fine at 4V, but that is outside the guaranteed working region.
~Tom~

pito

Quote
The chip still worked fine at 4V, but that is outside the guaranteed working region.

The atmega1284p operating voltage range is 1.8-5.5V..

Tom Carpenter


Quote
The chip still worked fine at 4V, but that is outside the guaranteed working region.

The atmega1284p operating voltage range is 1.8-5.5V..

But not at 20MHz.

- 0 - 4 MHz @ 1.8 - 5.5V
- 0 - 10 MHz @ 2.7 - 5.5V
- 0 - 20 MHz @ 4.5 - 5.5V
~Tom~

Go Up