PWM Module
The SBC65EC has 4 PWM (Pulse Width Modulator) channels that can be configured, controlled and monitored via
PWM Commands and
PWM Tags. An example use for the PWM Channels will be to create a variable DC output voltage. This could for example be used to dim a light.
To use the PWM Module, the following has to be done:
-
Set the desired PWM channel as an output via the Web interface (on "Port Settings" page). This can also be done via Commands. The SBC65EC has 4 PWM channels, C1, C2, G0 and G3.
-
Enable the desired PWM channels with the "we=xx" command. Each bit in the "xx" part represents a PWM channel. For example, to enable all 4 channels via the HTTP GET Method (with default board NetBIOS name of mxboard), type the following into a web browser "http://mxboard/?we=0f". To issue this command via UDP, send the following UDP message to port 54123 of the board "we=0f".
-
Set the PWM value for the enabled channel with the "wn=value" command. The value is a value from 0-1023, where 0 is 0% duty cycle, and 1023 is 100% duty cycle. For example, to set the duty cycle of channel 1 (C1) to 512 (50%) via the HTTP GET Method (with default board NetBIOS name of mxboard), type the following into a web browser "http://mxboard/?w1=512". To issue this command via UDP, send the following UDP message to port 54123 of the board "w1=512"
Additionally the PWM module can be configured for 8-bit or 10-bit mode. Default is 10-bit mode.
-
For 8-bit mode, the PWM frequency can be set to 9.766kHz, 39.062kHz, or 156.25kHz. The Value for 8-bit mode is a value between 0-255, which corresponds to a duty cycle between 0% and 100%.
-
For 10-bit mode, the PWM frequency can be set to 2.441kHz, 9.766kHz, or 39.062kHz. The Value for 10-bit mode is a value between 0-1023, which corresponds to a duty cycle between 0% and 100%.