WiCard GPIO (+Tutorial Video)

WiCard - Smart Programmable WiFi Controller Module

WiCard GPIO (+Tutorial Video)

wicard gpio toggle

WiCard GPIO (General Purpose Input Output)

There are 22 lines of the pins available for the user to program. 20 of these lines can be set as logical input (GPI) and interrupt (PCInt). Furthermore 19 of them can be set as logical output (GPIO).

PINPort BitInputOutput
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 is almost equal with the VCC (3.3V) and the output low level is equal with Ground (0V).

The input high level must be more than 2.6V, and the input low level must be less than 0.3V.

 

Setting pin as output

To setting pins as output, there is a PCI function. The “SetPinsAsOutput(uiArg)” function has a 32bit argument. Furthermore the argument determines which PortBit should be set as output with logical “1”. Another port bits will remain unchanged. For example to setting the A03 pin (PortBit 0) as an output, the argument should be “0x00000001”, which the first bit in the argument is logical “1”.

Example:

main()
{
    SetPinsAsOutput(0x1);
}

The “SetPortLatch(uiArg)” function puts the pin of the port bit which is logical “1” in the logical high level. Another pins will remain unchanged.

Example:

main()
{
    SetPinsAsOutput(0x1);
    SetPortLatch(0x1);
}

The “ClearPortLatch(uiArg)” function puts the pin of the port bit which is logical “1” in the logical low level. Another pins will remain unchanged.

Example:

main()
{
    SetPinsAsOutput(0x1);
    ClearPortLatch(0x1);
}

The “WritePortLatch(uiArg)” function puts the pin of the port bit which is logical “1” in the logical high level. Furthermore the port bits which are logical “0” will change into low level voltage.

Setting pin as input

To setting pins as input, there is a PCI function. The “SetPinsAsInput(uiArg);” function has a 32bit argument. The argument determines which PortBit should be set as input with logical “1”. Another port bits will remain unchanged. For example to setting the A03 pin (PortBit 0) as an input, the argument must be “0x00000001”, which the first bit in the argument is logical “1”.

Example:

main()
{
    SetPinsAsInput(0x1);
}

The “SetPortLatch(uiArg)” function connects an internal pull up resistor (about 20KOhm) to the input pin of the port bit which is logical “1”. Another GPIO pins will remain unchanged.

Example:

main()
{
    SetPinsAsInput(0x1);
    SetPortLatch(0x1);
}

The “ClearPortLatch(uiArg)” function disconnects the internal pull up resistor for the input pins and puts the pin of the port bit which is logical “1” in the tri-state (HiZ). Another GPIO pins will remain unchanged.

Example:

main()
{
    SetPinsAsInput(0x1);
    ClearPortLatch(0x1);
}

 

Tutorial Videos

The following videos will show you how to set WiCard’s pins as output with “Toggle Button” and “Push Button”. For example in these videos we have used Pin A03 (Port Bit 0) as the output. So here’s the schematic:

wicard gpio toggle push pwm

 

Toggle Button

Push Button

 

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.

 

 

One Response

Leave a Reply

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

17 − six =