MSP Zero Code Studio User’s Guide

1. Project Configuration

1.1 Starting a New Project

  1. From the Home tab, click on “Start New Project”

  1. Select your device. The projects will start from the superset device on the LaunchPad configuration. To switch an existing project to a specific device, users may do this from the Develop tab.

  1. Select the Starting Project. A variety of applications are provided to the user to showcase common functionality and usage. An Empty project is also provided as a basic starting point. Users may start from any of the provided starting projects.

  1. Click Start to launch the project. This will load in the starting project (this may take a minute), and then this will switch to the Develop tab with the selected project.

1.2 Loading an Existing Project

Users may load in an existing Zero Code Project in one of two ways:

  1. From the Home tab, click on “Load Existing Project”. Then select the .syscfg file for the MSP Zero Code project to load in.

  1. From the toolbar at the top of the tool, users may click on File > Load Project File, and then select the .syscfg file for the MSP Zero Code project to load in.

Note: Users must load in a .syscfg file that was created with MSP Zero Code Studio. The tool currently does not support .syscfg files that have been created outside of the tool. Attempts to do so will results in an error.

1.3 Developing Projects

Users may create, build, and load their projects within the Develop tab. This tab shows the central workspace, where users can create their applications by adding module blocks, changing configurations, and drawing data path and sequence connections between blocks. From this tab users can also directly compile their applications and then load the application straight to their MSPM0 device.

More details on usage and blocks can be found in the Zero Code Concepts section.

1.4 Saving a Project

Users may save their MSP Zero Code Studio project by clicking in the top toolbar File > Save Project File. This will save a .syscfg file to the desired location. Users can then load in this project file at a later tim

1.5 Building and Loading Projects

Building and loading projects is made easy in MSP Zero Code Studio.

In the Develop tab, building a project can be done by clicking on the “Build Program” button at the top of the screen. The tool will then begin to compile the program using the TI ARM Clang compiler. A success message will be shown on a successful build. If a change to the user’s project is performed at doing a successful build, an info message will display to inform the user that the latest project updates have not yet been compiled.

The user may view the output of the Build Log by clicking on the top toolbar Help > View Build Log. The Build Log will keep track of all builds while the tool is open, and will reset the log once the tool is closed.

The user can also select “Build and Load” to both compile the program and then directly load the program to the device. The user should ensure that the correct device is connected via USB to the user’s PC at this time. A success message will display to indicate a successful compile and load. If there are any issues with the load, such as no device is connected or the wrong device is connected, then an error message will display.

1.6 Executable File (.out)

MSP Zero Code Studio will compile the project application to create an executable file (.out).

The user may export the .out file by clicking on the top toolbar File > Save Executable (.out).

2. Zero Code Concepts

2.1 Adding Blocks

A list of available blocks are on the left side of the graphical UI in the Develop tab. To add a block into the view, simply click the (plus) button next to the name.

2.2 Removing Blocks

Select the block to remove, and either:

  1. Hit the “Delete” keyboard key

  2. Click on the Trash icon in the configuration window in the bottom-center

2.3 Configuring Blocks

To update the settings of a block, select the block in the graphical view. This will focus the tool on that block and show the block-specific settings in the bottom center view.

2.4 Connecting Blocks

User can connect blocks to define either a sequence connection or a data connection. This can be done by clicking on the ports at the side of each block, and dragging the line to the desired connection point of a different block.

2.4.1 Sequence Connections

Sequence connections ensure that the blocks’ actions are executed in the user’s specified order. If a user wants to specify an order of operation, they have to use the sequence connections in order to guarantee that order is followed. Sequence connections are shown with a solid line. To specify a sequence, make a connection from the “next” port of one block to the “prev” port of another block. All blocks have “next” and “prev” ports defined, as it is possible for the user to define any sequence of operations. It is not required for “next” or “prev” ports to have a connection made. If the user does not specify any order, the tool will arbitrarily generate the code based on the order the blocks were added. In the example below, the sequence specified is that On Button Press must happen before LED Toggle.

The system runs on a queue which allows parallel sequences to be defined. This allows other blocks outside a sequence to execute if an action is not ready.

In the example configuration below, the On Button Press block will wait for a user action (a button press on the LaunchPad) until executing the next block (LED Toggle) in the sequence.

However, the LED On, Delay, and LED Offblocks will execute their sequence, even while the button is not pressed.

2.4.2 Data Connections

