How to give logic 1 to one pin in ATmega16. If I am giving 5v to pin .Its not working

Thread Starter

nishkum3

Joined Jun 5, 2017
14
I need to give logic 1 to one pin. I am just giving 5v directly to that pin . But its not working. Not sure what to do..PLesase suggest.
 
Last edited:

Reloadron

Joined Jan 15, 2015
7,887
Code? Your code would help along with a drawing of the circuit. There is no way to tell what your problem might be without more information.

Ron
 

MrSoftware

Joined Oct 29, 2013
2,273
If your intent is to read a logical 1 or 0 from that pin, then be sure to set the pin mode as digital input. Also be sure to pull the pin up or down so that it's not floating. The processor probably has a way to turn on internal pull-up or pull-down resistors so that you don't have to do it externally.
 

nerdegutta

Joined Dec 15, 2009
2,689
I need to give logic 1 to one pin. I am just giving 5v directly to that pin . But its not working. Not sure what to do..PLesase suggest.
How do you know? What are your expectations?

You need to show your code and your schematic, which has been mention. If you have your circuits on a breadboard, a focused picture would do just fine.
 
Top