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.

PIC16F877a Timer and Interrupt

Status
Not open for further replies.

iczey

Newbie level 3
Joined
Mar 25, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
manila
Activity points
1,320
Hey guys..

I'm quite unfamiliar on how to use timer and interrupt in the said microcontroller. I am using mikro C and I have this project were the program has to do 2 sets of operation, one is to continuously monitor a certain adc level, and the next is to send the average adc level thru usart every hour. i am having problems using looped delays, and i was given an advice to use interrupts, but i'm not quite familiar with it yet. Hopefully someone to help me on this.

best regards
 

Do work out as the information given in the datasheet for the controller you are using & check for the library functions in mikroC that make your work easier.
Regards,
Jerin. :)
 
Initialise as:
Select clock source
Assign PSA
Put Prescalar
Enable tmr0 interrupt
reset TMR0IF
enable global interrupt
Write the value u calulated as sampling period at TMR0 like TMR0=x;

at main
call ur funtion if bit at isr is set

at isr
if TMR0IF==1
//set a bit to call the function you want, don't write the whole code here
TMR0IF=0
TMR0=x; //again
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top