Pages: [1] 2   Go Down
Author Topic: Running 1284P at 20MHz  (Read 911 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 142
Posts: 5282
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

You will need an ISP programmer to make it work.
Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 142
Posts: 5282
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have a 20MHz bootloader...?
Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No...

I am just starting to get into this.

Any idea where to find one.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 142
Posts: 5282
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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"
Logged

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

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 513
Posts: 26232
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe here?
http://www.freetronics.com/products/goldilocks-arduino-compatible-with-atmega1284p-mcu
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 513
Posts: 26232
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 513
Posts: 26232
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17254
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Any experiences with the ATAVRDRAGON?

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

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 142
Posts: 5282
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

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

Pages: [1] 2   Go Up
Jump to: