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.

Mikro c pro Timer not working

Status
Not open for further replies.

fateme.m

Newbie level 5
Joined
Nov 4, 2010
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,325
it is my program but unfortunately timer is not unable
without any error
please help me


void interrupt() {
cnt++ ;
PIR1.TMR1IF = 0;
TMR1H = 0x80;
TMR1L = 0x00;
}

void main() {
ANSEL = 0;
ANSELH = 0;
PORTB = 0xF0;
TRISB = 0;
T1CON = 1;
PIR1.TMR1IF = 0;
TMR1H = 0x80;
TMR1L = 0x00;
PIE1.TMR1IE = 1;
cnt = 0;
INTCON = 0xC0;

do {
if (cnt == 76) {
PORTB = ~PORTB;
cnt = 0;
}
} while (1);
}
 

Thanks
i have PIC16F887
additionally this program correct worked with other compiler(MPLAB)
 

Hi,

Did you just modify the code in the MPLAB folder and recompile in MikroC? Or did you build a new project folder from scratch for MikroC?

Also did you disable context-switching?

Check this appnote out:

Interrupts (mC PRO for PIC)

Hope this helps.
 

The code should work as far as I can see although I have not simulated or tried it in hardware.
Do you have the configuration fuses set correctly? Is the PIC running at all?

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top