PDA

View Full Version : PAUSEUS Using a 16MHz Oscillator



rsocor01
- 21st September 2013, 06:49
Hi,

I am sure this question or a similar one has been posted before, but I can't find it. I'm using a 16 MHz internal oscillator and according to the 2.60 PBP manual the minimum pause I can get is 5us. Now, to obtain a shorter delay the manual recommends using ASM....ENDASM. Can somebody enlight me on how to do this?

Thank you,

Robert

HenrikOlsson
- 21st September 2013, 07:23
Hi,
At 16MHz one instruction cycle is 250ns. To get 1us delay you could do

ASM
NOP
NOP
NOP
NOP
ENDASM
Any longer and you'd probably set up a loop or use some other tricks.

/Henrik.

rsocor01
- 21st September 2013, 07:31
Nice!

Can I use this ASM code inside a IF....ENDIF condition? For example,

IF something

ASM
NOP
NOP
NOP
NOP
ENDASM

ENDIF

HenrikOlsson
- 21st September 2013, 08:07
Yes, of course you can.

rsocor01
- 21st September 2013, 20:34
Thanks. I'll try that.

Acetronics2
- 22nd September 2013, 13:06
just think the IF ... ENDIF will take some time ... ( especially if "something" is a complex expression ) ...

Alain

dw_picbasic
- 10th October 2013, 22:17
This might be a great opportunity to utilize an O-scope :-]
Have fun!