avr-chat
[Top][All Lists]
Advanced

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

[Fwd: Re: [avr-chat] Mega644 bit test problem]


From: Robert von Knobloch
Subject: [Fwd: Re: [avr-chat] Mega644 bit test problem]
Date: Fri, 08 May 2009 13:08:31 +0200
User-agent: Thunderbird 1.5.0.14 (X11/20060911)

Piotr Nikiel wrote:
> On May 8, 2009, at 11:41 AM, Robert von Knobloch wrote:
>
>   
>> Hallo,
>>
>> I am writing code for an ATMega 644P and have come across some very
>> strange behaviour.
>> A small part of the code is required to read an asynchronous serial
>> signal (data & clock - low speed) over PORTB pins.
>> The relevant code snippet is:
>>
>> snip
>> #define CLOCK_TIMEOUT    2000
>> #define ASYNCPIN    PORTB
>> #define ASYNCCLK    0
>> #define ASYNCDATA    3
>>
>>     for (i = 0 ; i < 16 ; ++i)
>>     {
>>         while ((ASYNCPIN & _BV(ASYNCCLK)) != 0)        // Wait for  
>> clock low
>>
>>     
> (...)
> Sorry for out of topic, but  shouldn't you use PINB instead of PORTB  
> when reading pin state?
>
> Regards,
> PN
>
>
>
> _______________________________________________
> AVR-chat mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/avr-chat
>
>
>   
Yes, a typo in my mail.
It is really PINB (referenced through another #define which I omitted
for clarity, thus obscuring all sense)
Thanks,

Robert






reply via email to

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