Contents
Can a MCU receive two signals at the same time?
If MCU 1 sends a “123” signal, MCU 1 and MCU 2 will receive “123” at the same time. If MCU 2 sends a “678” signal, MCU 2 and MCU 1 will receive “678” at the same time. Is this assumption correct? In the long run, will it damage the MCU? Thank you.
How to set pin a0 for UART-TX?
For each TX byte, an RX byte will be received. Assume transmit failed if they do not match. Set pin A0 back to primary GPIO function. Insert a 1K resistor at each UART-TX pin — to protect against a short-circuit when 2 or more transmitters send simultaneously.
How to send sensor data to PC using USART?
Added to the fact that pumping text out at 9600 baud means you are only ever checking the sensor fairly infrequently. So the chances of catching a short high pulse are minimal in the first place. Try a tighter loop checking the value of SENSOR for a change. Then, when you detect a change, send out a new message – just one.
Why are UART pins shared with GPIO pins?
It’s very common for any modern MCU to have UART pins shared with GPIO pins. Typically the primary function is GPIO and the secondary function is UART. This means that the diodes are not necessary. So, to implement a 1-wire bus using UARTs, consider the following.
How to connect two devices to a UART bus?
To link two devices with a UART bus, the TX pin of the first device should be connected to the RX pin of the second device, while the TX pin of the second device should be connected to the RX pin of the first. This can be done physically by overlapping the wires.
How to set pin A0 to secondary UART-RX?
Set Pin A0 to the primary GPIO function (in high impedance input mode). Set Pin A1 to the secondary UART-RX function. Set pin A0 to secondary UART-TX function. For each TX byte, an RX byte will be received. Assume transmit failed if they do not match.
How many resistors are in a UART-TX pin?
Insert a 1K resistor at each UART-TX pin — to protect against a short-circuit when 2 or more transmitters send simultaneously. Insert a 100K pull-up resistor from the data-bus to VCC — to stabilize the bus when no-one is transmitting.