generating short pulses
Posted: Wed Feb 13, 2013 12:53 pm
>from the help line
>The requirement is to generate a 1uS pulse on a port pin. Is there a way to
decrease the timer period from 1uS to a value that will give increased
resolution in order to generate the required 1uS pulse?
In all the HWPWM.bas files there is a variable called prescale, which is used to
set the smallest increment of a pulse, which is 1 microsecond. This has a value
of 15, 24 or 48 depending on the CPU and whether the peripheral bus is running
at 15, 24 or 48 MHz.
The code already adjusts the prescaler for cycle times greater than 10
miliseconds.
In your case you want to make it shorter. So make the prescaler smaller and
adjust your time constants accordingly.
>The requirement is to generate a 1uS pulse on a port pin. Is there a way to
decrease the timer period from 1uS to a value that will give increased
resolution in order to generate the required 1uS pulse?
In all the HWPWM.bas files there is a variable called prescale, which is used to
set the smallest increment of a pulse, which is 1 microsecond. This has a value
of 15, 24 or 48 depending on the CPU and whether the peripheral bus is running
at 15, 24 or 48 MHz.
The code already adjusts the prescaler for cycle times greater than 10
miliseconds.
In your case you want to make it shorter. So make the prescaler smaller and
adjust your time constants accordingly.