I try PAUSE 1000 and does'nt seem to pause program 1 seconds. Why?
For large amount of time, Pause does'nt seem to work well, the measured period is less than I expected.
Code:
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!
Re: I try PAUSE 1000 and does'nt seem to pause program 1 seconds. Why?
Quote:
Originally Posted by
luxornet
For large amount of time, Pause does'nt seem to work well, the measured period is less than I expected.
Code:
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.
Re: I try PAUSE 1000 and does'nt seem to pause program 1 seconds. Why?
What's the oscillator frequency and have you used DEFINE OSC xx to inform the compiler OF that oscillator frequency?
/Henrik.
Re: I try PAUSE 1000 and does'nt seem to pause program 1 seconds. Why?
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?
Re: I try PAUSE 1000 and does'nt seem to pause program 1 seconds. Why?
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.
Re: I try PAUSE 1000 and does'nt seem to pause program 1 seconds. Why?
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?
Re: I try PAUSE 1000 and does'nt seem to pause program 1 seconds. Why?
Quote:
Originally Posted by
HenrikOlsson
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.