Page 1 of 1

generating short pulses

Posted: Wed Feb 13, 2013 12:53 pm
by YahooArchive
>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.

Re: generating short pulses

Posted: Wed Feb 13, 2013 12:54 pm
by YahooArchive
FYI - HWPWM11.bas says it runs at 25Mhz

prescale = 25 ' (CCLK/PBSD/1000000) as the peripherals run at 25 MHz

Re: generating short pulses

Posted: Wed Feb 13, 2013 12:54 pm
by YahooArchive
48 is the correct pre-scale value for the LPC1114 in the BASICchip. It was
corrected in the install package a week or 2 ago.

Re: generating short pulses

Posted: Wed Feb 13, 2013 1:29 pm
by YahooArchive
COUNTER.bas has been added to the files section here, and is also part of a new
BASICtools set of utilities.

This example shows a sample using the counter hardware for most of the Coridium
boards.

BASICtools has also been updated to handle COM port switching, and switching
board types. This has to do with the #define LPCxxxx that is added to the start
of each compiled BASIC program that is set by the tools querying the board
vectors.