Pages: [1] 2   Go Down
Author Topic: atMega1284P-AU @ 20Mhz  (Read 2541 times)
0 Members and 1 Guest are viewing this topic.
NZ
Offline Offline
Sr. Member
****
Karma: 0
Posts: 390
Turtle in a hard shell
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Edison Member
*
Karma: 71
Posts: 1640
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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

* optiboot_atmega1284_20.hex (1.38 KB - downloaded 20 times.)
« Last Edit: October 23, 2012, 12:47:42 pm by Tom Carpenter » Logged

~Tom~

NZ
Offline Offline
Sr. Member
****
Karma: 0
Posts: 390
Turtle in a hard shell
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Edison Member
*
Karma: 71
Posts: 1640
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

* optiboot_atmega1284_20_UART0.hex (1.38 KB - downloaded 21 times.)
* pins_arduino.h (6.25 KB - downloaded 25 times.)
« Last Edit: October 23, 2012, 03:12:08 pm by Tom Carpenter » Logged

~Tom~

NZ
Offline Offline
Sr. Member
****
Karma: 0
Posts: 390
Turtle in a hard shell
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Sr. Member
****
Karma: 0
Posts: 390
Turtle in a hard shell
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Edison Member
*
Karma: 71
Posts: 1640
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Sr. Member
****
Karma: 0
Posts: 390
Turtle in a hard shell
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok thats fine, thanks.

Ill give it a try

Cheers
J
Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 11
Posts: 1309
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


 @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 Offline
Edison Member
*
Karma: 71
Posts: 1640
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Edison Member
*
Karma: 11
Posts: 1309
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


 Great to hear!
Logged


NZ
Offline Offline
Sr. Member
****
Karma: 0
Posts: 390
Turtle in a hard shell
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Edison Member
*
Karma: 71
Posts: 1640
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Its my own modified version.
Logged

~Tom~

NZ
Offline Offline
Sr. Member
****
Karma: 0
Posts: 390
Turtle in a hard shell
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Sr. Member
****
Karma: 0
Posts: 390
Turtle in a hard shell
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No luck with serial programming yet.

Constantly get

avrdude: stk500_getsync(): not in sync: resp=0x00
Logged

Pages: [1] 2   Go Up
Jump to: