Go Down

Topic: Serial problem (Read 508 times) previous topic - next topic

SuperCow

Dec 10, 2008, 04:09 pm Last Edit: Dec 10, 2008, 04:10 pm by SuperCow Reason: 1
Hello, im using a telit module connected to a arduino.
So far is everything fine, and using AFSoftSerial to make a extra comport
the softwareserial is connected to the telit, en the main serial is for debugging.

This works all fine, but time to time im losing a few chars, or there come strange chars out.

So i figured out that ill connect the telit to the main serial (port 0 and 1)
and using the software serial to debug (using Mini USB Adapter to get it to my computer).

now the debug works fine, but i cant get a connection to my telit whatever i do.

I used different baud rate's, switch tx/rx
i just dont get anything from the telit

How is this possible that the softwareSerial works perfect on the telit but not the hardware serial?

trialex

Since you said you have tried switch tx/rx, and changing baud, it sounds like the most likely culprit is that you have made a mistake in your code somewhere - perhaps you forgot somewhere to change the AFSoftSerial() command to a normal serial() command...

Ofcourse without posting your code, only you can tell...

Cynar

The issue your having with the Software serial is probally buffering. The main serial port has a 128 character buffer. When you use Serial.read it goes to the buffer. This allows the board to receive data mid calculation and pick it up later. The software ports have no buffer. if your not listening when the data comes in it is lost. if you start listening halfway through a character it will come back as gibberish.

P.S if you find a way to buffer both, please tell me, it's a pain in the backside with a program I'm writing.

Cynar

SuperCow

The AFSoftSerial has a buffer of 64 chars

I can show some , code, i havent saved it, but i think i can repoduce some simple code. Ill do that later

Go Up