monoZ docs
Peripheral Config

Table of Contents

Peripheral tab

Depending on the selected monoZero board, monoZ SDK libraries are available for 4 peripherals namely GPIO, UART, I2C and SPI which can be configured in the peripheral tab based on user requirements.

1. GPIO

Suppose the user wants to make pin 6 of port D (PD6) as GPIO, please follow these steps:

gpio_ex

Peripheral: Select the GPIO option from the peripheral tab and then click the add button.

gpio_1

Enable GPIO: Check the GPIO checkbox to enable the GPIO peripheral . Enter the required name for the GPIO peripheral such as “Modem” ,”CLI & Print”.
The GPIO peripherals will not be enabled with the generated application if the checkbox is unchecked.

gpio_2

Settings: Click the settings icon to open the GPIO settings window.

gpio_3

Enable Port Configuration: Select PORT D and then check the Port Configuration checkbox. This will enable the Port Configuration.

gpio-portD

Pin Configuration: Choose the required pin , here pin 6 and then check the Pin Configuration checkbox, assign them the appropriate configuration (Mode/Pull/Speed Frequency/Alternate) for the GPIO pin to behave.

  • MODE             : IP
  • PULL             : NO PULL / PULL UP / PULL DOWN
  • SPEED FREQ       : LOW / MEDIUM / HIGH / VERY HIGH
  • ALTERNATE        : User Alternate Number
gpio-pin6

Activate All Pins: When the Activate All Pins checkbox is checked, all the pins will be enabled.Then choose the required pins to setup from the list of available pins.

gpio-portD_all

2. I2C

Follow these steps to configure I2C2 :

I2C_ex

Peripheral: Select the I2C option from the peripheral tab and then click the add button.

I2C_1

Enable I2C: Check theI2C checkbox to enable the I2C peripheral. Enter the required name for the I2C peripheral.
The I2C peripherals will not be enabled with the generated application if the checkbox is unchecked.

I2C_2

Settings: Click the settings icon to open the I2C settings window.

I2C_3

I2C Settings Window: Configure the I2C module related settings in this window

  • Timing               : 0x10909CEC
  • Own Address1         : User Address1
  • Addressing Mode      : 7 bit / 10 bit
  • Dual Address mode    : Enable / Disable
  • Own Address2         : User Address2
  • Own Address2 Masks   : No Mask / Mask 1 / Mask 2 /.. / Mask 7
  • General Call Mode    : Enable / Disable
  • No Strech Mode       : Enable / Disable
I2C_4

Note:To configure various parameters in the I2C settings window , please refer to the relevant sensor module's datasheet.

3. SPI

Follow these steps to configure SPI (here SPI1) :

SPI_ex

Peripheral: Select the SPI option from the peripheral tab and then click the add button.

SPI_1

Enable SPI: Check the SPI checkbox to enable the SPI peripheral. Enter the required name for the SPI peripheral.
The SPI peripherals will not be enabled with the generated application if the checkbox is unchecked.

SPI_2

Settings: Click the settings icon to open the SPI settings window.

SPI_3

SPI Settings Window: Configure the SPI module related settings in this window.

  • MODE                 : MASTER / SLAVE
  • DIRECTION            : 2LINES / 2LINES_RXONLY / 1LINE
  • DATA SIZE            : 4BIT / 5BIT / .. / 16BIT
  • CLK POLARITY         : LOW / HIGH
  • CLK PHASE            : 1EDGE / 2EDGE
  • NSS                  : SOFT / HARD_INPUT / HARD_OUTPUT
  • BAUDRATE PRESCALAR   : 2 / 4 / 8 /../ 256
  • FIRST BIT            : MSB / LSB
  • TI MODE              : ENABLE / DISABLE
  • CRC CALCULATION      : ENABLE / DISABLE
  • CRC POLYNOMIAL       : User Polynomial
  • CRC LENGTH           : DATASIZE / 8BIT / 16BIT
  • NSSP MODE            : ENABLE / DISABLE
SPI_4

Note:To configure various parameters in the SPI settings window , please refer to the relevant sensor module's datasheet.

4. USART

Follow these steps to configure USART (here USART3):

USART_ex

Peripheral: Select the USART option from the peripheral tab and then click the add button.

USART_1

Enable USART: Check the USART checkbox to enable the USART peripheral.Enter the required name for the USART peripheral.
The USART peripherals will not be enabled with the generated application if the checkbox is unchecked.

USART_2

Settings: Click the settings icon to open the USART settings window.

USART_3

USART Settings Window: Configure the USART module related settings in this window

  • Baud Rate                : 9600 / 19200 / 115200 /../ 921600 
  • Data Bits                : 7B / 8B / 9B
  • Stop Bits                : 0.5 / 1 / 1.5 / 2
  • Parity                   : None / Even / Odd
  • Mode                     : Tx Rx / Tx Only / Rx Only
  • HW Flow Control          : None
  • Over Sampling            : 8 / 16
  • One Bit Sampling         : Enable / Disable
  • Adv Feature No Init      : No Init
USART_4

Note:To configure various parameters in the USART settings window , please refer to the relevant sensor module's datasheet.

Click here to configure the Appliction.