I tried something simple. It worked. But please help me and tell me if
this seems insane.
The GPIO pins of MSP430 use +3.3V/0V CMOS logic levels, while the PC
COM-Port uses +12V/-12V RS232 levels. Here is the interface hardware I
used:
a) PC COM-Port Gnd <==> MSP430 Gnd
b) PC COM-Port TxD ==> 33K ==> MSP430 GPIO pin Px.y
c) PC COM-Port RxD <== Same MSP430 GPIO pin Px.y
(Yes, I know, there are 4 wires and a resistor. But “one-wire” sounds
better
The MSP430 I used has no hardware UART. Here is the bit-banging method
I used in firmware:
a) MSP430 initializes PxSEL:BITy=0 (as GPIO); PxDIR:BITy=0 (as input);
PxOUT:BITy=1 (no immediate effect, handy for sending 1).
b) When PC is sending TxD, MSP430 just read PxIN:BITy to receive.
c) When PC is receiving, MSP430 sets PxDIR:BITy=1 to pull RxD high, or
clears PxDIR:BITy=0 so that RxD is pulled low by TxD.