Go Down

Topic: Did you know fuses and signature bytes can be read out LIVE? (Read 1 time) previous topic - next topic

krupski

He is referring to my Self-read signature sketch.
Oh. I wasn't aware of that sketch. The only one I knew of was this one: LINK
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

krupski

That is normal known information. Search for "GET_LOW_FUSE_BITS" in "forum.arduino.cc" or "playground.arduino.cc" or in "github.com".
This is the Playground : http://playground.arduino.cc/Main/ShowInfo

Well, I didn't know that it was well known info... I posted it in hopes that it may be of help to someone. Oh well......
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

MAS3

The text "SIGRD" is in the error report jboyton showed.
It also refers to line 25 of the sketch jboyton was compiling.
The fact that there is no reference to what character on that line creates (starts) the error, shows (s)he used an older IDE like 1.0.5.

Using the copy function of this forum software, and pasting the result in the IDE will show that line 25 is this one:
Code: [Select]
sig[addr] = boot_signature_byte_get (addr * 2);


Because there is no text "SIGRD" in the code you posted, it has to be something in the necessary boot.h, or its dependencies.
My IDE 1.6.3 doesn't generate that error, and after searching a bit for boot.h, i found it is in there.
That's why i posted what i found.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

jboyton

It's referenced in boot.h. It should be defined in iomxxxx.h, which would be iom328p for my Uno board. But for IDE 1.0.5 it is missing for the 328p. That was corrected in some later version and is there in 1.6.3.

That wasn't the only compile error.

klubfingers

Excellent!

Works on IDE 1.6.1 and Linux.

Good show,  Krupski

nickgammon

Quote
Also, I don't use the setup/loop programming style - I just use int main (void) with init() at the beginning and while (1) at the end.
Which would be a relief to people who have programmed in C for the last 20 years, I am sure. :)

I honestly wish they had left it like that. How hard is it to tell people to  "initialize stuff" and then "loop to do other stuff"?
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

westfw

There is also https://github.com/WestfW/fusebytes
It probably doesn't compile any more; it's about 5 years old.
It's not clear that being able to read this sort of information is useful.

Now, did you know that you can unset the CKDIV8 at runtime?  Not the fuse itself, but by modify CLKPR.
Apparently, all CKDIV8 does is determine the initial value loaded into CLKPR!



nickgammon

Yes, I discovered that recently. Useful thing to know.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

krupski

Which would be a relief to people who have programmed in C for the last 20 years, I am sure. :)

I honestly wish they had left it like that. How hard is it to tell people to  "initialize stuff" and then "loop to do other stuff"?
I agree with you completely. The Arduino system is "dumbed down" to allow people with limited programming experience to actually be able to write a working program, but IMHO they take it too far.

Gentlemen may prefer Blondes, but Real Men prefer Redheads!

krupski

There is also https://github.com/WestfW/fusebytes
It probably doesn't compile any more; it's about 5 years old.
It's not clear that being able to read this sort of information is useful.

Now, did you know that you can unset the CKDIV8 at runtime?  Not the fuse itself, but by modify CLKPR.
Apparently, all CKDIV8 does is determine the initial value loaded into CLKPR!



Stuff that "doesn't compile anymore" is usually due to changes in GCC rather than the IDE itself.

In my setup, I completely removed the whole "tools" directory that has the avr-gcc compiler code and compiled my own (version 4.9.2) instead. As long as the compiler, linker, etc... are in the executable path, it works properly.

If I use the IDE at all, it's just for the "upload" button. I edit code using nano and serial monitor using minicom.

I've got a nice universal Makefile that takes the directory name I'm working in and passes it to the Makefile as the project name (so all I need to do is type "build" in the sketch directory).

It's nice to combine it all into one command line such as "nano program.ino && build && minicom", then it does everything automatically. To go again, all I need to do is quite "minicom" and recall the last command line and do it again.

(and about 1000 tries later I may actually have a program that works!  :)  )
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

Go Up