I have an Arduino UNO Rev3 and need to make sure that once programmed, no more information can be written to it. I'm guessing this can be done by clipping a pin or two on the microcontroller, but not familiar enough with the details to be sure.

I'm not aware of a way that this is ultimately possible, though (especially if you have a soldered-chip version) you can make it fairly difficult. So let's concentrate instead on things you could do to prevent accidental or casual modification:

  • you could disable the reset connection between the USB interface chip and the ATMEGA. This would make it a lot harder to get into the bootloader which is used to download new sketches.

  • on an UNO specifically, you could reflash the USB interface micro to disable it entirely, or just remove the code for manipulating the reset line (if you still need it for runtime communication)

  • you could remove the bootloader from the ATMEGA; this would mean you would need an ISP circuit (potentially another Arduino) to change the sketch. In a production setting, you could write a sketch which contains enough of a flash programming scheme to disable the bootloader when it's first run, meaning that you could use the factory bootloader to get your code onto the chip, but then block any further update by that route, though connecting an ISP programmer would still be a possibility for you or others.

  • In addition to disabling the bootloader or entry into it, you could set the fuse bit to change the reset pin to a GPIO (or is that on the ATTINY's only? haven't checked). This would mean that ISP would no longer be possible, and a high-voltage programmer would be needed; possibly requiring transplanting the chip to a programmer.

  • You could enable the security fuse, preventing readout of your code, but AFAIK not preventing someone from wiping the chip clean to repurpose it

  • You could physically cut pins critical to ISP and high voltage programming but un-needed by your application, flush with the package. This would require someone to dig further into the package to get the connections to reprogram that chip, but -

Remember that nothing you do can overcome the relative ease of swapping out the ATMEGA part for a new one, or more simply swapping out the entire Arduino for a new one. (Well, I suppose you can bury the whole project in a large mass of potting compound...)

You can do it using the lock bits look at the datasheet under the memory programming section. You will probably need a programmer like the AVRISP mkII to do so.

I just wanted to add: If you have 2 arduinos, you can actually program one to be an in-serial-programmer to program the other. Ie: then you can do the fuse bits.

Its fairly straight forward

(I would have added this to @Kvedaoro 's answer, but I don't have the reputation points for comments)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.