Data connections allow certain blocks to pass data to and from other blocks.

Supported data types are:

  • Integers

  • Strings

  • Byte arrays

This allows blocks to dynamically take in data from other blocks as inputs, and perform an action using or based on that data. Users may create a data path in their application through the use of data connections.

Data connections are shown with a dotted line. To specify a data path, make a connection between the “dout” of one block to the “din” of another block. Some blocks require data as input in order for that block to function; if data is required as an input and no connection is made, an error will occur. If a user tries to pass in an unsupported data type into a block, an error will occur.

In the example below, the String Variable block is passing string data to the UART Write block. The actual string is defined as a part of the String Variable's Configuration. Here, the string being defined is “Hello World”.

2.5 Sharing configurations between blocks

For most blocks, users can select which “Configuration” is selected. Configurations allow different blocks to share peripheral settings. For example, shared settings could include pins, clock frequencies, peripheral settings, etc. Not all blocks can share Configurations, and not all settings can be shared. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration. Shared Configurations may be used between blocks of the same type, or in some cases, blocks of different types.

Multiple Configurations may be created for a block type in order to allow blocks to have different peripheral settings. A new Configuration can be added by clicking the “Create New” option on the Configuration selection.

For example: A user adds a LED On block to the graphical view and names it my_led_0. On my_led_0, the user is on the default LED Configuration of led_config_0, and then selects the GPIO pin PA0. This saves the GPIO Pin selection of PA0 to the Configuration of led_config_0.

The user then adds a second LED On block and names it my_led_1. By default, my_led_1 will use the same LED Configuration of led_config_0, and will have GPIO Pin PA0 selected.

If the user changes the pin on either my_led_0 or my_led_1, the pin change will happen for both blocks, because both blocks are using the same Configuration of led_config_0. Therefore, if the user updates my_led_1 to use PB22, then my_led_0 will also automatically update to use PB22 because of the shared Configuration led_config_0.

Now, say that on my_led_1, the user creates a new LED Configuration and names it led_config_1, and then switches my_led_1 to that configuration. This will automatically change the selected pin for my_led_1, because the two configurations cannot share the same pin. In this case, my_led_1 with Configuration led_config_1 was updated to use GPIO Pin PB22.

Now, if the user select a different pin on my_led_0, this will not affect the pin selection on my_led_1, because these blocks are using different Configurations.

3. Block Guide

3.1 Utils

Delay

The Delay block delays the application for the specified amount of time.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Delay (ms): The number of milliseconds to delay running the application

  • (read only) Clock Cycles: The number of clock cycles that is being delayed from the user input value into the Delay parameter, this number is based on the clock frequency of the device.

Inputs
  • N/A

Outputs
  • N/A


Integer Variable

The Integer Variable block creates and initializes a variable with a provided integer value.

The value of the created variable can be updated at a later point in the application with the Update Integer Variable block.

Configuration Parameters
  • Name (string): Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Initial Value (integer): The integer value to set

Inputs
  • N/A

Outputs
  • dout (integer): Returns the data that is stored on the variable at time of execution


Convert Int to String

The Convert Int to String block creates takes in an integer value, and outputs it into the corresponding string. For example, an input of 12 will output the string “12”.

Configuration Parameters
  • Name (string): Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

Inputs
  • din (integer): The integer value to convert

Outputs
  • dout (string): Returns the converted string of din


String Variable

The String Variable block creates and initializes a variable with a provided string value.

Configuration Parameters
  • Name (string): Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • String (string): The string value to set

  • Append Newline: If selected, appends a newline character “\n” to the end of the value given in the String parameter

Inputs
  • N/A

Outputs
  • dout (string): Returns the data that was specified by the String and Add New Line parameters


Update Integer Variable

The Update Integer Variable block updates the value of a variable that was previously created by an Integer Variable block.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Variable Action: The action to perform to the specific Integer Variable. The valid options are:

    • Set Value: Set the variable to the specific value

      • New Value (integer): The new value to set the variable to

    • Increment: Increment the variable by 1

    • Decrement: Decrement the variable by 1

  • Select Variable: Select the pre-existing integer variable to update the value for.

    • Create New: Directly create a new variable instead of using one of the pre-existing variables. This will create a new Integer Variable block

Inputs
  • N/A

Outputs
  • N/A


3.2 Analog

ADC Read

The ADC Read block performs a single ADC conversion on the specified pin and outputs the data.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • ADC Channel: Select the channel configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • ADC Pin: Select the ADC pin to use. The pins are filtered to available ADC channels on the selected device.

