PULSOUT on 20X2

techElder

Well-known member
Syntax:
PULSOUT pin,time
Effect of Increased Clock Speed:

4MHz10us unit
8MHz5us unit
16MHz2.5us unit
32MHz1.25us unit
64MHz0.625us unit
Am I to assume that the 20X2 has a base PULSOUT time of 5us since its base clock speed is 8 MHz? So, all changes in clock speed are base on that 8 MHz value?

The docs are clear in other places, such as PAUSE, but the base time starts at the same time value as the 4 MHz setting in the case of PAUSE.
 

hippy

Technical Support
Staff member
Am I to assume that the 20X2 has a base PULSOUT time of 5us since its base clock speed is 8 MHz?
Yes, PULSOUT will be 5us unit lengths at 8MHz.

So, all changes in clock speed are base on that 8 MHz value?
It's all relative to the 4MHz, 8MHz and 16MHz values in fact.

The docs are clear in other places, such as PAUSE, but the base time starts at the same time value as the 4 MHz setting in the case of PAUSE.
For most commands their time units are based on running at 4MHz. So a PULSOUT 1 on an M2 which runs at 4MHz by default will last 10us. On an X2 which runs at 8MHz by default it will last 5us. Likewise PULSIN, HSERSETUP, etc times are based on 4MHz.

The PAUSE command timing isn't however based on 4MHz, its has absolute millisecond timing. This is so "PAUSE 1000" means one second no matter which chip one is using.

But effectively this does mean it's based on 4MHz for the M2 and based on 8MHz for the X2.
 

techElder

Well-known member
So, what you are saying is that everything is different except the ones that you say are different, but then they aren't really different either? :D
 

hippy

Technical Support
Staff member
Most are based on 4MHz, others are based on the default frequency the particular chip runs at.
 
Top