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.

Problem with using individual bits in mikroC program for PIC16F84A

Status
Not open for further replies.

mr_anderson

Advanced Member level 4
Joined
Jan 23, 2007
Messages
100
Helped
5
Reputation
10
Reaction score
4
Trophy points
1,298
Activity points
2,005
Hi
i am using mikroC to program PIC16F84A, it works just fine when i use the built-in libraries, but when i use the individual bits, it starts to function incorrectly, the code below should make RB3 OUT and RA2 IN, but it doesnot can any one tell me why?
void main()
{
TRISB.f3=0;// make RB3 out
TRISA.f2=1;// make RA2 in
while(1)
{
if (PORTA.f2) PORTB.f3=1
}
}
the code shown above works just fine when i replace
TRISB.f3=0 with TRISB=0;
and
TRISA.f2=1 with TRISA=0
it starts to function correctly can any one tell me why?
Best Regards
 

mikroc pic16f84a

I will check it thank you,
According to your experience Did you access the individual bits with mikroC without problems?
i mean does mikroC works with individual bits 100%?
Thank you again.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top