modelUart
Two microcontrollers talk over a real serial link: A sends PING, B answers PONG
Extends from Modelica.Icons.Example (Icon for runnable examples).
Information
Real electrical serial link (machine.UART, 9600 baud, 8N1) between two MCU blocks, crossed as on a breadboard: TX of each board to RX of the other, and a common ground. Board A (uart_ping.py) sends PING 0, PING 1, PING 2 and waits each time for the reply; board B (uart_pong.py) answers every line with PONG n. A sets GP7 high once every reply is right. Plot mcuA.GP0.v and mcuB.GP0.v to see the frames go one way, then the other.
Components
| Type | Name | Default | Description |
|---|---|---|---|
| MCU | mcuA | Board A: Resources/Scripts/MCU/uart_ping.py (TX = GP0, RX = GP1) | |
| MCU | mcuB | Board B: Resources/Scripts/MCU/uart_pong.py (TX = GP0, RX = GP1) | |
| Modelica.Electrical.Analog.Basic.Ground | ground |