hw to coed in avr studio 4.12. i'm beginer
Discussion in "AVR Discussion Forum" started by sathish_org Feb 13, 2008.
Wed Feb 13 2008, 12:50 am
hi can any one help me??? i'm using atmeg8l contr... i wud lik to write de code in c. so can anyone say hw to assign a port pin to a variabl declarion(macro). jus hw v use to do 8051 controller in keil lik dis #define LED p1_0 similarly hw v hav to do in avr studio 4.12
Wed Feb 13 2008, 11:51 am
AVR's ports are not bit addressable so you cannot define a particular pin.
and you have to install WINAVR along with AVR studio if you want to write C programs in AVR studio.
and you have to install WINAVR along with AVR studio if you want to write C programs in AVR studio.
Wed Feb 13 2008, 12:01 pm
#define LED PB0abbas1707
oh my God!
how i wrote this...i was sleeping i think
Wed Feb 13 2008, 01:04 pm
lets say LED is connected to PB.4 so.. you need to define this pin something like this..
#define LED 4 //to set this pin PORTB |= 1 << LED; // to clear this pin PORTB &= ~(1 << LED);
Powered by e107 Forum System