BL4S200 User’s Manual
58
•
PPM.C
—Demonstrates the use of four PPM channels on the configurable I/O pins
DIO0, DIO2, DIO4, and DIO6 on connector J10. The PPM signals are set for a
frequency of 200 Hz, with the duty cycle adjustable from 0 to 100% and an offset
adjustable from 0 to 100% by the user. These pins can be connected to an oscilloscope
to view the waveform being generated. The overall frequency can be adjusted in the
#define PPM_FREQ
line. Follow these instructions when running this sample program.
1. Verify that the jumper on header JP9 is in the default position across pins 3–4 for +5 V pullup.
2. Connect the oscilloscope probe to the configurable I/O pins on connector J10. Remember to
connect the oscilloscope ground to GND on connector J10.
Change the duty cycle and offsets for a given PPM channel via the Dynamic C
STDIO
window and watch the change in waveforms on the oscilloscope. Signals on DIO0
(PPM00) and DIO2 (PPM01) will all be synchronized with each other as they share the
same overall counter block that sets the cycle frequency. The same is true for PPM sig-
nals on DIO4 (PPM02) and DIO6 (PPM03). The two blocks may have a phase shift
from each other, but will run at the same frequency.
•
PULSE_CAPTURE.C
—Demonstrates the use of two input capture inputs tied to PPM
channels on the configurable digital I/O pins on connector J10. The input capture feature
allows the begin and end positions of a pulse to be measured in a given time window.
We take advantage of the counter synchronization feature of the underlying Rabbit RIO
chip to create capture windows and pulse modulation windows that are synchronized.
This guarantees that we always catch the begin edge first on a quickly repeating wave-
form. This was done to create an interactive element to this sample program, but cap-
turing real-world repetitive signals will usually not have this advantage. Refer to
Section 3.2.1.3 for more information on how to use the input capture.feature. Follow
these instructions when running this sample program.
Once the connections have been made, compile and run this sample program. Change
the offset and duty cycle for a given PPM channel via the Dynamic C
STDIO
window
and watch the change to the begin and end counts measured on the input capture inputs.
The PPM frequency can be changed in the
#define PPM_FREQ
line.
•
PWM.C
—Demonstrates the use of the eight PWM channels on configurable I/O pins
DIO0–DIO7. The PWM signals are set for a frequency of 200 Hz with the duty cycle
adjustable from 0 to 100% by the user. These pins can be connected to an oscilloscope
to view the waveform being generated. The overall frequency can be adjusted in the
#define PWM_FREQ
line. Follow these instructions when running this sample program.
1. Verify that the jumper on header JP9 is in the default position across pins 3–4 for +5 V pullup.
2. Connect the oscilloscope probe to the configurable I/O pins on connector J10. Remember to
connect the oscilloscope ground to GND on connector J10.
1. Connect digital I/O pins DIO0 and DIO1 together.
2. Connect digital I/O pins DIO4 and DIO5 together.
3. Connect the oscilloscope ground to GND on connector
J10.
4. Use the oscilloscope probes on the DIO0 and the DIO1
pair or the DIO4 and DIO5 pair to view the PPM signals.
2
7
8
3
9
4
6
1
5
10
GND
DIO1
DIO5
DIO0
DIO4
J10
Oscilloscope
GND
electronic components distributor