GUI (Graphical User Interface)
MPLAB Device Blocks for Simulink provide a simple but powerful graphical user interface. It allows to send and receive data from the chip using a Serial link.
Connection to the PC
Although the MCLV2 board has ports to connect a serial link (USB, RS232), in this example we are using an special FTDI cable. The USB 2.0 Hi-Speed to UART cable incorporates FTDI’s FT232H USB to UART interface IC device which handles all the USB signalling and protocols. The cable provides a fast, simple way to connect devices with 3.3 volt digital interfaces to USB. FTDI cable Driver
- The TX pin (orange pin 2) must be connected RX pin of the MCLV2 board.
- The RX pin (yellow pin 3) must be connected TX pin of the MCLV2 board.
- Do not forget to connect the GND (black pin 10) to the MCLV2 board.
The pin connection is represented below.
The use of picgui is illustrated through a simple exemple. A repeating sequence stair sapled at 1s is apply to a simple fisrt order system where K= 1 and tau = 0.1. The input and the output of the system are linked to the with Tx - Matlab block to plot using picgui. The model used is represented blow and can be download here:
The model is sampled at 0.1ms while the UART is sampled at 0.5ms. For this sampling rate, a high baudrate is required. Using a BaudRate = 921600, the serial link is able to send 9.22 bytes/step. After build, the Tx - Matlab block highlight the Bytes / Step. Note that using configuration, sending 2 variables takes 2 bytes / step. The UART configuration is the following :
Double click on the picgui Graphical interface open the following interface :
Select the right Com port and baudrate then press Connexion. A click on Start button plot the figure(50), based on code written in the central window.