PDA

View Full Version : I try PAUSE 1000 and does'nt seem to pause program 1 seconds. Why?



luxornet
- 27th October 2014, 17:18
For large amount of time, Pause does'nt seem to work well, the measured period is less than I expected.


main:
high Led
For i = 1 to 30
pause 100
next i
low Led
for i = 1 to 30
pause 100
next i
goto main

Above code produced about 1Hz on Led pin and not 1/6Hz!

rsocor01
- 27th October 2014, 17:29
For large amount of time, Pause does'nt seem to work well, the measured period is less than I expected.


main:
high Led
For i = 1 to 30
pause 100
next i
low Led
for i = 1 to 30
pause 100
next i
goto main

Above code produced about 1Hz on Led pin and not 1/6Hz!

You are pausing for 3 seconds instead of 1 second.

HenrikOlsson
- 27th October 2014, 18:27
What's the oscillator frequency and have you used DEFINE OSC xx to inform the compiler OF that oscillator frequency?

/Henrik.

luxornet
- 27th October 2014, 18:35
I tried with 8MHz resonator and DEFINE OSC 8.
The LCD attached to PIC display data properly and all other thing work well.
Somebody else tried large PAUSE?

HenrikOlsson
- 27th October 2014, 19:00
Yes, many many many times and never ever have I had an issue.
Which chip?
What version of PBP?
Are you using the default CONFIG?

/Henrik.

rsocor01
- 27th October 2014, 19:05
I didn't read the last sentence of your first post. Yes, besides DEFINE OSC 8, you might need to check on other registers related to the PIC frequency. Does your chip uses the OSCCON register? What chip are you using?

Archangel
- 28th October 2014, 06:08
What's the oscillator frequency and have you used DEFINE OSC xx to inform the compiler OF that oscillator frequency?

/Henrik.
. . . and be sure your define is in ALL CAPITAL LETTERS as Henrik posted, lower case will not work.