One of the problems with the serial port is that it is rather high voltage - up to 15v. The STM operates at 3.3v - so we cannot directly connect it. To make this work properly we use a MAX3232 IC, which converts from one level to another - allowing us to talk to the STM32 board.
For this section, you will need 5 x 0.1uf capacitors (I used polyester ones which are cheap) and a MAX3232 IC (which is a couple of dollars).
On the breadboard :
1) Plug in the IC in a sensible spot, notch up.
2) Connect 3v3 to pin 16 and GND to pin 15. (these pins are on the top left of the STM board)
3) Put capacitors across - pins 1 and 3, pins 4 and 5, pins 6 and 15, pins 16 and 15, and pins 2 and 16.
4) Connect the cable you made in the last step so that :-
- RxD (pin 2 on the socket) is connected to pin 14
- TxD (pin 3 on the socket) is connected to pin 13
- GND (pin 5 on the socket) is connected to pin 15
Now put the short back in between pins 12 and 11 - this is the 'loopback' test again.
|The completed serial interface, with the "loopback" short in place.|
If you do this and it is working, as before the characters should echo back as you type them in to GTKTerm or whatever terminal program you use - you have connected the in and out together again, but at "the other side" of the chip where the voltages are okay for the STM32.
Now take the loop-back out. Here is the circuit. (Apologies for the text positioning, there are some bugs here)
|Serial Interface Circuit|
The next time we will start talking to the Microcontroller.