Jump to content

Component: IntOsc Helper (Matrix Tools): Difference between revisions

From Flowcode Help
No edit summary
Line 1: Line 1:
 
{| style="width:50%"
 
{| width="50%"
|-
|-
| width="20%" style="color: gray;" | Author
| width="20%" style="color:gray;" | Author
| MatrixTSL
| MatrixTSL
|-
|-
| width="20%" style="color: gray;" | Version
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
| 1.0
|-
|-
| width="20%" style="color: gray;" | Category
| width="20%" style="color:gray;" | Category
| Matrix Tools
| Matrix Tools
|}
|}




==IntOsc Helper component==
A component to help configure the speed of the internal oscillator. Currently only supports 8-bit PIC devices.


==[[File:Component Icon 3e5cc6d0_3e36_46b8_bc40_f238a5735b6e.png|Image]] IntOsc Helper component==
==Detailed description==
A component to help configure the speed of the internal oscillator.
 
Currently only supports 8-bit PIC devices.
''No detailed description exists yet for this component''


==Examples==
==Examples==
The INT OSC helper component is designed to help you configure the rate of the internal oscillator on-board your microcontroller.
The INT OSC helper component is designed to help you configure the rate of the internal oscillator on-board your microcontroller.


Line 56: Line 58:
==Downloadable macro reference==
==Downloadable macro reference==


''This component does not contain any downloadable macros''
{| 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;" | '''Initialise'''
|-
| colspan="2" | Called to set the internal oscillator speed to the specified value. 
|-
|-
| 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''
|}
 
 
{| 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;" | '''CheckBuffer'''
|-
| colspan="2" | Returns the number of values in the transmit or receive buffer 
|-
|-
| width="10%" align="center" | [[File:]] -
| width="90%" | Buffer
|-
| colspan="2" | 0=Transmit / 1=Receive 
|-
| 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''
|}
 
 
{| 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;" | '''ReceiveString'''
|-
| colspan="2" | Gets a string from the receive buffer 
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | MaxChars
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Timeout
|-
| colspan="2" | Time in milliseconds to wait for data 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| 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;" | '''Initialise'''
|-
| colspan="2" | Initialises the UART component pins ready to send and receive data 
|-
|-
| 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''
|}
 
 
{| 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;" | '''ReceiveByteArray'''
|-
| colspan="2" | Receives an array of bytes and returns the number of bytes received. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Data
|-
| colspan="2" | A byte array variable to hold the received data 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | NumBytes
|-
| colspan="2" | Maximum number of bytes to try and receive 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Timeout
|-
| colspan="2" | Max amount of time in ms to wait between bytes 
|-
| 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''
|}


==Simulation macro reference==


''This component does not contain any simulation macros''
{| 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;" | '''ReceiveString'''
|-
| colspan="2" | Receives a string of bytes and returns the number of bytes received. 
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | StringData
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | NumBytes
|-
| colspan="2" | Maximum number of bytes to try and receive 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Timeout
|-
| colspan="2" | Max amount of time in ms to wait between bytes 
|-
| 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''
|}
 
 
{| 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;" | '''Uninit'''
|-
| colspan="2" | Un-initialize the UART and release the resources 
|-
|-
| 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''
|}




