Timing methods during runtime

Here you can ask for specific code examples and discuss about it with other forum members.
Post Reply
Author
Message
Nemena
Posts: 203
Joined: 07 Mar 2005 20:32
Location: Hungary

Timing methods during runtime

#1 Post by Nemena » 26 Apr 2012 07:29

Hello all!

I have a project (I'm using mikromedia for PIC32 board), where I need a 10-second accurate timer.
This unit monitors current, and when a preset value is reached (80mA) it starts a 10s timer, displays every second (10,9,8,7,6...), and displays the measured current as well.
If I use software timer (delay_ms) and increment a counter with it, so I am able to read the adc values during the "count back" as well, I need to add the time I need for the adc_read, displaying functions. So this is not accurate.
If I use timer1 interrupt, the display gets messed up, or even freezes.
Does anyone have idea how I could solve this project the best way?
Or does anyone have a similar project?
Thank you in advance:
Nemena

Post Reply

Return to “Code Requests”