Is there a way to read the fuse byte with ZBasic code for the 328p device?
Ricahard
fuse bytes
Re: fuse bytes
There is no ZBasic function that allows direct reading of the fuse bytes. However, there is a multi-step process that you can use to read a fuse byte, one that requires a little assembly language code and also requires interrupts to be disabled temporarily. See section 25.2.2 of the ATmega328P datasheet.rich wrote:Is there a way to read the fuse byte with ZBasic code for the 328p device?
http://ww1.microchip.com/downloads/en/D ... asheet.pdf
If you need some help writing the assembly language code, I can provide some early in the week - I'm traveling at the moment.
- Don Kinzer
The attached .zip file contains a ZBasic project that demonstrates how to read fuse bytes and the lock byte on a ZX328N. The functionality is implemented in an AVR assembly language file (that may need to be modified for other base devices). It has been tested on a ZX328N and seems to produce the correct results.
- Attachments
-
- FuseBytes.zip
- (1006 Bytes) Downloaded 281 times
- Don Kinzer
The attached .zip file is another implementation of the code to retrieve fuse bytes. This one doesn't use an assembly language file but does use some inline C code that utilizes some knowledge of the generated names for parameters and return values.
As with the last one, it is written specifically for the ATmega328P-based devices and might need some minor changes for other devices.
As with the last one, it is written specifically for the ATmega328P-based devices and might need some minor changes for other devices.
- Attachments
-
- FuseBytes2.zip
- (721 Bytes) Downloaded 281 times
- Don Kinzer