
Hercules-EBX CPU User Manual V1.02
Page 104
BIT7 = 1;
Indicates PWM configuration byte
PWM0-1 = 2;
Program PWM output 2
CLK = 0;
Use the 10MHz reference clock
POL = 1;
Active state = high (PWM will be high for the 25% duty cycle)
OUTEN = 1;
Enable PWM output
ENAB = 1;
Enable PWM circuit
From these settings we get a configuration byte of 0xA7 (see page 73 for register description.)
outp(base + 0, 1);
//Set page 1 (for PWM functions)
outp(base + 27, 0xA7);
//Configure and enable PWM output 2
f) Finally, to enable PWM outputs (replacing Digital I/O Port E, bit3-0 : see page 96), set
DIOCTR0 = 1, leaving the rest of the Configuration Register as-is:
Data = inp(base + 12);
// Read current Configuration Register settings
Data = Data || 0x10;
// Set DIOCTR0 = 1, forcing PWM3-0 onto DIO
outp(base + 12, Data);
// Write settings back to Configuration Register
At this point, a 1KHz signal with a 25% high duty cycle will be present on PWM output 2 (J8 – pin
35).
Содержание HERCULES-EBX HRC400-5A128
Страница 9: ...Hercules EBX CPU User Manual V1 02 Page 9 3 HERCULES BOARD DRAWING...
Страница 118: ...Hercules EBX CPU User Manual V1 02 Page 118 Figure 14 Hercules EBX Cable Kit...
Страница 121: ...Hercules EBX CPU User Manual V1 02 Page 121...
Страница 123: ...Hercules EBX CPU User Manual V1 02 Page 123...