12.3.1 Design Flow
The following steps are used to enable MMUART in the application by using Libero SoC.
- Enable MMUART_0 and/or MMUART_1 instance by using the MSS configurator in the application, as shown in the following figure.
- Configure Duplex Mode to Full Duplex and Async/Sync Mode to Asynchronous by using MSS MMUART_0 Configurator as shown in the following figure. Use the Main Connection drop-down list to connect the ports of enabled MMUART_0 instance to an I/O. Click the highlighted Users Guide button to find more information about MMUART configuration details.
- The MMUART_0 interface signals in the MSS component are shown in the following figure.
- Generate the component by clicking Generate Component or by selecting > . For more information about generation of the component, see the latest SmartDesign user guide on Libero SoC Documentation. The firmware driver folder and SoftConsole workspace are included into the project. Click the highlighted Configure firmware as shown in the following figure to find the MMUART driver information.
- Click Generate Bitstream under Program Design to complete the
.fdb
file generation. - Double click Export Firmware under Handoff Design for Firmware Development in the Libero SoC design flow window to generate the SoftConsole Firmware Project. The SoftConsole folder contains the mss_uart firmware driver. The firmware driver, mss_uart (
mss_uart.c
andmss_uart.h
), which provides a set of functions for controlling the MSS MMUARTs can also be downloaded from the Microchip Firmware Catalog. The following table lists main APIs for MMUART. For complete information about the APIs, see the SmartFusion 2 MSS UART Driver User Guide as shown in the preceding figure.
Category | API | Description |
---|---|---|
Initialization and configuration functions | MSS_UART_init | Initializes and configures the MMUART. |
MSS_UART_lin_init | Initializes and configures the MMUART for LIN mode of operation. | |
MSS_UART_irda_init | Initializes and configures the MMUART for IrDA mode of operation. | |
MSS_UART_smartcard_init | Initializes and configures the MMUART for ISO 7816 (smart-card) mode of operation. | |
Polled transmit and receive functions | MSS_UART_polled_tx | Transmits the data. |
MSS_UART_polled_tx_string | Transmits a NULL (”\0”) terminated string. | |
MSS_UART_fill_tx_fifo | Fills the UART's hardware transmitter FIFO. | |
Interrupt driven transmit and receive functions | MSS_UART_set_rx_handler | Registers a receive handler function. |
MSS_UART_set_tx_handler | Registers a transmit handler function. | |
MSS_UART_irq_tx | Initiates an interrupt driven transmission. | |
MSS_UART_get_rx | Reads the content of the UART receiver's FIFO and stores it in the receive buffer. |
For more information on MMUART usage, the sample projects are available and can be generated as shown in the following figure.
Important: MSS MMUART does not support full behavioral simulation models. See the SmartFusion2 MSS BFM Simulation User Guide for more information.