Inputs
  • N/A

Outputs
  • dout (integer): Returns the result of a single ADC conversion on the specified pin


3.3 Pin

GPIO Write

The GPIO Write block writes a value to the specified pin.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Pin Value: Set or Clear the specified pin

  • GPIO Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • GPIO Pin: The GPIO pin to write to

Inputs
  • N/A

Outputs
  • N/A


GPIO Read

The GPIO Read block reads the value to the specified pin.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • GPIO Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • GPIO Pin: The GPIO pin to read

Inputs
  • N/A

Outputs
  • dout (integer): Returns the logical state of the GPIO pin

    • Range: Value of 0 or 1


3.4 LaunchPad Hardware

LED Off

The LED Off block turns off a LED on the MSPM0 LaunchPad.

This block acts as a convenient way to select and configure one of the on-board LEDs on a MSPM0 LaunchPad. The user must still ensure to make any necessary connections on the LaunchPad to use the LED. Please refer to the corresponding LaunchPad User’s Guide for hardware specific information

To use the functionality of other pins, refer to one of the GPIO blocks.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • LED Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • LED Pin: The LED pin to use. The available pin options are filtered to pins that are connected to an on-board LED on the specified LaunchPad.

Inputs
  • N/A

Outputs
  • N/A


LED On

The LED On block turns on a LED on the MSPM0 LaunchPad.

This block acts as a convenient way to select and configure one of the on-board LEDs on a MSPM0 LaunchPad. The user must still ensure to make any necessary connections on the LaunchPad to use the LED. Please refer to the corresponding LaunchPad User’s Guide for hardware specific information

To use the functionality of other pins, refer to one of the GPIO blocks.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • LED Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • LED Pin: The LED pin to use. The available pin options are filtered to pins that are connected to an on-board LED on the specified LaunchPad.

Inputs
  • N/A

Outputs
  • N/A


LED Toggle

The LED Toggle block toggles a LED on the MSPM0 LaunchPad.

This block acts as a convenient way to select and configure one of the on-board LEDs on a MSPM0 LaunchPad. The user must still ensure to make any necessary connections on the LaunchPad to use the LED. Please refer to the corresponding LaunchPad User’s Guide for hardware specific information

To use the functionality of other pins, refer to one of the GPIO blocks.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • LED Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • LED Pin: The LED pin to use. The available pin options are filtered to pins that are connected to an on-board LED on the specified LaunchPad.

Inputs
  • N/A

Outputs
  • N/A


On Button Press

The On Button Press block waits for the selected button on the LaunchPad to be pressed before executing any subsequent connected blocks.

This block acts as a convenient way to select and configure one of the on-board LEDs on a MSPM0 LaunchPad. The user must still ensure to make any necessary connections on the LaunchPad to use the LED. Please refer to the corresponding LaunchPad User’s Guide for hardware specific information

To use the functionality of other pins, refer to one of the GPIO blocks.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Button Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • Button Pin: The button pin to use. The available pin options are filtered to pins that are connected to an on-board switches on the specified LaunchPad.

Inputs
  • N/A

Outputs
  • N/A


3.5 Communications

UART Read

The UART Read block reads the specified number of bytes over (serial) UART, and outputs the read data as a string.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Size: The number of bytes to read

  • UART Read Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • Baud Rate: The baud rate to use for the serial connection

  • RX Pin: The UART RX pin to use

Inputs
  • N/A

Outputs
  • dout (byte array): Returns the data that was read over serial UART with length specified by the Size parameter.


UART Write

The UART Write block writes string data over (serial) UART

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Write Buffer (Data Connection) (integer, string, byte array): The data to be written. Takes the input from the input connection “din”. If no data is connected to “din”, then data must be manually input by the user in the Write Buffer parameter.

  • Write Buffer (integer, string, byte array): The data to be written. Any user input into this field will be overwritten if there is a data connected into the “din” input.

  • Append Newline: If selected, appends a newline character “\n” to the end of the String parameter

  • UART Write Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • Baud Rate: The baud rate to use for the serial connection

  • TX Pin: The UART TX pin to use

Inputs
  • din (integer, string, byte array): Takes the value wired to this input as the data to use for the Write Buffer parameter.

Outputs
  • N/A


I2C Controller Read

The I2C Controller Read block reads data from a I2C Target with a specified address.

