Pages: [1]   Go Down
Author Topic: MAX232 and FTDI and Arduino  (Read 2270 times)
0 Members and 1 Guest are viewing this topic.
Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 276
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hy

I got a problem with a MAX232.
So I got a circuit that is decoding a FSK signal and converting it with a MAX232 so that I can read
it with a Serial Monitor Programm on a PC.
For my Laptop I use a Serial to USB cable to hook it up to an USB port:
http://www.frontierpc.com/cables-adapters/connector-cables/misc/products/iogear-usb-pda-serial-adapter-guc232a-10033386.html
This works without a problem.

So now I would like to use the Signal coming from the MAX232 directly with an Arduino. This should be possible by just connection it
to the UART (Pin 0) to receive the Signal. However I do receive something with my Arduino UNO but with the Arduino Mega the port is silent.
With the UNO a lot (all) of the bytes get lost or are corrupted so you can't read the signal it is strange.

The same is true when I use a FTDI Basic Breakout board from Sparkfun. I can read the Signal with my computer but it is not usable for further decoding.

So why is this do I need some filters? Why is it working with the Serial to USB cable?

Thx for your Help,
Andy
Logged

Brasil
Offline Offline
Sr. Member
****
Karma: 2
Posts: 315
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe the buffer of ONE UART not have size enought to data sent.
I testing shiftOut examples when try put more that 30 chars on Arduino IDE Serial monitor same chars have lost.
If I understand, Arduino.cc Serial.Avalaible() the size of receive buffer is 128bytes
http://arduino.cc/en/Serial/Available

Logged

4x Duemilanove (clone)
Uno torrado (clone)
Amiga 1200 40MB
Windows XP


Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 276
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The buffer those fill up quite fast in 3 seconds 128byte are full however
since it does not work with the Sparkfun Break out board it must be something different....

Thx
Andy
Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 159
Posts: 2916
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
With the UNO a lot (all) of the bytes get lost or are corrupted so you can't read the signal it is strange.

When someone says something like this, it usually means the baudrates are not set the same on
all devices.
Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 276
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

hmm ok so is their a terminal program where I can choose baud rates that are not exact as the known one?
But why is the Serial to USB cable working?

Thx
Andy
Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 159
Posts: 2916
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


EVERY terminal emulator program allows you to set baudrate, including the Serial Monitor in the
Arduino IDE. When you connected the GUC232A [which I happen to have too], you needed to
select comport and baudrate values.

In your Arduino sketch, you need to setup the serial port

Code:
void setup()
{
  Serial.begin(9600);
}

or proper baudrate to match the PC end.

 
Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 276
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

but since I probably need to use a 2621 baud rate and not 2400 I can't set that with my terminal programs eg. zoc, hterm, x-ctu
Yes with the Arduino it might be possible but since I like to test it first with the Sparkfun Break out board I need another
terminal program.

Still no one could answer me why the Serial to USB cable mentioned does work and the Sparkfun don't...

Thx
Andy
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 129
Posts: 8604
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So now I would like to use the Signal coming from the MAX232 directly with an Arduino. This should be possible by just connection it to the UART (Pin 0) to receive the Signal.

a) The -+12v levels will probably blow up the Arduino
b) The data is inverted with RS232

Quote
Why is it working with the Serial to USB cable?
Because that adaptor appears to be designed for RS232, the Arduino is not.
______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 276
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok thx for the answer.
So maybe something like this would help?
http://www.cutedigi.com/pub/Arduino/arduino_RS232.pdf
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 129
Posts: 8604
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yep, or DIY with a MAX232/202.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 159
Posts: 2916
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think Graynomad is right, I was confused about your hookup. You cannot connect
+/-12V out of a MAX232 directly to the Arduino. But even if you use a second MAX232
to convert back to 0-5V, you still cannot connect that signal to pin 0 [RX] on the
Arduino header, as then the signal will interfere with the USB port on the UNO board.
Logged

Brasil
Offline Offline
Sr. Member
****
Karma: 2
Posts: 315
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I will change way.
I told with my friend and maybe new versions of AVR libs have problems with communication serial and Arduino MEGA,
Today we have  communications OK with UNO, but only can communicate with Mega using a old linux instalation on my friend computer, that have old versions of AVR libs.

Logged

4x Duemilanove (clone)
Uno torrado (clone)
Amiga 1200 40MB
Windows XP


Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 276
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

yes, finally got it working, thx for all your help!!!! Great now I can work on the code smiley

Thx to all of you!!!
Andy
Logged

Brasil
Offline Offline
Sr. Member
****
Karma: 2
Posts: 315
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What are do you to work fine?
Logged

4x Duemilanove (clone)
Uno torrado (clone)
Amiga 1200 40MB
Windows XP


Pages: [1]   Go Up
Jump to: