PDA

View Full Version : noob programming



shakerobo
11-15-2009, 09:57 AM
hello,
i m new to avr gcc,
how to make port b0 only as output?
please help

regards,
-gaurav

kp_chd
11-15-2009, 03:28 PM
Ports are designated as PORTA,PORTB etc.
Bits are designated as PB0 etc
So there's no such thing as 'port b0'

I assume you meant bit 0 of port b

do this:
DDRB&=0x01;
or
DDRB&=(1<<PB0);

look up google & bibin john's book (available online) for explanation.The book will also provide you all the info necessary to get started.

_Prateek

avinash_g
11-16-2009, 08:16 AM
:D

see this
http://extremeelectronics.co.in/avr-tutorials/part-v-digital-io-in-avrs/