Note: SDA and SCL pins both require pull-up resistors

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Target Address: Address of I2C target to read data from.

  • Read Buffer Size: The number of bytes to read

  • I2C Controller Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • Bus Speed: The bus speed to use.

  • SDA Pin: The I2C data pin to use

  • SCL Pin: The I2C clock pin to use

Inputs
  • N/A

Outputs
  • dout (byte array): Returns the data that was read over serial I2C with length specified by the Read Buffer Size parameter.


I2C Controller Write

The I2C Controller Write block writes input data to I2C Target with specified address.

Note: SDA and SCL pins both require pull-up resistors

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Target Address: Address of I2C target to write data to.

  • Transfer Buffer (Data Connection) (integer, string, byte array): The data to be written. Takes the input from the input connection “din”. If no data is connected to “din”, then data must be manually input by the user in the Transfer Buffer parameter.

  • Transfer Buffer (integer, string, byte array): The data to be written. Any user input into this field will be overwritten if there is a data connected into the “din” input.

  • I2C Controller Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • Bus Speed: The bus speed to use.

  • SDA Pin: The I2C data pin to use

  • SCL Pin: The I2C clock pin to use

Inputs
  • din (integer, string, byte array): Takes the value wired to this input as the data to use for the Trasnfer Buffer parameter.

Outputs
  • N/A


I2C Target Read

The I2C Target Read block writes input data to I2C Target with specified address.

Note: SDA and SCL pins both require pull-up resistors

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Read Buffer Size: The number of bytes to read

  • I2C Target Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • Enable Target’s Own Address: When enabled, user can specify the Target’s Own Address.

  • Target’s Own Address: I2C Target configurable address. Used by Controller to specify which I2C target it is communicating with.

  • SDA Pin: The I2C data pin to use

  • SCL Pin: The I2C clock pin to use

Inputs
  • N/A

Outputs
  • dout (string): Returns the data that was read over serial I2C with length specified by the Read Buffer Size parameter.


I2C Target Fill TX FIFO

The I2C Target Fill TX FIFO block writes input data to I2C Target with specified address.

Note: SDA and SCL pins both require pull-up resistors

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Transfer Buffer (Data Connection) (integer, string, byte array): The data to be written. Takes the input from the input connection “din”. If no data is connected to “din”, then data must be manually input by the user in the Transfer Buffer parameter.

  • Transfer Buffer (integer, string, byte array): The data to be written. Any user input into this field will be overwritten if there is a data connected into the “din” input.

  • I2C Target Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • Enable Target’s Own Address: When enabled, user can specify the Target’s Own Address.

  • Target’s Own Address: I2C Target configurable address. Used by Controller to specify which I2C target it is communicating with.

  • SDA Pin: The I2C data pin to use

  • SCL Pin: The I2C clock pin to use

Inputs
  • din (string): Takes the value wired to this input as the data to use for the Transfer Buffer parameter.

Outputs
  • N/A


SPI Controller Transfer

The SPI Controller Transfer block writes input data to I2C Target with specified address.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Chip Select: Selects which connected SPI Peripheral device the SPI Controller should transfer to.

  • Transfer Buffer (Data Connection) (integer, string, byte array): The data to be written. Takes the input from the input connection “din”. If no data is connected to “din”, then data must be manually input by the user in the Transfer Buffer parameter.

  • Transfer Buffer (integer, string, byte array): The data to be written. Any user input into this field will be overwritten if there is a data connected into the “din” input.

  • SPI Controller Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • Chip Select: Enable/disable which connected SPI Peripheral devices can be addressed by the SPI Controller using up to 4 Chip Select (CS) signals.

  • Bit Rate (Hz): The SPI includes a programmable bit rate clock divider and prescaler to generate the serial output block. The bit rates are support up to the input clock divided by 2.

  • SCLK Pin: The SPI SCLK pin to use

  • PICO Pin: The SPI PICO pin to use

  • POCI Pin: The SPI POCI pin to use

  • CSx Pin: The SPI CSx pin to use

Inputs
  • din (integer, string, byte array): Takes the value wired to this input as the data to use for the Transfer Buffer parameter.

Outputs
  • dout (byte array): Returns the data that was read over serial SPI


SPI Peripheral Read

