FTDI checking and STM32 USART output

This is a quick blog to record how to prove your FTDI module is working.

This is the device in question and it doesn't need to be inserted or connected to anything.

Step 1) Are the FTDI drivers installed into your PC (Assuming that your are developing on the PC)

If not  go to the FTDI site download and install. Check the chip type used on the board mines is an FT232RL chip. I downloaded the  CDM21228_Setup.exe and ran this for an install.  This is essential as the vitual COMport will not be recognized.

I am using MiKroC USART terminal program but equally good is the PuTTY terminal program.


Step 2)  Next place a wire to connect the RX to TX on the pins. We are effectively shorting the transmit to Receive on the FTDI.
If you look at the USART terminal above, whatever you send out on the TX PIN will be reflected back on the RX.  Case solved.  Drivers' installed and FTDI is ready to start working for you...


Step 3) What are we seeing?



The lower box is showing a real mess of characters  ( fortunately I know that the program should be sending out correct information as I have already been through that pain.  But in this case its very different.

I am faced with 2 choices

1)  The output signal is being loaded up and the characters are being interpreted differently as the voltage levels is not quite correct.  This is highly likely as I have added on a new circuit which has not been connected up before.  To prove that ; we will remove the output circuit and see if this changes things.
2) My STM32F030 clock rate is incorrect ( or the USART is not set up properly); this is in fact quite a common occurence. A quick way of checking is to cycle through high and lower bitrates on the USART terminal .  This then shows that the internal STM32 clock rate is not setup properly for instance I have programmed to receive at 57600bps but it works at 9600bps then the clock rate is out by a factor of 6  (57600/9600).  I tried this and couldn't see anything popping up (remember I already had this working but unconnected so I should have debugged the clock settings.

A quick check of the program

Against the Terminal settings:

 This all checks out so we are back to my first choice.  Output loading /attenuation.


 So R7 is not in circuit R6 sit in series with C12  a 470nF decoupling capacitor into the FM circuit. The output of the STM32 is 2.8V  to 3.3V. My FTDI chip is on the otherside of the 100K resistor. Now the tuning range of the circuit is 0V to 2.4V and we superimpose the signal onto this dc Bias.

So firstly we are on the wrong side of R6 as the connection was probably used to feed a 100mV pk to pk sine wave into the circuit.

It looks like this may be transmitting but we need to delve into the analogue side once we see the real data being sent and can measure the signal at R5.

So with the signal placed on the other side of R6 to get the full voltage swing.
Lo and behold ....

 

 OK so the values are quite screwy but the circuit is outputting data to the FM transmitter.

Comments

Popular Posts