- This topic has 2 replies, 3 voices, and was last updated 7 years, 11 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
|
Microcontroller › AVR › help in input of atmega 8l
im a begineer
i have learn`t to use avr`s outputs (did sum blinking..,patterns,7seg display..etc)
but its a week now and im not able to read inputs..
PLZ HELP
also tell that can avr detect an output high of 3v..
Hi Ahmet
Make sure that you are defining a particular pin/port as input, also after that declare whether it is pulled up or not. Go as follows:
DDRC & = ~(1<<0); // defined PORTC's 0 pin as i/p pin
PORTC | = (1<<0); // declared it as a pulled up i/p pin
Now if you try reading this pin's value it will give you a high state unless any logic 0 is applied to it externally, this is because its pulled up.
This might help, good luck
always connect pull up resistor of 1K-10K with ATmega pin when it is used as input