Go Down

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

WanaGo

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

Tom Carpenter

#1
Oct 23, 2012, 03:16 pm Last Edit: Oct 23, 2012, 07:47 pm by Tom Carpenter 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~

WanaGo

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

Tom Carpenter

#3
Oct 23, 2012, 10:03 pm Last Edit: Oct 23, 2012, 10:12 pm by Tom Carpenter Reason: 1
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.
~Tom~

WanaGo

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

WanaGo

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

Tom Carpenter

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.
~Tom~

WanaGo

Ok thats fine, thanks.

Ill give it a try

Cheers
J

cyclegadget


@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
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

Tom Carpenter

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.
~Tom~

cyclegadget

Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

WanaGo

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

Tom Carpenter

Its my own modified version.
~Tom~

WanaGo

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

WanaGo

No luck with serial programming yet.

Constantly get

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

Go Up