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).

PIN Port Bit Input Output
A01 VCC 3.3v
A02 Ground
A03 0 * *
A04 1 * *
A05 2 * *
A06 3 * *
A07 4 * *
A08 5 * *
A09 6 * *
A10 7 *
A11 16 * *
A12 17 * *
A13 18 * *
A14 19
A15 25
B01 24    
B02 23
B03 22 * *
B04 21 * *
B05 20 * *
B06 15 * *
B07 14 * *
B08 13 * *
B09 12 * *
B10 11 * *
B11 10 * *
B12 9
B13 8
B14 Ground
B15 VCC 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 *

fourteen + seven =