Search This Blog
Friday, March 12, 2010
AVR ATMEGA16 MICRO CONTROLLER
AVR is 8 bit micro-controller.
ATMEGA16 Registers
Registers: (x - A/B/C/D)
DDRx - data direction register
DDRx = 0xFF; //output register
DDRx = 0x00; //input register
PORTx
PORTx = 0xFF; //set all pins high of x port
PORTx = 0x00; //reset all pins low
PORTx.0 = 0x00; //change only 0th pin of port x
PINx Port IN
Used to read port data. but port direction must be INPUT.
x = PINx; //read port
or
x = PINx.0; //read a ports pin
Reverse a Port
PORTx = ~PORTx;
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment