This directory contains a description of the /dev entries for the octal PWM output peripheral. HARDWARE The octal PWM output peripheral drives eight output pins with a square wave of independently programmable frequency and duty cycle. The device node .../pwmout0 corresponds to pin 2 on the BaseBoard connector. Pin 16 is controlled by .../pwmout7. Pulse widths are measured with 16 bits of accuracy for both the high and low periods of a pulse. The clock source driving the pulse width counters ranges from 5 Hertz to 20 MegaHertz. DEVICE NODES The eight outputs each have a separate device node to accept the pulse low and high times. There is a device node to specify the controlling clock frequency and another node that has the raw data that is sent to the peripheral. The frequency of the clock that drives the width counters. A clock frequency of zero turns off the peripheral. The frequency is given in Hertz and must be one of the following: 20000000 10000000 5000000 1000000 5000000 1000000 500000 100000 50000 10000 500 100 50 10 5 0 .../waveform The clock frequency followed by a comma separated list of values and times between transitions for all eight outputs. The values alternate between the eight bit value at the output (in hex) and how long that value (in clock cycles) is to be held. The raw sample data conveys the relative timing for each output. As an example, consider the following ASCII art timing diagram: |++++|++++|++++|++++|++++|++++|++++|++++|++++|++++| __________|---------|______________________________ pwmout0 ______________________________|---------|__________ pwmout1 _______________|----|______________________________ pwmout2 ______________________________|----|_______________ pwmout3 v v v v v v v 0 1 5 0 a 2 0 Value ----10------5----5-------10-----5----5-------10---- Interval The initial value, 0000, is indicated by the first 'v' on the above line. The first time is the interval between the first v and second. The second value is 0001 and the second interval time is the time between the second and third v's. If each tick mark is 1 microsecond then the above pattern could be generated with the following input string: 1000000,0,10,1,5,5,5,0,10,a,5,2,5,0,10