Yahoo Groups archive

AVR-Chat

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

Thread

pull up resistor

pull up resistor

2009-06-07 by drs1_shah

hi,can anyone explain me the logic behind the pull up resistors in atmega 16.in which condition my input pin is in high impedance state? If i write

DDRA=0x00;
PORTA=0xFF; 

this means that i have enable the pull up resistor.so r the pins at +5V or floating input is there? secondly for testing d input do i need to use

char test;
test=PINA;
if(test == 0xFF)
{}

or do i use

bit_is_set(PINA,0) && bit_is_set(PINA,1) ,etc

or if i test logic 1 at A0 ,then is this app,

if((test & 0x01)==0x01)

basically i have 5 sensor input which are connected to A0-A4 and i need to test d input either it is 1 or 0 .

Re: [AVR-Chat] pull up resistor

2009-06-07 by Jim Wagner

You set the direction as "input" and the port value as 0x00 to turn  
off the pull-up resistors. So, write 0x00 to both DDRA and PORTA.

Table 20 shows you the combinations.

Jim Wagner
Oregon Research Electronics

On Jun 7, 2009, at 3:37 AM, drs1_shah wrote:

>
>
> hi,can anyone explain me the logic behind the pull up resistors in  
> atmega 16.in which condition my input pin is in high impedance  
> state? If i write
>
> DDRA=0x00;
> PORTA=0xFF;
>
> this means that i have enable the pull up resistor.so r the pins at  
> +5V or floating input is there? secondly for testing d input do i  
> need to use
>
> char test;
> test=PINA;
> if(test == 0xFF)
> {}
>
> or do i use
>
> bit_is_set(PINA,0) && bit_is_set(PINA,1) ,etc
>
> or if i test logic 1 at A0 ,then is this app,
>
> if((test & 0x01)==0x01)
>
> basically i have 5 sensor input which are connected to A0-A4 and i  
> need to test d input either it is 1 or 0 .
>
>
> 



[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.