Pages: [1]   Go Down
Author Topic: Permaloading  (Read 402 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi.

I'm new to Arduino.  I'm interested in using it, but before I buy, I need a probably simple question answered.

Can the Arduino (specifically, the UNO) be permaloaded to execute a specific set of intstructions every time upon boot?

Thanks
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24370
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 5519
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Can the Arduino (specifically, the UNO) be permaloaded to execute a specific set of intstructions every time upon boot?

What do you mean exactly by "permaloaded"?

If you mean "one time programmable" - this isn't really possible (AFAIK, Atmel doesn't have an OTP version of the ATMega). You can however set various protection flags with an appropriate programmer to keep someone from being able to easily read out the hex program or change it. Note I said "easily" - even with those bits set, there are ways around this "protection", but for the casual everyday user, it won't be an issue.

If, however, by "permaloaded" you mean just loaded on to the microcontroller (the ATMega), and it will execute every time it is powered on (and you don't care if somebody can access/change the hex code afterward) - then yes, this is how it works by default. The hex code (generated by the compiler) is stored in a flash-based memory area on the processor, and doesn't go away when power is removed.

The only other thing to note is that on a stock Arduino, there is a slight delay for the startup of your code - this is because the built-in bootloader checks to see if an upload is occuring, and if not, jumps to execute the code already in the flash. You can bypass this by writing the hex file generated by the compiler using an ISP programmer, which will also overwrite the bootloader (and give you an extra 2K of flash for program area); then the code will execute immediately (this is how the bootloader is put into place, btw)...

smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Pages: [1]   Go Up
Jump to: