Discussion in "PIC Microcontroller Discussion" started by    nadeem malik    Jun 21, 2008.
Sat Jun 21 2008, 12:24 pm
#1
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
Mon Jul 07 2008, 09:23 pm
#2
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..

#define Some_Pin PORT_B4
Tue Jul 08 2008, 09:09 am
#3
@nadeem malik
think you'll need bit masks for port bit-access.
Like (P1 & 0x01) for P1.0
(P2 & 0x08) for P2.3
etc.
Tue Jul 08 2008, 09:10 pm
#4
ANDing for clearing a bit and ORing for setting a bit is a common practice and applicable for every controller in world
Mon Jul 21 2008, 04:49 am
#5
You can do this in mikroC

#define mypin PORTB.F4

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

JamesroW
Mon May 06 2024, 09:37 am
Chrispes
Mon May 06 2024, 07:34 am
ArktiTic
Sun May 05 2024, 07:06 pm
CesslasyNear
Sun May 05 2024, 02:58 pm
chimichmedic1204
Sun May 05 2024, 11:06 am
Jamiegob
Sun May 05 2024, 10:11 am
Gregoryjed
Sun May 05 2024, 10:02 am
Mariocax
Sun May 05 2024, 08:51 am