Yahoo Groups archive

AVR-Chat

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

Thread

Re: [AVR-Chat] weird mega88 problem

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:
Show quoted textHide quoted text
>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
>
>
>

Re: [AVR-Chat] weird mega88 problem

2012-03-08 by Zack Widup

It's possibly a bad chip. Does only one Mega88 have this problem? Have you
tried substituting another? Bad Chips DO get sold once in a while.

Zack

On Thu, Mar 8, 2012 at 10:42 AM, Dave <microbrix@gmail.com> wrote:

> **
>
>
> 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
> >
> >
> >
>
>  
>


[Non-text portions of this message have been removed]

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.