TME-EPIC-HURLX-R3V5.docx
Rev 3.5
Page 45 of 49
4.6
PWM Outputs
Programming the PWM outputs works the same way as using GPIOs or Analog inputs.
Enter configuration mode and switch to logical device 7 (via 2Eh/2Fh).
Enable PWM outputs by setting
-
Bit 6 of register 27h to ‘0’ (SIO_PWM2)
-
Bit 1 of register 29h to ‘0’ (SIO_PWM3)
-
Bits 3 and 4 of register 2Ch to ‘1’ (S5, GPIOs 24+25 will not be longer available)
Enable channels 1-3 by programming the following registers via LPC-Bus (295h/296h):
-
Bits 2,1 and 0 of register 13h to ‘1’
-
Bits 2,1 and 0 of register 14h to ‘1’
Set the global frequency by programming bits 6-4 of register 14h via LPC-Bus (295h/296h):
Bits 6, 5, 4
PWM frequency
000
375.000 KHz
001
187.500 KHz
010
93.750 KHz
011
62.500 KHz
100
46.875 KHz
101
23.430 KHz
110
11.700 KHz
111
5.870 KHz
Set Bit 3 of register 14h to ‘0’ to allow duty cycles between 0...100%. (PWM/128*100%)
Duty cycles can be set different for each PWM channel by programming an 8 Bit value to registers16h for channel
2, 17h for channel 3, 88h for channel 4 and 89h for channel 5.