PORTD as an input and PORTC as an output

Status
Not open for further replies.

beeboss

Newbie level 5
Joined
Jun 28, 2011
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
India
Activity points
1,330
Hi all,

Im using ATmega8535. I want to give the input through the PORTD and i want the output from PORTC. Im new to the AVR. anyone please send the C code for the same.

Thanks...
 

DDR (Data Direction Register) is set to 0x00 (all inputs) by default. To make all lines on PORTC outputs, use the following command:

DDRC = 0xff;
 

I like this tutorial
it has some nice graphics with a good explanation of port registers
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…