WiCard PWM (+Tutorial Video)

WiCard - Smart Programmable WiFi Controller Module

WiCard PWM (+Tutorial Video)

wicard pwm slider

WiCard PWM (Pulse Width Modulator)

The WiCard has 19 PWM lines which are able to be set at the same time. The following table shows which pins are able to be set as PWM:

PINPortBitPulse Width Modulator Output
A01VCC 3.3v
A02Ground
A030*
A041*
A052*
A063*
A074*
A085*
A096*
A107
A1116*
A1217*
A1318*
A1419
A1525
B0124 
B0223
B0322*
B0421*
B0520*
B0615*
B0714*
B0813*
B0912*
B1011*
B1110*
B129
B138
B14Ground
B15VCC 3.3v

 

The high output level of output pulse is almost equal with the VCC (3.3V) and the low level of output pulse is equal with Ground (0V).

 

Setting PWM Channels

The “SetPinAsPWM(ucChannel, ucLowTime, ucHighTime)” function sets the channel as PWM. The first argument is the channel number (PortBit number),  the second argument is the time of low level voltage of the pulse modulator channel, and the third argument is the time of high level voltage of the pulse modulator channel. The unit of the times is milliseconds and the range of timers is 0-255.

Example:

main()
{
    SetPinAsPWM(1, 200, 200);
}

 

The Slider:

In our simulator we put a slider to setting the pins as PWM channels automatically. To using sliders, drag and drop the slider into the control box. Then double click it.

wicard pwm slider simulator

Select the pin that you want to set as PWM channel. Then Set the PWM Times (The unit is mS):

wicard pwm slider simulator 12

For example if you set 1 as start on time, 4 as end on time, 4 as start off time and 1 as end of time, the slider level and PWM will be like this:

0 (Level of the slider is equal with 0): 0 mS on and 255 mS off (Always off) – “On” means output 1 – “Off” means output 0.

1: 1 mS on and 4 mS off (200Hz, also 20% duty cycle).

2: 1 mS on and 3 mS off (250Hz, also 25% duty cycle).

3: 1 mS on and 2 mS off (333Hz, also 33% duty cycle).

4: 1 mS on and 1 mS off (500Hz, also 50% duty cycle).

5: 2 mS on and 1 mS off (333Hz, also 66% duty cycle).

6: 3 mS on and 1 mS off (250Hz, also 75% duty cycle).

7: 4 mS on and 1 mS off (200Hz, also 80% duty cycle).

 

Tutorial Video:

This video shows you how to use slider and set the PWM channels:

Here’s the schematic of the circuit in the video:

wicard gpio toggle push pwm

 

To downloading the plans, schematics and firmware, please refer to: https://trial.wicard.net

Also to finding out another stuff about WiCard WiFi Module, please refer to our home page and blog.

 

4 Responses

  1. Mike says:

    Greetings, I do believe your blog could possibly be having
    browser compatibility problems. Whenever I take a look at your blog in Safari, it looks fine however,
    if opening in IE, it has some overlapping issues. I simply wanted to give you a quick heads up!
    Apart from that, fantastic site!

  2. Soon says:

    Normally I do not learn post on blogs, however I would like to
    say that this write-up very compelled me to take a look at and do
    so! Your writing style has been surprised me. Thanks, quite nice
    post.

Leave a Reply

Your email address will not be published. Required fields are marked *

ten − 7 =