minicom does not send data


11 posts
by Flav » Mon Apr 08, 2013 2:40 pm
Hi there,

I am currently trying to set up a RS232 link and have issue using minicom.
Right now I am testing the communication with my computer (windows xp) and hyperTerminal and the Pi and minicom (settings: 38400 8N1 both sides and /dev/ttyAMA0 for the Pi).

The fact is when I type characters on hyperTerminal they are displayed on minicom but when I type characters on minicom nothing happens on hyperTerminal screen.

I spy the RS232 communication thanks serial port monitor and I have the confirmation that no characters go from the Pi to the computer.

I saw that some people get rid off this problem by setting flow control to "off" but doesn't work for me (flow control disabled in hyperTerminal and minicom).

I made a test with a small C programm and the result is the same, the communication is one-sidded. The write() function seems to don't work.

Any idea that could help ?

Thank you
Flav'
Posts: 7
Joined: Mon Apr 08, 2013 2:25 pm
by klricks » Mon Apr 08, 2013 5:18 pm
What are you using for RS232 converter? USB or ttl to RS232 module?
You could test by doing a simple loopback. Remove the RS232 module and connect the GPIO pins TX and RX together and see if characters are getting through.

If you want a simple GUI communication program then try cutecom.
see details on my web site.
http://64.13.91.137:86/Comp/RPi/Rpi.html
Go here for my RPi writeup. Basic config, Serial Port add-on etc:
http://home.budget.net/~klricks/Comp/RPi/Rpi.html
Posts: 1322
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
by Flav » Tue Apr 09, 2013 6:54 am
I use a max232 to convert signals from RX/TX pins.

I made a simple loopback between RX and TX pins and no characters are going through.

Concerning cutecom, a GUI is not a priority but I keep it in my mind.
Posts: 7
Joined: Mon Apr 08, 2013 2:25 pm
by klricks » Tue Apr 09, 2013 12:35 pm
Max232 is NOT the correct chip. That's a 5V chip.
If using a MAX232 then you have extra level converter circuits (3V3 to 5V)
http://www.amazon.com/SparkFun-Logic-Level-Converter/dp/B004G58W28/ref=sr_1_1?ie=UTF8&qid=1365510726&sr=8-1&keywords=3.3+to+5V+level+converter

If no level converters then you need to use a MAX3232 chip or equivalent such as the ADM3202.
The chip must be powered by VCC 3V3.
Go here for my RPi writeup. Basic config, Serial Port add-on etc:
http://home.budget.net/~klricks/Comp/RPi/Rpi.html
Posts: 1322
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
by Flav » Tue Apr 09, 2013 1:43 pm
Are you sending me your mind ?
I was checking the max datasheet and, indeed, it works better with 5v.

Why adding an extra circuit while there is a 5v pin on the Pi?
Posts: 7
Joined: Mon Apr 08, 2013 2:25 pm
by joan » Tue Apr 09, 2013 1:46 pm
The Pi's TX/RX gpios are 3.3V (as are all the Pi's gpios).
User avatar
Posts: 5425
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK
by Flav » Tue Apr 09, 2013 1:48 pm
joan wrote:The Pi's TX/RX gpios are 3.3V (as are all the Pi's gpios).

I agree with this but what is the matter powering the max with the Pi 5v pin ?
Posts: 7
Joined: Mon Apr 08, 2013 2:25 pm
by klricks » Tue Apr 09, 2013 2:00 pm
Flav wrote:Are you sending me your mind ?
I was checking the max datasheet and, indeed, it works better with 5v.

Why adding an extra circuit while there is a 5v pin on the Pi?


The Max232 chip is a 5V chip and needs 5V only, but the GPIO pins on the RPi are NOT 5V they are 3.3 Volt!
Using 5V logic levels will likely destroy your RPi. (Burn out the TX and/or RX pins).

The Max3232 runs on 5V or 3V3. Since the RPi is 3V3 logic levels then you need to power the Max3232 chip from the 3V3 power source (GPIO pin 1).
Go here for my RPi writeup. Basic config, Serial Port add-on etc:
http://home.budget.net/~klricks/Comp/RPi/Rpi.html
Posts: 1322
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
by mahjongg » Tue Apr 09, 2013 4:12 pm
A MAX323 will work, but you will need to divide the 5V signal from the MAX323 with a resistor divider so that it is converted to a 3V signal (2K2 top and 3K3 bottom will work well). The 3V3 signal from the PI will be no problem for the input of the MAX323.

The PI has diodes in the GPIO port between GND and 3.3V. If you connect a hard 5V (such as is coming out of a 5V powered logic) to a PI's GPIO port the diode connected between 3.3V and the GPIO pin will start to conduct and the 5V will reach the 3.3V supply and lift it up to levels that will cause damage to all 3V3 powered logic! In principle even an 1K resistor in the path will be enough to prevent this from happening, but a resistor divider is a better solution.
User avatar
Forum Moderator
Forum Moderator
Posts: 5272
Joined: Sun Mar 11, 2012 12:19 am
by Flav » Thu Apr 11, 2013 6:47 am
Thank you for your help and for the precisions given, I will check for the solution that fits the best to me.
Posts: 7
Joined: Mon Apr 08, 2013 2:25 pm
by gbmhunter » Sun Jan 05, 2014 11:59 pm
Also, make sure that you have hardware flow control turned off in minicom serial settings if your hardware does not support it, else minicom will wait indefinitely until the serial device is "ready".
Posts: 1
Joined: Sun Jan 05, 2014 11:49 pm