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.

16F87Xa timer0 programming error

Status
Not open for further replies.

bimalkamal

Member level 1
Joined
Nov 27, 2011
Messages
32
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,529
This code is for PIC16F876A with 20Mhz crystal to learn using Timer0 .
I am getting the following error in mikroc Pro:-


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
void main() {
 unsigned char count;
 TRISB=0;
 TMR0=0;
 OPTION_REG=0B00001000;
 PORTB=0x00;
 while(1){
    if(TMR0IF)    { //<---------no error here
    count++;
    TRISB=count;
    TMR0IF=0;  //<----------Error : Assigning to non lvalue "TMR0IF" but no error if I write INTCON.TMR0IF=0;
    
    }
 }
}



Why TMR0IF=0; giving error?

Also please suggest some site/blog to learn 16F87Xa timer0 programming

Thanks in advance.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top