Go Down

Topic: Running 1284P at 20MHz (Read 1 time) previous topic - next topic

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

fungus

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

You will need an ISP programmer to make it work.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

bvernham

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

fungus

Do you have a 20MHz bootloader...?
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

bvernham

No...

I am just starting to get into this.

Any idea where to find one.

fungus


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"
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

CrossRoads

Maybe here?
http://www.freetronics.com/products/goldilocks-arduino-compatible-with-atmega1284p-mcu
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

bvernham

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.

CrossRoads

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.
http://www.mouser.com/ProductDetail/Atmel/ATAVRISP2/?qs=%2fha2pyFaduj%2fCCYB7wa5m2l%252bK5%252bQB6S9aoRQO0XTJlI%3d
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

bvernham

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

CrossRoads

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?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

retrolefty


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.

bvernham

Any experiences with the ATAVRDRAGON?

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

bvernham

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.

fungus

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

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Go Up