generating short pulses

Questions on other types of hardware and getting it talking to the ARM CPU
Post Reply
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

generating short pulses

Post 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.



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: generating short pulses

Post by YahooArchive »

FYI - HWPWM11.bas says it runs at 25Mhz

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

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: generating short pulses

Post 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.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: generating short pulses

Post 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.
Attachments
COUNTER.bas
(2.27 KiB) Downloaded 1167 times

Post Reply