Running 1284P at 20MHz

I have an existing Bobduino that was running at 16Mhz.

I installed at 20 MHz crystal the waveform is about the same as the 16Mhz except at the higher frequency as expected.

I changed the build.f_cpu=20000000L from build.f_cpu=16000000L.

But I still can not communicate between the IDE and the board as before. I keep getting the following error:

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

Do the AVR Fuse setting need changed?

I have other Bobduino that are running at 16Mhz which have no communication issues using the same PC and the same USB cables. I believe this is purely a board set up issue.

Thank You

Bruce Vernham

With FTDI cable? The serial baud rate will be wrong.

You will need an ISP programmer to make it work.

I will need to reprogram once with an ISP or every time?

Do you have a 20MHz bootloader...?

No...

I am just starting to get into this.

Any idea where to find one.

bvernham:
Any idea where to find one.

Without a bootloader you need to use ISP.

I don't know where to get a 20MHz bootloader for a bobuino. Start by googling "1284P 20MHz bootloader"

Maybe here?

Yep, I have that.

The 20 MHz bootloader is stk500boot_v2_goldilocks.hex.

Two questions from this though is:

  1. Can the same fuse settings for the Bobduino work with this bootloader?

  2. How do I program this bootloader into the 1284P?

I have seen AVR compatible ISP tools but I have not seen any compatible with the 1284P.

There is a boards.txt file there, think you can just use that. Set up a goldilocks variant folder, same as the mighty1284 variants folder.
I use Atmel AVR ISP MKii for all my bootloading (328P, 1284P, 2560), no fooling with AVR as ISP. Get a tool and use it.

Bobuino board.txt file:
bobuino.upload.maximum_size=130048
bobuino.upload.speed=115200
bobuino.bootloader.low_fuses=0xff
bobuino.bootloader.high_fuses=0xde
bobuino.bootloader.extended_fuses=0xfd
bobuino.build.mcu=atmega1284p
bobuino.build.f_cpu=16000000L
#bobuino.build.core=arduino:arduino
bobuino.build.core=standard
bobuino.build.variant=bobuino

Goldilock file:
goldilocks_20MHz.upload.protocol=wiring
goldilocks_20MHz.upload.maximum_size=122878
goldilocks_20MHz.upload.speed=38400

goldilocks_20MHz.bootloader.low_fuses=0xd7
goldilocks_20MHz.bootloader.high_fuses=0xd8
goldilocks_20MHz.bootloader.extended_fuses=0xfc
goldilocks_20MHz.bootloader.path=stk500v2
goldilocks_20MHz.bootloader.file=stk500boot_v2_goldilocks.hex

goldilocks_20MHz.build.f_cpu=20000000L
goldilocks_20MHz.build.core=arduino
goldilocks_20MHz.build.variant=goldilocks

I have highlighted some of the obvious differences.
The fuses are different.
The upload speeds are different but I think this is caused by not using the FTDI for the Goldilocks.
This max upload size a larger bootloader.

Obviously the correct PINs file needs to be used.

I am all for experimenting but I do not want to "break" something.

Thanks

Bruce

Review the fuse settings in the datasheet, make sure the JTAG Enable/SPI Disable is not screwed up, that would prevent ICSP uploads.

Worst case, you put the 16 MHz crystal back and reburn it as a Bobuino.

Wonder why they need such a big bootloader?

bvernham:
I have an existing Bobduino that was running at 16Mhz.

I installed at 20 MHz crystal the waveform is about the same as the 16Mhz except at the higher frequency as expected.

I changed the build.f_cpu=20000000L from build.f_cpu=16000000L.

But I still can not communicate between the IDE and the board as before. I keep getting the following error:

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

Do the AVR Fuse setting need changed?

I have other Bobduino that are running at 16Mhz which have no communication issues using the same PC and the same USB cables. I believe this is purely a board set up issue.

Thank You

Bruce Vernham

While changing the clock speed in the board.txt file for 20 mhz does compensate for all the arduino libraries and functions that rely on a specific clock speed, the bootloader is different in that it's baudrate is 'hard-coded' to work at a fixed speed and the arduino IDE is expecting to use the baudrate in the boards.txt parameter (example) bobuino.upload.speed=115200

so your choices are either:

  1. Find a bootloader that is coded to run at 20Mhz
    or
  2. Fiddle with the bobuino.upload.speed=115200 baudrate parameter to try and compensate for the difference between 20 Vs 16 mhz, so maybe around 144,000.

I've never attempted this second method but think it might work.
Fuse changes going from 16 to 20mhz should not be required unless something else changes like the size of the bootloader.

Any experiences with the ATAVRDRAGON?

It show as a programmer and as debugger/emulator for both 8 and 32 bit AVR micros.

Well set the baud rate the 144000 and it seems to program with no errors but then it does nothing.

I tried some of the simple serial out examples but there is no serial output.

It was worth a try.

Turn on "verify code after upload" in your preferences.

retrolefty, can you send me the 20Mhz version of optiboot you have for the 1284P?

You mention this in another post thread and I believe this would solve my problems.

Thank You

Bruce Vernham

Tried code confirmation setting and it failed.

It does not seem that the micro is not communicating with the PC.

bvernham:
retrolefty, can you send me the 20Mhz version of optiboot you have for the 1284P?

You mention this in another post thread and I believe this would solve my problems.

Thank You

Bruce Vernham

Sorry Bruce, having lots of computer problem trying to get my new window 8.1 laptop working. Was making good progress
until windows now won't recognize my admin log in password. Machine goes back tomorrow unless they can fix it.

bvernham:
retrolefty, can you send me the 20Mhz version of optiboot you have for the 1284P?

You mention this in another post thread and I believe this would solve my problems.

Thank You

Bruce Vernham

Bruce;

I've attached the 20mhz 1284p optoboot file, Let me know how it works as I've never used it yet.
Lefty

optiboot-1284P-20MHz.hex (1.41 KB)