The SPI Peripheral Read block reads specified number of bytes from SPI Controller.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Read Buffer Size: The number of bytes to read

  • SPI Peripheral Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • Chip Select: Selects the Chip Select (CS) to be used by the SPI Peripheral after initialization. Only one CS can be enabled by the SPI Peripheral at a time.

  • SCLK Pin: The SPI SCLK pin to use

  • PICO Pin: The SPI PICO pin to use

  • POCI Pin: The SPI POCI pin to use

  • CSx Pin: The SPI CSx pin to use

Inputs
  • N/A

Outputs
  • dout (string): Returns the data that was read over serial SPI


SPI Peripheral Fill TX FIFO

The SPI Peripheral Fill TX FIFO block prepares SPI Peripheral output buffer for SPI Controller transfer request.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Transfer Buffer (Data Connection) (integer, string, byte array): The data to be written. Takes the input from the input connection “din”. If no data is connected to “din”, then data must be manually input by the user in the Transfer Buffer parameter.

  • Transfer Buffer (integer, string, byte array): The data to be written. Any user input into this field will be overwritten if there is a data connected into the “din” input.

  • SPI Peripheral Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • Chip Select: Selects the Chip Select (CS) to be used by the SPI Peripheral after initialization. Only one CS can be enabled by the SPI Peripheral at a time.

  • SCLK Pin: The SPI SCLK pin to use

  • PICO Pin: The SPI PICO pin to use

  • POCI Pin: The SPI POCI pin to use

  • CSx Pin: The SPI CSx pin to use

Inputs
  • din (string): Takes the value wired to this input as the data to use for the Transfer Buffer parameter.

Outputs
  • N/A


3.5 PWM

PWM Initialize

The PWM Initialize block configures a PWM channel with the inputs provided.

A PWM Initialize block must be placed for a specific channel before any other block can be used for that channel. It is recommended that this block is placed outside of the Repeat loop for each channel to be initialized.

A PWM channel does not need to be enabled with the PWM Initialization block. The PWM channel can be enabled at a later point in the flow using the PWM Start block.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • PWM Channel Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

  • Start PWM Channel on Initialization: Selecting this box will immediately output the PWM channel when the block is run

  • Initialization Duty Cycle (%): The duty cycle percentage of the PWM signal

    • Range: Value from 0.0 to 100.0 inclusive

  • Initialization Duty Cycle Lower Bound (%): The PWM duty cycle will never be lower than this value

    • Range: Value from 0.0 to 100.0 inclusive

  • Initialization Duty Cycle Upper Bound (%): The PWM duty cycle will never be greater than this value

    • Range: Value from 0.0 to 100.0 inclusive

  • Initialization Frequency (Hz): The frequency of the PWM signal

    • Range: Dependent on pin selection

Inputs
  • N/A

Outputs
  • N/A


PWM Start

The PWM Start block enables the channel’s output on the selected pin to output a PWM signal with the initialization frequency and the most recent duty cycle configuration.

This block can be used to either start a PWM signal which was not started on initialization with a PWM Initialize block, or to start a PWM signal which has been stopped using the PWM Stop block.

A PWM Initialize block must be placed for a channel before any other blocks for that channel can be used.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • PWM Channel Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

Inputs
  • N/A

Outputs
  • N/A


PWM Stop

The PWM Stop block disables the channel’s output and the pin will output a logic LOW signal.

A PWM Initialize block must be placed for a channel before any other blocks for that channel can be used.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • PWM Channel Configuration: Select the configuration for the block. Blocks that share a Configuration will share the same peripheral settings, and an update made to that Configuration will apply that update to all blocks that share that Configuration.

Inputs
  • N/A

Outputs
  • N/A


PWM Update Duty Cycle

The PWM Stop block updates the channel’s duty cycle to the specified duty cycle.

This block can be run if the PWM channel output is either enabled or disabled.

A PWM Initialize block must be placed for a channel before any other blocks for that channel can be used.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Desired Duty Cycle (%): Duty cycle percentage to set for the channel

    • Range: Value from 0.0 to 100.0 inclusive

  • PWM Channel Configuration: Select the user Configuration for the given block from the available configured channels

Inputs
  • N/A

Outputs
  • N/A


3.6 Loops

Infinite Loop

The Infinite Loop block executes the block(s) inside of the loop an infinite number of times.

To use this block, the user must first add the Infinite Loop block to the graphical view. Then, click on the Infinite Loop block in the graphical view to ensure it is selected, and then Add in the subsequent blocks that are desired to be inside of the loop.

