Switching to 8Mhz internal oscillator [solution]

Started by davegravy, April 27, 2016, 02:13:26 PM

ssmall

Tom, it all makes sense.  When I have time in the next few days I will try it out.  Thanks for helping out a n00b. ;D

ssmall

#16
Tom, I hooked up my voltmeter to the 5V pin and ground on the programmer.  When the switch is in the No Power position I read 3.87 volts.  When I move the switch to Power Target I get the expected 5v.  Does that sound correct?  I'm trying to go slow here and not fry anything.

Never mind. I did a few more tests and I was able to hook up the programmer to the Moteino and I was able to read the fuses:

lfuse:DE
hfuse:DC
effuse:05

Looks like avrdude reverses the hfuse and efuse when it prints them out after exit.

Are these the proper fuse settings to switch to the internal oscillator:
l:d2
h:dc
e:fd

TomWS

Quote from: ssmall on May 17, 2016, 08:19:34 PM
Tom, I hooked up my voltmeter to the 5V pin and ground on the programmer.  When the switch is in the No Power position I read 3.87 volts.  When I move the switch to Power Target I get the expected 5v.  Does that sound correct?  I'm trying to go slow here and not fry anything.

Never mind. I did a few more tests and I was able to hook up the programmer to the Moteino and I was able to read the fuses:

lfuse:DE
hfuse:DC
effuse:05

Looks like avrdude reverses the hfuse and efuse when it prints them out after exit.
Yes, good conclusion.  This took me by surprise the first time I saw it as well. 
Quote

Are these the proper fuse settings to switch to the internal oscillator:
l:d2
h:dc
e:fd
Use the AVR Fuse calculator to determine your correct fuse settings: http://www.engbedded.com/fusecalc/

Tom

ssmall

Tom, I took a look at the AVR Fuse calculator and was immediately overwhelmed after I selected ATmega328P. :o

I saw at the bottom of the page there are the fuse settings.  I was able to type in the current Moteino fuse settings: L:DE, H:DC, E:05. After hitting "Apply Values" I went to Features and chose the default: Int. RC Osc. 8Mhz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 65ms; [CKSEL=0010 SUT=10];

This resulted L:E2 H:DC E:FD

This is a stock R4 Moteino.  Does that look reasonable?

TomWS


ssmall

One last question.  Do the fuses I set via the AVR programmer need to match what I set up for a 8Mhz Moteino in the boards.txt.  Thanks

TomWS

Quote from: ssmall on May 18, 2016, 02:21:30 PM
One last question.  Do the fuses I set via the AVR programmer need to match what I set up for a 8Mhz Moteino in the boards.txt.  Thanks
More like the other way around, but if you're not burning the fuses via the IDE, it probably doesn't matter what's in the boards.txt file.

Tom

kobuki

Sorry for reviving such an old thread, but I don't seem to find the consensus here and I want to do the same: using the internal 8 MHz clock with the Moteino and DualOptiBoot.

So far I assume:
- fuses need to be set properly for internal osc.
- DOB needs to be recompiled with 8 MHz settings <-- this is the point that is not clear as it apparently worked for Tom without recompiling but not for others
- Arduino picks up settings anc compiles everything for the pre-set clock rate

If the second point is "recompiling needed", would anyone be kind and share their .hex file? Would be most appreciated.

TomWS

Quote from: kobuki on June 15, 2017, 04:41:05 PM
Sorry for reviving such an old thread, but I don't seem to find the consensus here and I want to do the same: using the internal 8 MHz clock with the Moteino and DualOptiBoot.

So far I assume:
- fuses need to be set properly for internal osc.
- DOB needs to be recompiled with 8 MHz settings <-- this is the point that is not clear as it apparently worked for Tom without recompiling but not for others
- Arduino picks up settings anc compiles everything for the pre-set clock rate

If the second point is "recompiling needed", would anyone be kind and share their .hex file? Would be most appreciated.
I'll stand by my claim.  I've never built the bootloader and ALL of my Motes run at 8MHz.
However, for full disclosure, I'm not using that bootloader any more...  Not because of issues with it, but features found elsewhere.
Tom

kobuki

OK, thanks, I'll test it without recompiling first.

May I ask, what bootloader you use instead of DOB and what features they provide?

TomWS

Quote from: kobuki on June 15, 2017, 08:13:00 PM
OK, thanks, I'll test it without recompiling first.

May I ask, what bootloader you use instead of DOB and what features they provide?
I'm not at liberty to say, but, if you think about it, you might be able to guess.  And I still run at 8MHz because I don't need an external timing element if I do.  It's not about about parts count as much as it is space and power savings.

Tom

kobuki

OK, I understand. I can guess, but would prolly miss.

I'm more interested in the features and the possibility to use them in the future (if they sound useful). That is, if you're at liberty to say.

ChemE

I would imagine that he has a copy of joelucid's unsupported and unavailable bootloader which does seem to have quite the feature set.

kobuki

Yeah, it was mentioned several times but that's admittedly hard to use properly for a stable setup and only about 2 people were able to use it succesfully. That's what I recall at least. So I guess it's not some personal experimental project bootloader but an actual stable, full-blown bootloader under some kind of NDA, judging from the answers. A good stable OTA loader - without requiring extra components like a flash chip - would be nice. That's what I'm interested in, should one exist somewhere.

But we're starting to drift from the main topic a bit.

ssmall

I did not need to recompile the bootloader.  I used the fuse settings referenced earlier in the thread and the Moteino8Mhz that Tom, I think, specified to use in boards.txt.  If you are using an older version of avrdude the High and Extended fuses are reversed in the print out.  The latest version of avrdude fixed the issue.