Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Input Output in ATmega

Status
Not open for further replies.

nXn

Newbie level 3
Joined
Dec 30, 2009
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
UAE
Activity points
1,339
I am new to Atmega .....
I am using AVR studio for programing my atmega 16
But when I give the below statement it doent work...

if(PINC.0==1)
PORTB=0x01;

It doent show any compiling error ....
but when burned in a microcontroller it doent glow the LED which is connected to PORTB.......
 

Hi,
I think your code should be:
Code:
if (PINC & (1<<0))
   PORTB = 0x01;
instead of:
Code:
if (PINC.0 == 1)
PORTB = 0x01;

Added after 1 minutes:

Try it and let me know how it works out for you.
Tahmid.
 

If you are using winavr, then try:

if(bit_is_set(PORTC, 0))
 

how to give input to atmega 16...........

if i want to give it to porta....

should i give +5 volts between the required pin of porta and ground....

or wat else should i do?????????
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top