The Infinite Loop block requires to know what is the start of the loop, and what is the end of the loop. This is done by making a connection from the inside “start” port of the Infinite Loop block to the “prev” port of the first block that is to start the sequence inside the Repeat. The “end” port of the Infinite Loop block must be connected to the “next” port of the last block inside the loop.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

Inputs
  • N/A

Outputs
  • N/A


For Loop

The For Loop block executes the block(s) inside of the loop a specified number of times.

To use this block, the user must first add the For Loop block to the graphical view. Then, click on the For Loopblock in the graphical view to ensure it is selected, and then Add in the subsequent blocks that are desired to be inside of the loop.

The For Loop block requires to know what is the start of the loop, and what is the end of the loop. This is done by making a connection from the inside “start” port of the For Loop block to the “prev” port of the first block that is to start the sequence inside the Repeat. The “end” port of the For Loopblock must be connected to the “next” port of the last block inside the loop.

The user can then define the number of Iterations that they want the contents of the block to repeat for. This block defaults to executing (1) time unless otherwise specified.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Iterations: The number of times that the loop should repeat for

Inputs
  • N/A

Outputs
  • N/A


3.7 Logic

Compare

The Compare block compares two inputs (of the same data type) based on the selected comparison condition.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

  • Condition Check: The type of comparison to perform on the inputs. Options are:

    • Input A is Equal to (==) Input B

    • Input A is Greater than (>) Input B

    • Input A is Less than (<) Input B

    • Input A is Greater than or Equal to (>=) Input B

    • Input A is Less than or Equal to (<=) Input B

    • Input A is Not Equal to (!=) Input B

Inputs
  • din_A (integer): Input value A to compare

  • din_b (integer): Input value B to compare

Outputs
  • dout (bool): The result of the selected comparison of din_A and din_B


If/Else

To use this block, the user must first add the If/Else block to the graphical view. Then, click on the If/Else block in the graphical view to ensure it is selected, and then Add in the subsequent blocks that are desired to be inside of the If/Else.

The If/Else block requires to know what is the start of its execution, and what is the end of it. This is done by making a connection from the inside “start” port of the If/Elseblock to the “prev” port of the first block that is to start the sequence inside the Repeat. The “end” port of the If/Else block must be connected to the “next” port of the last block inside the If/Else.

The If/Else block allows the user to define two possible sequences based on the value of the “condition” parameter. The user can switch between the If context and the Else context by clicking on the drop-down selection at the top of the block. The selected option will display the blocks that will execute in that context.

The blocks inside the If condition will occur if the value passed into the “condition” input parameter is TRUE. If the “condition” value is FALSE, then the blocks inside the Else

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

Inputs
  • condition (bool): The condition to evaluate for the if/else. If the “condition” is TRUE, the If sequence will execute. If the “condition” is FALSE, then the Else sequence will execute.

Outputs
  • N/A


AND (Logical)

The AND (Logical) block computes the logical AND of the inputs. Both inputs must be Boolean values. If both inputs are TRUE, the function returns TRUE. Otherwise, it returns FALSE.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

Inputs
  • din_A (bool): Input value A to compute the logical AND of

  • din_b (bool): Input value B to compute the logical AND of

Outputs
  • dout (bool): The result of the logical AND of din_A and din_B. If both inputs are TRUE, the function returns TRUE. Otherwise, it returns FALSE.


OR (Logical)

The OR (Logical) block computes the logical OR of the inputs. Both inputs must be Boolean values. If both inputs are FALSE, the function returns FALSE. Otherwise, it returns TRUE.

Configuration Parameters
  • Name: Unique identifier for the given block. May be modified by the user. The given name must be a valid C identifier.

Inputs
  • din_A (bool): Input value A to compute the logical OR of

  • din_b (bool): Input value B to compute the logical OR of

Outputs
  • dout (bool): The result of the logical OR of din_A and din_B. If both inputs are FALSE, the function returns FALSE. Otherwise, it returns TRUE.


4. Known Issues

  1. UI: Creating a feedback loop, where one block’s “prev” and “next” ports are directly connected, will lead to no task code being generated, and will not work.

  2. Blocks: UART Output - Configuring the UART at the boundaries of its baud rate (minimum baud rate/maximum baud rate) can lead to unexpected output on the port. We are working on optimizations to the generated code to support edge cases.

  3. Blocks: Parallel flows of execution are not currently supported inside the Infinite Loop block. The Infinite Loop block currently requires the user to define a Start and End of the sequence inside the Repeat. Any “floating” blocks will be ignored.