PDA

View Full Version : Timing verification.



Dwayne
- 31st August 2004, 04:35
Hello folks,

I would like to have a quick verifcation on a program, or is it me missing a link in my head?

The following program uses a pauseus statement
If I use Pauseus 1, it has 28 micosecond delay between spikes.
If I use Pauseus 5, it has 28 Microsecond delay between spikes.
If I use Pauseus 3, it has 30 Microsecond delay between spikes.
If I use Pauseus 10, It has a 28 Microsecond delay between spikes.

If I use a PAUSE 1 it has a 1 millisecond delay (which is good)

I probably have a screw loose upstairs that is baffling me on this situaion, and I have not figured it out yet.


Here is the complete code to simulate this senario:

@ DEVICE PIC12F675,INTRC_OSC_NOCLKOUT,WDT_ON,PWRT_OFF,BOD_O N,PROTECT_OFF,CPD_OFF,MCLR_OFF

CMCON=%00001000
TRISIO=%00000000


Loop:
GPIO=%00000001
GPIO=%00000000
pauseus 1 'replace this with the numbers mentioned above
GOTO Loop
end

carl_schell
- 31st August 2004, 05:45
Hi Dwayne -

I would guess it might be related to resolution. The pbp manual says thet the minimum delay for lets say a 4 MHz resonator to your pic is about 24 micro seconds....so when you ask for less...you are asking for too short of a pause....switching to a 20 MHz resonator should increase your resolution down to 3 micro seconds.

Best Regards,

Carl

-------

PIC Development Boards with bootloader
www.schellelectronics.com

Novi, Michigan, USA

Melanie
- 31st August 2004, 08:15
@ NOP

Insert for 1uS Delay at 4MHz, 500nS delay at 8MHz etc etc.

Dwayne
- 31st August 2004, 15:44
Hello Carl and Melanie,

Carl>>I would guess it might be related to resolution. The pbp manual says thet the minimum delay for lets say a 4 MHz resonator to your pic is about 24 micro seconds....so when you ask for less...you are asking for too short of a pause....switching to a 20 MHz resonator should increase your resolution down to 3 micro seconds. <<

Thanks a million both of you. I guess I was assuming too much <g>. I knew there had to be something going on... I was up too late last night working on a stupid project... thank goodness there is not a time limit. <g>

Dwayne