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]Message
Re: [AVR-Chat] pull up resistor
2009-06-07 by Jim Wagner
Attachments
- No local attachments were found for this message.