NZ
Offline
Sr. Member
Karma: 0
Posts: 376
Turtle in a hard shell
|
 |
« on: October 22, 2012, 10:59:51 pm » |
Hello, Yes, lots of 1284P chats going on at the moment. I havent yet found a 1284P-AU (SMT Package) bootloader though for 20Mhz. Just wondering if anyone knows of one? CrossRoads suggested the mighty1284 bootloader, https://github.com/maniacbug/mighty-1284p, but I believe this only goes to 16Mhz and if changing it to 20Mhz then millis() and micros() will be off etc. Its been many months since I have played with these things, but rusty. Having to catch up. If anyone knows of anything suitable, can you post a reply. Thanks J
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Offline
God Member
Karma: 35
Posts: 983
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #1 on: October 23, 2012, 08:16:33 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
|
|
|
|
« Last Edit: October 23, 2012, 12:47:42 pm by Tom Carpenter »
|
Logged
|
~Tom~
|
|
|
|
NZ
Offline
Sr. Member
Karma: 0
Posts: 376
Turtle in a hard shell
|
 |
« Reply #2 on: October 23, 2012, 02:44:33 pm » |
Awesome thank you! Can you please recompile it to use UART0? That would be amazing. Much appreciated.
You are using the smt part right? What core are you using?
Thanks J
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Offline
God Member
Karma: 35
Posts: 983
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #3 on: October 23, 2012, 03:03:18 pm » |
Sure, I will do that. I am using the SMD part as well, though both the THT and SMD parts are the same, so it makes no difference. In terms of core, I am using the standard Arduino core, with the pins_arduino file is a modified version of the one found here: https://github.com/stevemarple/Calunium . (I called my variant Cube as it was for an LED cube). EDIT: UART0 version attached - though this has not been tested. Let me know if it works. I have also attached the pins_arduino.h file I am using.
|
|
|
|
« Last Edit: October 23, 2012, 03:12:08 pm by Tom Carpenter »
|
Logged
|
~Tom~
|
|
|
|
NZ
Offline
Sr. Member
Karma: 0
Posts: 376
Turtle in a hard shell
|
 |
« Reply #4 on: October 23, 2012, 03:29:33 pm » |
You are the man, thank you very much.
My PCB will be arriving tomorrow, so I will text it as soon as its built, no doubt the same day it arrives, and let you know.
again, thanks heaps
J
|
|
|
|
|
Logged
|
|
|
|
|
NZ
Offline
Sr. Member
Karma: 0
Posts: 376
Turtle in a hard shell
|
 |
« Reply #5 on: October 23, 2012, 03:43:09 pm » |
Hi again...
Is that pins_arduino.h file correct? It looks to be the TH version with 40 pins... the SMT version has 44 pins.
Thanks J
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Offline
God Member
Karma: 35
Posts: 983
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #6 on: October 23, 2012, 04:21:41 pm » |
The extra four pins are VCC*2 + GND*2. The actual pin map works fine as in the software doesn't care where the physical pins are on the IC, just which bit in which port/ddr/pin register they are. You will have to consult the datasheet to work out where each of the port bits (eg PD2) are in relation to the SMD version pins.
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
NZ
Offline
Sr. Member
Karma: 0
Posts: 376
Turtle in a hard shell
|
 |
« Reply #7 on: October 23, 2012, 04:26:47 pm » |
Ok thats fine, thanks.
Ill give it a try
Cheers J
|
|
|
|
|
Logged
|
|
|
|
|
Greenville, IL
Offline
Edison Member
Karma: 11
Posts: 1289
Warning Novice on board! 0 to 1 chance of errors!
|
 |
« Reply #8 on: October 23, 2012, 06:01:47 pm » |
@Tom Carpenter,
Using 20Mhz, do you have any issues using serial monitor, or any other functions? Did you have to make any code adjustments to work around any issues/
Thanks for sharing your opti-boot! Mark
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Offline
God Member
Karma: 35
Posts: 983
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #9 on: October 23, 2012, 06:10:59 pm » |
Everything works fine without having to do any adjustment. Arduino will quite happily compile for this frequency as long as you set it in the boards.txt file. Also, FCPU = 20000000 is a nice multiple of a 1000000 and of 4, so there are no issues with the delay() and millis() functions.
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
Greenville, IL
Offline
Edison Member
Karma: 11
Posts: 1289
Warning Novice on board! 0 to 1 chance of errors!
|
 |
« Reply #10 on: October 23, 2012, 06:12:24 pm » |
Great to hear!
|
|
|
|
|
Logged
|
|
|
|
|
NZ
Offline
Sr. Member
Karma: 0
Posts: 376
Turtle in a hard shell
|
 |
« Reply #11 on: October 24, 2012, 04:00:58 am » |
Out of interests sake, what version of Optiboot is this bootloader?
Just been reading the "ATmega1284P: End to End using 1.0 IDE " thread.
Cheers J
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Offline
God Member
Karma: 35
Posts: 983
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #12 on: October 24, 2012, 05:03:59 am » |
Its my own modified version.
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
NZ
Offline
Sr. Member
Karma: 0
Posts: 376
Turtle in a hard shell
|
 |
« Reply #13 on: October 25, 2012, 03:34:38 am » |
Burnt the bootloader, but got this error:
avrdude: verification error, first mismatch at byte 0x10000 0xff != 0x04 avrdude: verification error; content mismatch
I have had it before, so I tried the blink sketch modified to D10 for my board, and it seems to work. Was running off internal oscillator /8 at initial power up, so the blink was incredibly slow, but after the bootloader it is 1s on 1s off, so that appears to have worked.
Using Sparkfun AVR Pocket Programmer for ICSP programming, USBtinyISP selection in the IDE.
Bootloader took a good few minutes to burn... seemed longer than usual. 1Mhz internal clock probably didnt help...
Cheers J
|
|
|
|
|
Logged
|
|
|
|
|
NZ
Offline
Sr. Member
Karma: 0
Posts: 376
Turtle in a hard shell
|
 |
« Reply #14 on: October 25, 2012, 04:19:59 am » |
No luck with serial programming yet.
Constantly get
avrdude: stk500_getsync(): not in sync: resp=0x00
|
|
|
|
|
Logged
|
|
|
|
|
|