Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

C language code for PIC controller

Status
Not open for further replies.

ss_engg

Member level 5
Joined
Mar 9, 2011
Messages
81
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Pakistan
Activity points
1,854
what is meant by this in C language for PIC

if(PORTB.F0 )

please guide me as i'm new in C language specially for PIC.
Thankyou ...
 

".F0" will be a name given to either a pin function or a port bit number. You should search in the ".inc" files which are probably listed at the top of the program and read their contents so see the equivalent pin number it refers to. For example, it might equate to PORTB.4 meaning bit 4 of PORTB.

The 'if' ststement is true if the value is anything except zero and the only alternative is '1' so it says "if the pin called F0 on PORTB is equal to 1 run the following code".

Brian.
 

Actually, if you are coding in C, you may want to reference the device specific header file, for example p16f877a.h, rather than the Assembly INC files.


BigDog
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top