weird mega88 problem
2012-03-08 by Tim Mitchell
OK so I've got this mega88 where some bits in registers R0-R15 appear to be permanently set... if I do ldi R16,0 mov R1,R16 R1 has 1 in it!! Same code on a different mega - everything is OK. Avoid using R1 - everything is OK. Has anyone ever seen anything like that? Then I have another mega88 on a different project. C software this time (GCC) (Interrupts are not enabled) I am doing if (Value==0) EepromWrite(0x20,Value); which it's compiling as lds r24,0x0115 and r24,r24 breq +2 rjmp +362 However the EepromWrite is happening even when Value is zero, but when I read back the eeprom values, it has stored 0x01. So it seems like the SREG is corrupted somehow, ie the zero flag set when it shouldn't be. Help! am I going mad? -- Tim Mitchell