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

Williamjef
Thu Apr 25 2024, 02:08 pm
SamuelSmise
Thu Apr 25 2024, 09:56 am
DustinErele
Thu Apr 25 2024, 08:44 am
ztaletpzca
Wed Apr 24 2024, 11:19 pm
IrardlPex
Wed Apr 24 2024, 08:42 pm
Charlestehed
Wed Apr 24 2024, 05:20 pm
Robertgurse
Wed Apr 24 2024, 02:43 pm
Richardedils
Wed Apr 24 2024, 04:07 am