avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-chat] Atmega128, JTAG and ADC


From: Brian Dean
Subject: Re: [avr-chat] Atmega128, JTAG and ADC
Date: Sun, 17 Jul 2005 18:39:29 -0400
User-agent: Mutt/1.5.9i

On Sun, Jul 17, 2005 at 12:48:58AM -0700, Larry Barello wrote:

> if (MCUCSR & _BV(JTRF) != 1)
> {
>       MCUCSR |= _BV(JTD);
>       MCUCSR |= _BV(JTD);
> }
> 
> But find that no matter what the code is executed.

Your expression will never be false, since JTRF is bit 4, not bit 0.
I think you want:

    if ((MCUCRS & _BV(JTRF)) != _BV(JTRF)) {
      ...
    }

-Brian
-- 
Brian Dean
ATmega128 based MAVRIC controllers
http://www.bdmicro.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]