to Technical: resolution of pulsout vs. pauseus; hardware interrupts

womai

Senior Member
I have to say I am more than eager to try out the new 28X2 and especially the big surprise, the 20X2. Two questions beforehand:

(1) the Basic manual states that the timing resolution of the pauseus command is 10 us at 4 MHz for the X1 parts, but 10us at 8 MHz for the X2 parts. So I assume the minimum achievable resolution on the 20X2 when running at 64 MHz is 1.25 us, correct? Now the manual does not indicate such a difference between X1 and X2 devices for the pulsout command. Is that a mistake, or is the pulsout resolution on the 20X2 really 10 us at 4 MHz and thus 0.625 us at 64 MHz?

(2) the manual says the hardware interrupts on the X2 parts is not a polled interrupt. Does that mean it will predictably call the interrupt routine with no more than 1 instruction cycle of jitter? The "old style" interrupts had a lot of jitter because the polling period is rather long, meaning that the reaction time to an interrupt could vary considerably (I do not care about the absolute reaction time, but just about the maximum variation). I tried hardware interrupts on a "real" PIC16F88 at 20 MHz and indeed in that case the interrupt routine got called with a jitter of just 0.2us.

Wolfgang
 

hippy

Ex-Staff (retired)
1) This took a while for me to get my head round at first.

Most commands are normalised to run at the 8MHz default operating speed of the X2 so, if you want a 1000ms pause, use PAUSE 1000, same on an 8MHz X2 as it would have been on a 4MHz X1.

For a few others, they can be thought of as remaining normalised for 4MHz operation ( so run twice as fast at 8MHz as they did at 4MHz as is the case when using an X1 ), or that they have twice the resolution.

A "PAUSEUS 1" on a 4MHz X1 will be a 10us pause, and "PAUSE 1" on an 8MHz X2 will be a 10us pause, when under-clocked to 4MHz it will become a 20us pause, when over-clocked to 16MHz a 5us pause, at 32MHz it is 2.5us, and at 64MHz will be 1.25us.

A "PULSOUT pin,1" on a 4MHz X1 will be a 10us pulse, on an 8MHz X2 it will be a 5us pulse, at 16MHz it is 2.5us, 32MHz it is 1.25us and 1t 64MHz is is 62.5ns.

2) Interrupt operation is the same on X2's as for X1's, with the addition of the hardware interrupt feature.

Hardware interrupts are a two part thing; first the hardware is set to detect rising or falling edges of certain pins which then set user accessible flags, secondly the firmware is told to interrupt when those flags have been set.

The flags get set the instant the pins change but the interrupt will not occur until the current command completes. It is akin to using an external latch to stretch an incoming interrupt signal on a non-X2. The interrupt response time ( latency ) will therefore continue to vary depending upon which command was being executed when the interrupt is triggered.
 
Top