Difference between revisions of "Component: API (Interface Board) (API Slave Devices)"
(14 intermediate revisions by 2 users not shown) | |||
Line 14: | Line 14: | ||
==API (Interface Board) component== | ==API (Interface Board) component== | ||
Connects to an Interface Board running the API Firmware allowing the board to become a slave to the Flowcode Embedded simulation or Flowcode App Developer. Supports: Digital IO / ADC / I2C / SPI / PWM / UART / DAC / Servo See Instructables for open source project files. | Connects to an Interface Board running the API Firmware allowing the board to become a slave to the Flowcode Embedded simulation or Flowcode App Developer. Supports: Digital IO / ADC / I2C / SPI / PWM / UART / DAC / Servo See Instructables for open source project files. | ||
+ | |||
+ | ==Component Source Code== | ||
+ | |||
+ | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Interface_Board_Comp.fcfx FC_Comp_Source_Interface_Board_Comp.fcfx] | ||
+ | |||
+ | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Interface_Board_Comp.fcfx FC_Comp_Source_Interface_Board_Comp.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
+ | A board designed to allow PC access to embedded style electronic signals at 3V3 or 5V. | ||
+ | |||
+ | Includes: ADC / DAC / I2C / IO / Servo / SPI / UART | ||
+ | |||
+ | USB Firmware allows control via a USB connection. Works with a Windows PC but should also work with other USB master based devices. | ||
+ | |||
+ | WIFI Firmware allows control via a WIFI network connection. Works with any networked device including devices via the internet. WIFI connection requires the use of the UART peripheral and so this is not available for Slave functionality when using the WIFI firmware. | ||
+ | |||
+ | Board supplied with firmware as requested. Firmware can be changed using a PICkit 3 or PICkit 4 device or similar Microchip programmer. | ||
+ | To setup the WIFI to work with your own network you first need to power up the board using a USB connection or by applying a 5V power supply between the 5V and GND pins. Next connect to the WIFI network hosted by the board with the network name InterfaceBoard using password all in lowercase as the Password. Visit the website at page 192.168.4.1 and then enter your WIFI network details into the form provided. On clicking ok the board will store the details in none volatile memory and attempt to connect to your network and establish a local IP address. If all goes ok here then the Interface Board network should dissappear. | ||
+ | |||
+ | Refer to your router configuration page to see the IP address of the device. | ||
+ | |||
+ | If the WIFI network is not available then the board will revert back to it's setup mode allowing the network to be changed. Once network connection is available again the board will automatically reconnect. | ||
+ | |||
+ | The latest updates can be found on [https://github.com/RowlandTechnology/Interface-Board?fbclid=IwAR3rMT-68u1Q9deWpEar0Ewq8fB2wmS6cR1nGipBTVmb9xiaD29BcwVQPE8 github] | ||
− | |||
==Examples== | ==Examples== | ||
Line 32: | Line 53: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | ===Direct Slave Access=== | |
+ | |||
+ | Here is a simple demo to switch on and off digital pin 5. | ||
+ | |||
+ | |||
+ | {{Fcfile|SimpleIBDemo.fcfx|Simple Interface Board Demo}} | ||
+ | |||
+ | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == | + | ==Macro reference== |
+ | ===ADCSample10=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSample10''' | ||
+ | |- | ||
+ | | colspan="2" | Reads the voltage present on an Alanog pin as an 10-bit value range 0-1023 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | ADCChannel | ||
+ | |- | ||
+ | | colspan="2" | Range: 0-5 | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===ADCSample8=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ADCSample8''' | ||
+ | |- | ||
+ | | colspan="2" | Reads the voltage present on an Alanog pin as an 8-bit value range 0-255 | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | ADCChannel | ||
+ | |- | ||
+ | | colspan="2" | Range: 0-5 | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===I2CInitialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 110: | Line 155: | ||
+ | ===I2CReceive=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CReceive''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Receive a byte using the I2C bus |
|- | |- | ||
|- | |- | ||
Line 121: | Line 167: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
− | | colspan="2" | Channel Index: Range 0 - | + | | colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1 |
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | Last | ||
+ | |- | ||
+ | | colspan="2" | Last byte to receive: Range 0-1 | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90%" | | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
+ | |} | ||
+ | |||
+ | |||
+ | ===I2CRestart=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
− | | | + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] |
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CRestart''' | ||
|- | |- | ||
− | | | + | | colspan="2" | Put the I2C Module into Restart mode |
− | |||
|- | |- | ||
− | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Channel |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1 |
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 143: | Line 198: | ||
+ | ===I2CSend=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CSend''' |
+ | |- | ||
+ | | colspan="2" | Transmit a byte using the I2C bus | ||
+ | |- | ||
|- | |- | ||
− | | | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
+ | | width="90%" | Channel | ||
|- | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1 | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | DataOut |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] - | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===I2CStart=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CStart''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Put the I2C Module into Start mode |
|- | |- | ||
|- | |- | ||
Line 172: | Line 234: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
− | | colspan="2" | Channel Index: Range 0 - | + | | colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1 |
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===I2CStop=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CStop''' | ||
+ | |- | ||
+ | | colspan="2" | Put the I2C Module into Stop mode | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Channel |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 184: | Line 260: | ||
+ | ===I2CTransInit=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CTransInit''' |
+ | |- | ||
+ | | colspan="2" | Initialises the I2C Transaction mode with the 7-bit device address | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1 | ||
|- | |- | ||
− | | | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
+ | | width="90%" | DeviceAddress | ||
|- | |- | ||
+ | | colspan="2" | 7-bit Device Address | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Baud |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | 0=100KHz, 1=400KHz, 2=1MHz |
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===I2CTransReceive=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 230: | Line 318: | ||
+ | ===I2CTransSend=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''I2CTransSend''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Sends an I2C Transaction on the selected I2C channel. Returns the number of bytes sent. |
|- | |- | ||
|- | |- | ||
Line 241: | Line 330: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
− | | colspan="2" | Channel Index: Range 0 - | + | | colspan="2" | Channel Index: Range 0 - I2C Bus Count - 1 |
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | Data to send | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Count | ||
+ | |- | ||
+ | | colspan="2" | Number of bytes to send out, MS bit 0x8000 signifies no Stop if set | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===IOGetInputPin=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IOGetInputPin''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Sets the selected digital pin to an input and reads the input state. |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Pin |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Range: 0-17 |
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===IOSetOutputPin=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IOSetOutputPin''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Sets the selected digital pin to an output and assigns the output state. |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Pin |
+ | |- | ||
+ | | colspan="2" | Range: 0-17 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | State | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Range: 0-1 |
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 284: | Line 390: | ||
+ | ===Initialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Initialise the comms to the Arduino board ready for commands to be sent. |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] - | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===PWMDisable=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 315: | Line 423: | ||
+ | ===PWMEnable=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMEnable''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Enable a PWM output |
|- | |- | ||
|- | |- | ||
Line 326: | Line 435: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Range: 0-1 |
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 333: | Line 442: | ||
+ | ===PWMSetDuty8=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMSetDuty8''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Sets the duty for the PWM output |
|- | |- | ||
|- | |- | ||
Line 344: | Line 454: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Range: 0-1 |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Duty |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Range: 0-255 |
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===PWMSetPrescaler=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMSetPrescaler''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Sets the prescaler for the PWM output |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Prescaler |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
Line 397: | Line 485: | ||
+ | ===SPIInitialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPIInitialise''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Initialsie the SPI module ready for communications |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|- | |- | ||
Line 431: | Line 497: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
− | | colspan="2" | Range | + | | colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1 |
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 438: | Line 504: | ||
+ | ===SPIPrescaler=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 461: | Line 528: | ||
+ | ===SPITransfer=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPITransfer''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Transfer a byte using the SPI bus |
|- | |- | ||
|- | |- | ||
Line 472: | Line 540: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
− | | colspan="2" | Range | + | | colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1 |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | DataOut |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===SPITransferTrans=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SPITransferTrans''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Transfer an array of bytes using the SPI bus |
|- | |- | ||
|- | |- | ||
Line 508: | Line 564: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
− | | colspan="2" | Channel Index: Range 0 - | + | | colspan="2" | Channel Index: Range 0 - SPI Bus Count - 1 |
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Count | ||
+ | |- | ||
+ | | colspan="2" | Number of bytes to send and receive | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | DataOut |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Outgoing data |
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90%" | | + | | width="90%" | DataIn |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Incoming data |
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===ServoDisable=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoDisable''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Disable a Servo output |
|- | |- | ||
|- | |- | ||
Line 536: | Line 598: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Range: 0-5 |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 553: | Line 605: | ||
+ | ===ServoEnable=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoEnable''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Enable a Servo output |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Channel |
|- | |- | ||
− | | colspan="2" | Range: 0- | + | | colspan="2" | Range: 0-5 |
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 576: | Line 624: | ||
+ | ===ServoSetPosition8=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 599: | Line 648: | ||
+ | ===UARTBaud=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTBaud''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Control the communications rate of the UART module |
|- | |- | ||
|- | |- | ||
Line 612: | Line 662: | ||
| colspan="2" | Channel Index: Range 0 - UART Bus Count - 1 | | colspan="2" | Channel Index: Range 0 - UART Bus Count - 1 | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
+ | | width="90%" | Rate | ||
+ | |- | ||
+ | | colspan="2" | 0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200 | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===UARTCheckRX=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTCheckRX''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Check to see if the UART module has received any data |
|- | |- | ||
|- | |- | ||
Line 628: | Line 684: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
− | | colspan="2" | Channel Index: Range 0 - | + | | colspan="2" | Channel Index: Range 0 - UART Bus Count - 1 |
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===UARTInitialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTInitialise''' |
+ | |- | ||
+ | | colspan="2" | Initialise the UART module ready for communications | ||
+ | |- | ||
|- | |- | ||
− | | | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
+ | | width="90%" | Channel | ||
|- | |- | ||
+ | | colspan="2" | Channel Index: Range 0 - UART Bus Count - 1 | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===UARTReceive=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UARTReceive''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available. |
|- | |- | ||
|- | |- | ||
Line 659: | Line 722: | ||
| width="90%" | Channel | | width="90%" | Channel | ||
|- | |- | ||
− | | colspan="2" | Channel Index: Range 0 - | + | | colspan="2" | Channel Index: Range 0 - UART Bus Count - 1 |
|- | |- | ||
− | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | |
− | |||
− | |||
− | |||
− | |||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] - | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===UARTSend=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 694: | Line 753: | ||
+ | ===WIFIGetIP=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WIFIGetIP''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Gets the IP address of the board. Allows you to setup and get the assigned address via USB before using over WIFI, Use the WIFIIsConnected first to check the WIFI is active. |
|- | |- | ||
|- | |- | ||
− | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | |
− | |||
− | |||
− | |||
− | |||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===WIFIIsConnected=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WIFIIsConnected''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Checks to see if the WIFI is active and connected |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | |||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===WIFISetSSID=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WIFISetSSID''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Assign the SSID and password for the network you wish to connect the board to. Stores the parameters into ROM for later USB free setup. |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING |
− | | width="90%" | | + | | width="90%" | SSID |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Name of the network you wish to connect to |
|- | |- | ||
− | | width="10%" align="center | + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING |
− | | width="90%" | + | | width="90%" | Password |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
+ | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | |||
− | |||
Line 780: | Line 817: | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connection Properties | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
Line 785: | Line 826: | ||
|- | |- | ||
| colspan="2" | Allows the component to auto detect the interface board COM port. Requires the latest Flowcode serial comms DLL to function correctly. | | colspan="2" | Allows the component to auto detect the interface board COM port. Requires the latest Flowcode serial comms DLL to function correctly. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
Line 820: | Line 841: | ||
|- | |- | ||
| colspan="2" | Decides how the scan is terminated | | colspan="2" | Decides how the scan is terminated | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | API Peripherals | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
Line 860: | Line 885: | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Logging | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
Line 875: | Line 904: | ||
|- | |- | ||
| colspan="2" | Shows the raw data stream via a console window | | colspan="2" | Shows the raw data stream via a console window | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} |
Latest revision as of 10:17, 18 January 2024
Author | Matrix TSL |
Version | 1.0 |
Category | API Slave Devices |
Contents
- 1 API (Interface Board) component
- 2 Component Source Code
- 3 Detailed description
- 4 Examples
- 5 Macro reference
- 5.1 ADCSample10
- 5.2 ADCSample8
- 5.3 I2CInitialise
- 5.4 I2CReceive
- 5.5 I2CRestart
- 5.6 I2CSend
- 5.7 I2CStart
- 5.8 I2CStop
- 5.9 I2CTransInit
- 5.10 I2CTransReceive
- 5.11 I2CTransSend
- 5.12 IOGetInputPin
- 5.13 IOSetOutputPin
- 5.14 Initialise
- 5.15 PWMDisable
- 5.16 PWMEnable
- 5.17 PWMSetDuty8
- 5.18 PWMSetPrescaler
- 5.19 SPIInitialise
- 5.20 SPIPrescaler
- 5.21 SPITransfer
- 5.22 SPITransferTrans
- 5.23 ServoDisable
- 5.24 ServoEnable
- 5.25 ServoSetPosition8
- 5.26 UARTBaud
- 5.27 UARTCheckRX
- 5.28 UARTInitialise
- 5.29 UARTReceive
- 5.30 UARTSend
- 5.31 WIFIGetIP
- 5.32 WIFIIsConnected
- 5.33 WIFISetSSID
- 6 Property reference
API (Interface Board) component
Connects to an Interface Board running the API Firmware allowing the board to become a slave to the Flowcode Embedded simulation or Flowcode App Developer. Supports: Digital IO / ADC / I2C / SPI / PWM / UART / DAC / Servo See Instructables for open source project files.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Interface_Board_Comp.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Interface_Board_Comp.fcfx
Detailed description
A board designed to allow PC access to embedded style electronic signals at 3V3 or 5V.
Includes: ADC / DAC / I2C / IO / Servo / SPI / UART
USB Firmware allows control via a USB connection. Works with a Windows PC but should also work with other USB master based devices.
WIFI Firmware allows control via a WIFI network connection. Works with any networked device including devices via the internet. WIFI connection requires the use of the UART peripheral and so this is not available for Slave functionality when using the WIFI firmware.
Board supplied with firmware as requested. Firmware can be changed using a PICkit 3 or PICkit 4 device or similar Microchip programmer.
To setup the WIFI to work with your own network you first need to power up the board using a USB connection or by applying a 5V power supply between the 5V and GND pins. Next connect to the WIFI network hosted by the board with the network name InterfaceBoard using password all in lowercase as the Password. Visit the website at page 192.168.4.1 and then enter your WIFI network details into the form provided. On clicking ok the board will store the details in none volatile memory and attempt to connect to your network and establish a local IP address. If all goes ok here then the Interface Board network should dissappear.
Refer to your router configuration page to see the IP address of the device.
If the WIFI network is not available then the board will revert back to it's setup mode allowing the network to be changed. Once network connection is available again the board will automatically reconnect.
The latest updates can be found on github
Examples
Direct Slave Access
Here is a simple demo to switch on and off digital pin 5.
Macro reference
ADCSample10
ADCSample10 | |
Reads the voltage present on an Alanog pin as an 10-bit value range 0-1023 | |
- BYTE | ADCChannel |
Range: 0-5 | |
- UINT | Return |
ADCSample8
ADCSample8 | |
Reads the voltage present on an Alanog pin as an 8-bit value range 0-255 | |
- BYTE | ADCChannel |
Range: 0-5 | |
- BYTE | Return |
I2CInitialise
I2CInitialise | |
Initialsie the I2C module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BYTE | Baud |
0=100KHz, 1=400KHz, 2=1MHz | |
- VOID | Return |
I2CReceive
I2CReceive | |
Receive a byte using the I2C bus | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BOOL | Last |
Last byte to receive: Range 0-1 | |
- BYTE | Return |
I2CRestart
I2CRestart | |
Put the I2C Module into Restart mode | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- VOID | Return |
I2CSend
I2CSend | |
Transmit a byte using the I2C bus | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- BYTE | DataOut |
- BOOL | Return |
I2CStart
I2CStart | |
Put the I2C Module into Start mode | |
- BYTE | Channel |
Channel Index: Range 0 - I2C Bus Count - 1 | |
- VOID | Return |
I2CStop
I2CStop | |
Put the I2C Module into Stop mode | |
- BYTE | Channel |
- VOID | Return |
I2CTransInit
I2CTransReceive
I2CTransSend
IOGetInputPin
IOGetInputPin | |
Sets the selected digital pin to an input and reads the input state. | |
- BYTE | Pin |
Range: 0-17 | |
- BOOL | Return |
IOSetOutputPin
IOSetOutputPin | |
Sets the selected digital pin to an output and assigns the output state. | |
- BYTE | Pin |
Range: 0-17 | |
- BOOL | State |
Range: 0-1 | |
- VOID | Return |
Initialise
Initialise | |
Initialise the comms to the Arduino board ready for commands to be sent. | |
- VOID | Return |
PWMDisable
PWMDisable | |
Disable a PWM output | |
- BYTE | Channel |
Range: 0-1 | |
- VOID | Return |
PWMEnable
PWMEnable | |
Enable a PWM output | |
- BYTE | Channel |
Range: 0-1 | |
- VOID | Return |
PWMSetDuty8
PWMSetDuty8 | |
Sets the duty for the PWM output | |
- BYTE | Channel |
Range: 0-1 | |
- BYTE | Duty |
Range: 0-255 | |
- VOID | Return |
PWMSetPrescaler
PWMSetPrescaler | |
Sets the prescaler for the PWM output | |
- BYTE | Prescaler |
- VOID | Return |
SPIInitialise
SPIInitialise | |
Initialsie the SPI module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- VOID | Return |
SPIPrescaler
SPIPrescaler | |
Modify the speed of the SPI bus | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- BYTE | Prescaler |
Range: 0-2 | |
- VOID | Return |
SPITransfer
SPITransfer | |
Transfer a byte using the SPI bus | |
- BYTE | Channel |
Channel Index: Range 0 - SPI Bus Count - 1 | |
- BYTE | DataOut |
- BYTE | Return |
SPITransferTrans
ServoDisable
ServoDisable | |
Disable a Servo output | |
- BYTE | Channel |
Range: 0-5 | |
- VOID | Return |
ServoEnable
ServoEnable | |
Enable a Servo output | |
- BYTE | Channel |
Range: 0-5 | |
- VOID | Return |
ServoSetPosition8
ServoSetPosition8 | |
Sets the position as an 8-bit value | |
- BYTE | Channel |
Range: 0-1 | |
- BYTE | Position |
Range: 0-255 | |
- VOID | Return |
UARTBaud
UARTCheckRX
UARTCheckRX | |
Check to see if the UART module has received any data | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Return |
UARTInitialise
UARTInitialise | |
Initialise the UART module ready for communications | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- VOID | Return |
UARTReceive
UARTReceive | |
Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available. | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Return |
UARTSend
UARTSend | |
Send a byte via the UART module | |
- BYTE | Channel |
Channel Index: Range 0 - UART Bus Count - 1 | |
- BYTE | Data |
Data Byte to send. Range: 0-255 | |
- VOID | Return |
WIFIGetIP
WIFIGetIP | |
Gets the IP address of the board. Allows you to setup and get the assigned address via USB before using over WIFI, Use the WIFIIsConnected first to check the WIFI is active. | |
- STRING | Return |
WIFIIsConnected
WIFIIsConnected | |
Checks to see if the WIFI is active and connected | |
- BOOL | Return |
WIFISetSSID