Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] weird mega88 problem

2012-03-08 by Dave

Is this by chance in the debugger or jtag ice?

Tim Mitchell <tim@sabretechnology.co.uk> wrote:

>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 
>
>
>
>------------------------------------
>
>Yahoo! Groups Links
>
>
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.