[Icc-avr] Reading Fuses on Mega88

Ian ianjames at waitrose.com
Thu Nov 29 03:31:31 PST 2007


Does anyone know how to read fuses on a mega88?

I have tried the following but the results are incorrect.

void ReadFuseLock(void)
{
   const unsigned char* ptr;
   unsigned char Fuse[4];

   // Read lock bits
   SPMCSR = 0x09;	//  (BLBSET | SPMEN) to read fuse and lock bits
   ptr = (const unsigned char*)(0x0001);	// 0x0001 to read lock bits
   Fuse[0]=*ptr;
	
   // Read fuse low bits
   SPMCSR = 0x09;	
   ptr = (const unsigned char*)(0x0000);	
   Fuse[1]=*ptr;

   // Read fuse high bits
   SPMCSR = 0x09;	
   ptr = (const unsigned char*)(0x0003);	
   Fuse[2]=*ptr;
  }

The values returned are:

Lock Bits	0xC0		(should be 0xFF)

Fuse Low Bits	0x31		(should be 0xE6)

Fuse High Bits	0xC4		(should be 0xD8)

Any ideas anyone?

Regards,

Ian James
-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



More information about the Icc-avr mailing list