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, GitHub - maniacbug/mighty-1284p: Mighty 1284P Platform for Arduino, 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.
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.
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: GitHub - stevemarple/Calunium: Arduino clone based on the ATmega644P/ATmega1284P . (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.
The extra four pins are VCC2 + GND2. 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.
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.
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...
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.
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 ?
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.