8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
nadeem malik
Fri Jun 20 2008, 11:54PM
 User Offline
Registered Member #5180
Joined: Wed Dec 19 2007, 07:10PM

Posts: 15
Thanked 0 times in 0 posts
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


Back to top


Ajay
Mon Jul 07 2008, 08:53AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3542
Thanked 649 times in 613 posts
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
 


www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


sashijoseph
Mon Jul 07 2008, 08:39PM

 User Offline
Registered Member #5870
Joined: Mon Feb 04 2008, 06:26PM

Posts: 502
Thanked 116 times in 109 posts
@nadeem malik
think you'll need bit masks for port bit-access.
Like (P1 & 0x01) for P1.0
(P2 & 0x08) for P2.3
etc.

Let there be music........
Back to top


Ajay
Tue Jul 08 2008, 08:40AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3542
Thanked 649 times in 613 posts
ANDing for clearing a bit and ORing for setting a bit is a common practice and applicable for every controller in world

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


Colin Mac
Sun Jul 20 2008, 04:19PM
 User Offline
Registered Member #4338
Joined: Wed Oct 10 2007, 05:46AM

Posts: 56
Thanked 0 times in 0 posts
You can do this in mikroC

#define mypin PORTB.F4
Back to top


 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems