12.3.1 Design Flow

The following steps are used to enable MMUART in the application by using Libero SoC.

  1. Enable MMUART_0 and/or MMUART_1 instance by using the MSS configurator in the application, as shown in the following figure.
    Figure 12-22. Enable MMUART
  2. 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.
    Figure 12-23. MSS MMUART Configurator
  3. The MMUART_0 interface signals in the MSS component are shown in the following figure.
    Figure 12-24. MMUART Interface Signals
  4. Generate the component by clicking Generate Component or by selecting SmartDesign > Generate Component > . 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.
    Figure 12-25. MMUART Driver User Guide
  5. Click Generate Bitstream under Program Design to complete the .fdb file generation.
  6. 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 and mss_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.
Table 12-3. MSS MMUART APIs
CategoryAPIDescription
Initialization and configuration functionsMSS_UART_initInitializes and configures the MMUART.
MSS_UART_lin_initInitializes and configures the MMUART for LIN mode of operation.
MSS_UART_irda_initInitializes and configures the MMUART for IrDA mode of operation.
MSS_UART_smartcard_initInitializes and configures the MMUART for ISO 7816 (smart-card) mode of operation.
Polled transmit and receive functionsMSS_UART_polled_txTransmits the data.
MSS_UART_polled_tx_stringTransmits a NULL (”\0”) terminated string.
MSS_UART_fill_tx_fifoFills the UART's hardware transmitter FIFO.
Interrupt driven transmit and receive functionsMSS_UART_set_rx_handlerRegisters a receive handler function.
MSS_UART_set_tx_handlerRegisters a transmit handler function.
MSS_UART_irq_txInitiates an interrupt driven transmission.
MSS_UART_get_rxReads 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.

Figure 12-26. MMUART Sample Project
Important: MSS MMUART does not support full behavioral simulation models. See the SmartFusion2 MSS BFM Simulation User Guide for more information.