با استفاده از یکدستور در کمپایلر PIC BASIC PRO شما براحتی میتونید پالسهای دقیق داشته باشید .
PULSOUT
Syntax
PULSOUT Pin , Period, { Initial State
Overview
Generate a pulse on Pin of specified Period. The pulse is generated by toggling the pin twice, thus the initial state of the pin determines the polarity of the pulse. Or alternatively, the initial state may be set by using HIGH-LOW or 1-0 after the Period. Pin is automatically made an output.
Operators
Pin is a Port.Pin constant that specifies the I/O pin to use.
Period can be a constant of user defined variable. See notes.
State is an optional constant (0 or 1) or name HIGH - LOW that specifies the state of the outgoing pulse.
Example
' Send a high pulse 1ms long (at 4MHz) to PORTB Pin5
LOW PORTB.5
PULSOUT PORTB.5 , 100
' Send a high pulse 1ms long (at 4MHz) to PORTB Pin5
PULSOUT PORTB.5 , 100 , HIGH
Notes
The resolution of PULSOUT is dependent upon the oscillator frequency. If a 4MHz oscillator is used, the Period of the generated pulse will be in 10us increments. If a 20MHz oscillator is used, Period will have a 2us resolution. Declaring an XTAL value has no effect on PULSOUT. The resolution always changes with the actual oscillator speed.