Pumpkin, Inc.

Pumpkin User Forums

Not able to generate the OS delay

For issues specific to Microchip's PICmicro® MCUs, including compilers (e.g. HI-TECH PICC & PICC-18, Microchip MPLAB®-C18) and IDEs (e.g. Microchip MPLAB®).

Not able to generate the OS delay

Postby Ravi » Mon Jun 07, 2004 7:32 am

I am using a PIC 18F6720 Mcu and I am not able to generate the delays using OS_Delay()
function.The timer reload value is 20 which I have calculated for my microcontoller and it has to give a delay of 1 Sec.And along with this Delay I am also using the OS_Timer() to poll for every 3 Sec and it is not happening.
Can u suggest me on this.
Posts: 1
Joined: Sun Jun 06, 2004 11:00 pm
Location: dubai

Re: Not able to generate the OS delay

Postby aek » Mon Jun 07, 2004 8:03 am

Hi Ravi.

You need to ensure that OSTimer() is truly being called every system tick in order for OS_Delay() to work.

Nearly all OS_Delay()-related problems are from users failig to setup their ISR properly so that OSTimer() is called at the proper rate (over and over).

I don't quite understand what you're trying to achieve, but for a 1s delay via OS_Delay(), you could for example call OSTimer() every 20ms, and then do OS_Delay(50).


Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 1 guest