==Property reference==
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
<span style="font-weight: normal;"><u>Oscillator Speed</u></span>
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetList'''
|-
| colspan="2" | Gets Named property List&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Name
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| 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;" | '''Delay'''
|-
| colspan="2" | Software UART Bit Delay&nbsp;
|-
|-
| 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''
|}
 
 
{| 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;" | '''SetValue'''
|-
| colspan="2" | set Value of Named property&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Name
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Value
|-
| colspan="2" | &nbsp;
|-
| 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''
|}
 
 
{| 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;" | '''Uninit'''
|-
| colspan="2" | Un-initialize the UART and release the resources&nbsp;
|-
|-
| 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''
|}
 
 
{| 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;" | '''GetList'''
|-
| colspan="2" | Gets Named property List&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Name
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| 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;" | '''ReceiveByteArray'''
|-
| colspan="2" | Receives an array of bytes and returns the number of bytes received.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Data
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | NumBytes
|-
| colspan="2" | Maximum number of bytes to try and receive&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Timeout
|-
| colspan="2" | Max amount of time in ms to wait between bytes&nbsp;
|-
| 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''
|}


This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''OscSpeed''.


Shows what internal oscillator speeds are available on the device and allows the user to select an option.
{| 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;" | '''ReceiveString'''
|-
| colspan="2" | Receives a string of bytes and returns the number of bytes received.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | StringData
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | NumBytes
|-
| colspan="2" | Maximum number of bytes to try and receive&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Timeout
|-
| colspan="2" | Max amount of time in ms to wait between bytes&nbsp;
|-
| 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''
|}


<span style="font-weight: normal;"><u>Info</u></span>


This property is of type ''Multiple lines of text'' and can be referenced with the variable name ''Info''.
{| 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;" | '''GetList'''
|-
| colspan="2" | returns Named property list&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Name
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


General info to the user, checks to see if the selected oscillator speed matches the project oscillator speed.


<span style="font-weight: normal;"><u>Code</u></span>


This property is of type ''Line of text'' and can be referenced with the variable name ''Code''.


Code to configure the internal oscillator module.
==Property reference==


This code must be added to a C icon which should be placed at the top of main.
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Oscillator Speed
|-
| colspan="2" | Shows what internal oscillator speeds are available on the device and allows the user to select an option.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-11-icon.png]]
| width="90%" | Info
|-
| colspan="2" | General info to the user, checks to see if the selected oscillator speed matches the project oscillator speed.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-11-icon.png]]
| width="90%" | Code
|-
| colspan="2" | Code to configure the internal oscillator module. This code must be added to a C icon which should be placed at the top of main.&nbsp;
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
|-
|}

Revision as of 16:14, 16 November 2021

Author MatrixTSL
Version 1.0
Category Matrix Tools


IntOsc Helper component

A component to help configure the speed of the internal oscillator. Currently only supports 8-bit PIC devices.

Detailed description

No detailed description exists yet for this component

Examples

The INT OSC helper component is designed to help you configure the rate of the internal oscillator on-board your microcontroller.

It can be found under the Runtime -> Matrix Tools component category.


The oscillator speed drop down menu shows you what speeds are available on your device. Use this to select a speed.


Once you have chosen your required internal oscillator speed copy the code from the Code property.


Paste the configuration code into a C icon at the top of your main macro.


Next change the clock speed in the project options to match your oscillator speed. This will ensure that delays and baud rates are calculated correctly.


Finally you need to enable the internal oscillator in the configuration settings.


If everything is correct then the Info field should confirm that the project options clock speed matches the current speed selection.

Downloadable macro reference

Initialise
Called to set the internal oscillator speed to the specified value. 
- VOID Return


CheckBuffer
Returns the number of values in the transmit or receive buffer 
[[File:]] - Buffer
0=Transmit / 1=Receive 
- UINT Return


ReceiveString
Gets a string from the receive buffer 
- UINT MaxChars
 
- UINT Timeout
Time in milliseconds to wait for data 
- STRING Return


Initialise
Initialises the UART component pins ready to send and receive data 
- VOID Return


ReceiveByteArray
Receives an array of bytes and returns the number of bytes received. 
- BYTE Data
A byte array variable to hold the received data 
- UINT NumBytes
Maximum number of bytes to try and receive 
- UINT Timeout
Max amount of time in ms to wait between bytes 
- UINT Return


ReceiveString
Receives a string of bytes and returns the number of bytes received. 
- STRING StringData
 
- UINT NumBytes
Maximum number of bytes to try and receive 
- UINT Timeout
Max amount of time in ms to wait between bytes 
- BYTE Return


Uninit
Un-initialize the UART and release the resources 
- VOID Return


GetList
Gets Named property List 
- STRING Name
 
- STRING Return


Delay
Software UART Bit Delay 
- VOID Return


SetValue
set Value of Named property 
- STRING Name
 
- STRING Value
 
- VOID Return


Uninit
Un-initialize the UART and release the resources 
- VOID Return


GetList
Gets Named property List 
- STRING Name
 
- STRING Return


ReceiveByteArray
Receives an array of bytes and returns the number of bytes received. 
- BYTE Data
 
- BYTE NumBytes
Maximum number of bytes to try and receive 
- BYTE Timeout
Max amount of time in ms to wait between bytes 
- BYTE Return


ReceiveString
Receives a string of bytes and returns the number of bytes received. 
- STRING StringData
 
- BYTE NumBytes
Maximum number of bytes to try and receive 
- BYTE Timeout
Max amount of time in ms to wait between bytes 
- BYTE Return


GetList
returns Named property list 
- STRING Name
 
- STRING Return



Property reference

Properties
Oscillator Speed
Shows what internal oscillator speeds are available on the device and allows the user to select an option. 
Info
General info to the user, checks to see if the selected oscillator speed matches the project oscillator speed. 
Code
Code to configure the internal oscillator module. This code must be added to a C icon which should be placed at the top of main. 
Connections
Simulations