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.

using BTFSS function in Hitec c

Status
Not open for further replies.

Brejain

Newbie level 3
Joined
Jan 5, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Coimbatore
Activity points
1,322
BTFSS in Hitec c

Hi everyone.
I was using BTFSS function to check the STATUS bit of PIC 16f877. I got it correctly..
I wanted to implement same program in C for which i am using a hitech c compiler. Could anyone just help me hw to write the BTFSS statement n BTFSC statement in C.
Also let me know if there any special instruction r tricks by which we can one set a bit in a REGISTER. Is there any other way other than the given below

PORTB = 0X80;

Thanks for your time.
 

Re: BTFSS in Hitec c

I don't use Hitech but the usual way is something like this:

if(STATUS & (1 << xxx))
{
//do something
}


substitute the name of the bit you want to test for 'xxx'.

Brian.

Added after 2 hours 35 minutes:

If you want to set one bit in a register, use this:
Code:
xxx |= (1 << bit number);
to reset a bit use:
Code:
xxx &= ~(1 << bit number);
Substitute the register name for 'xxx'. You can use a bit name instead of bit number as long as it has been defined somewhere.

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top