avr-chat
[Top][All Lists]
Advanced

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

RE: [avr-chat] Really dumb question about port IO


From: Matt.VanDeWerken
Subject: RE: [avr-chat] Really dumb question about port IO
Date: Mon, 8 May 2006 13:02:10 +1000

Yep, that was it. I knew it was something basic - thanks!

Cheers,
Matthew van de Werken - Electronics Engineer
CSIRO E&M - Rock Mass Characterisation - 1 Technology Court - Pullenvale
- 4069
p: (07) 3327 4142 * f: (07) 3327 4455 * e: address@hidden
"We do not inherit the earth from our ancestors, we borrow it from our
children." 
-- Native American Proverb

> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden
>  On Behalf Of Neil Davey
> Sent: Monday, 8 May 2006 12:50 PM
> To: address@hidden
> Subject: Re: [avr-chat] Really dumb question about port IO
> 
> 
> Shouldn't PORT_PWRGOOD  be equal to PINB instead of PORTB?
> 
> so it should read like:
> 
>     while((PINB & (_BV(PB6))) == 0)
> 
> I might be wrong... long day..
> 
> Regards
> Neil Davey
> 
> address@hidden wrote:
> > Hi all:
> >
> > Port IO has been covered a million times on this list, but 
> I am having 
> > a really basic prolem with it.
> >
> > I am trying to read the value of a port pin on a mega128, using the 
> > following syntax:
> >
> >     while( (PORT_PWRGOOD & (_BV(PIN_PWRGOOD))) == 0) {
> >       if(++i>PWR_TIMEOUT) {return digpower = PWR_OFF;}
> >     }
> >     return digpower = PWR_ON;
> >
> > But the function always returns PWR_OFF, even though the pin in 
> > question has been raised. I have checked and double-checked the 
> > #define PIN_PWRGOOD and PORT_PWRGOOD values (they are PORTB 
> and PINB6 
> > respectively, if it matters).  I don't believe I've set the SFR to 
> > enable the alternative function of the pin, either, and the timeout 
> > value is huge (something like a couple of seconds, well 
> after the pin 
> > has gone high).
> >
> > I must have missed something really basic, surely?
> >
> > Cheers,
> > Matthew van de Werken - Electronics Engineer
> > CSIRO E&M - Rock Mass Characterisation - 1 Technology Court - 
> > Pullenvale
> > - 4069
> > p: (07) 3327 4142 * f: (07) 3327 4455 * e: address@hidden
> > "We do not inherit the earth from our ancestors, we borrow 
> it from our
> > children." 
> > -- Native American Proverb
> >
> >
> > _______________________________________________
> > AVR-chat mailing list
> > address@hidden 
> http://lists.nongnu.org/mailman/listinfo/avr-chat
> >
> >   
> 
> 
> -- 
> --------------------------------------
> Neil Davey
> Griffith University
> 
> Griffith School of Engineering
> Nathan Campus
> Phone: 07-3735-7008
> Fax: 07-3735-5112
> 
> School of Psychology - ACNRC
> Mt Gravatt Campus
> Phone: 07-3735-3395
> --------------------------------------
> 
> 
> 
> _______________________________________________
> AVR-chat mailing list
> address@hidden http://lists.nongnu.org/mailman/listinfo/avr-chat
> 




reply via email to

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