NZ
Offline
Sr. Member
Karma: 0
Posts: 376
Turtle in a hard shell
|
 |
« Reply #15 on: October 25, 2012, 05:13:39 am » |
Reloaded bootloader, took another 5 minutes or so (is this normal?) and now I can program over serial, strange. But Yay 
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Offline
Edison Member
Karma: 38
Posts: 1025
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #16 on: October 25, 2012, 06:00:02 am » |
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.
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
NZ
Offline
Sr. Member
Karma: 0
Posts: 376
Turtle in a hard shell
|
 |
« Reply #17 on: October 25, 2012, 07:20:00 am » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Offline
Edison Member
Karma: 38
Posts: 1025
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #18 on: October 25, 2012, 01:25:32 pm » |
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?
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
NZ
Offline
Sr. Member
Karma: 0
Posts: 376
Turtle in a hard shell
|
 |
« Reply #19 on: October 25, 2012, 02:34:40 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Offline
Edison Member
Karma: 38
Posts: 1025
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #20 on: October 25, 2012, 02:37:22 pm » |
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")
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
SF Bay Area (USA)
Online
Faraday Member
Karma: 80
Posts: 5504
Strongly opinionated, but not official!
|
 |
« Reply #21 on: October 26, 2012, 04:07:44 am » |
The bootloader takes a long time to program because it does a verify of the whole 128k of memory...
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Offline
Edison Member
Karma: 38
Posts: 1025
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #22 on: October 26, 2012, 01:59:42 pm » |
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.
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
Offline
Jr. Member
Karma: 1
Posts: 56
|
 |
« Reply #23 on: March 17, 2013, 01:02:07 am » |
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. 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?
|
|
|
|
« Last Edit: March 17, 2013, 01:10:41 am by jbaum81 »
|
Logged
|
|
|
|
|
Leeds, UK
Offline
Edison Member
Karma: 38
Posts: 1025
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #24 on: March 17, 2013, 06:09:40 am » |
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.
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
Rapa Nui
Offline
Edison Member
Karma: 30
Posts: 1171
Pukao hats cleaning services
|
 |
« Reply #25 on: March 17, 2013, 06:54:52 am » |
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..
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Offline
Edison Member
Karma: 38
Posts: 1025
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #26 on: March 17, 2013, 09:51:32 am » |
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
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
|