Home - Search - Members
Full Version: need help about MickroC Compiler
nadeem malik
Jun 20 2008, 11:54 PM
i have just started to learn micro C compiler
----------
i need some help


we can define a pin in kiel vision easily
sbit ab=P1^0;

problem is that h i can implement this thing in mickro C
Ajay
Jul 7 2008, 8:53 AM
you cant do that in micro C

as i said.. i have not used MicroC yet.. but if you give me little time i can explain it

in CCS compiler you can define pins as..

CODE:
#define Some_Pin PORT_B4
 
sashijoseph
Jul 7 2008, 8:39 PM
@nadeem malik
think you'll need bit masks for port bit-access.
Like (P1 & 0x01) for P1.0
(P2 & 0x08) for P2.3
etc.
Ajay
Jul 8 2008, 8:40 AM
ANDing for clearing a bit and ORing for setting a bit is a common practice and applicable for every controller in world
Colin Mac
Jul 20 2008, 4:19 PM
You can do this in mikroC

#define mypin PORTB.F4
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Rickey's World © 2003 - 2007