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.

[SOLVED] Need help in compiling this program

Status
Not open for further replies.

vinodhembedded

Junior Member level 2
Joined
Jul 29, 2013
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
147
Hii,

i need help to clear this error in ths program..


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include<built_in.h>
void main()
{
int count=0;
TRISB=0x00;
PORTB=0;
TMR0=0;
OPTION_REG=0x07;
while(1)
{
PORTB.F1=1;
Delay_ms(100);
PORT.F1=0;
              while(PORTB.F0==1)
              {
               while(!T0IF);
               T0IF=0;
                count++;
               if(count==15)
                {
                  PORTB.F2=1;
                Delay_ms(500);
                 count=0;
                 PORTB.F2=0;
}}}}



I m getting the error ->

"Assigning to non-value[T0IF]"
 
Last edited by a moderator:

Not sure what the "while(!TOIF);" is doing-something doesn't look right there. Is that a variable that gets modified by some interrupt process, or what? Is this a PIC? A little more information would help.
 

It's a lot easier to read if you put it inside code tags!

As Barry points out, it is usual to do something after a 'while' statement. Are you just waiting for T0IF to be non-zero before continuing? If that is the case try putting { } after the while(!T0IF) and before the ; in case the compiler is objecting to no code being present. The error message does seem to suggest that T0IF is not a variable though, should it be "<a register name>.T0IF" in the same way you have specified port bits?

Brian.
 
hi guys

thanks for the reply..
i have found the answer..
this is PIC16F877A
and i m trying to watch timer 0 interrupt flag bit.. its is not T0IF, it is TMR0IF..
i typed INTCON.F2 instead of TMR0IF..
its compiling now..


Thanks
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top