Pulse generation

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

Pulse generation

Post by YahooArchive »

I have a simple 'C' program running on an Armmite board. It measures the period
between External Interrupts, multiplies that period by a factor, and sets a
HWPWM channel to run at the new rate.

I need to Bench Test the system, since it's a logistic problem to setup and
modify the Armmite program in it final application.

Can I simply generate a square wave on pin 15 or other output pin in the main
loop, and loop it back to my external interrupt input (pin 11)?

The output from the HWPWM should then be the generated square wave frequency
divided by the multiplication factor.



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

Re: Pulse generation

Post by YahooArchive »

> Can I simply generate a square wave on pin 15 or other output pin in the main
loop, and loop it back to my external interrupt input (pin 11)?
>

This should work fine, you will have a little interference from the interrupt
routine overhead, but if the pulse trains are relatively slow it should be OK.

Another way to do it is to use another HWPWM to generate that square wave.
While we haven't written a version in C, you could look at the HWPWM.bas library
to see how to control HWPWM with 2 different frequencies.

Also rather than a pin interrupt, you could use the CAPTURE features of the
timer to monitor the incoming waveform. Details on this in the NXP user manual,
its pretty straightforward, you can capture a running counter on each rise of a
CAP input.

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

Re: Pulse generation

Post by YahooArchive »

I can't use the Capture function because my Input Signal may have some ringing,
and could give me a false reading. The External Interrupt can be disabled for a
few milliseconds after initiation in software until the ringing subsides. It can
act like a low pass filter.

I should be able to begin Bench Testing tonight.

Post Reply