Re: Trying to send RS232 with PIC sends incorrect data in TeraTerm



On Apr 11, 1:49 pm, "Roger Hamlett"
<rogerspamigno...@xxxxxxxxxxxxxxxxxxx> wrote:
<jbit...@xxxxxxxxx> wrote in message

news:1176252759.067057.96530@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> So we shortened the message to just output "A".

The display on the Tera Term is now "_" (underscore)

The binary for A is 1000001
The binary for _ is 1011111.

Just an update.

Ok.
Now multiple things. If you have download rights for the compiler, 3.249,
is available to download. Install this into another directory, and see if
the behaviour is the same. If so, you have at least ruled this out.
Now, remember that for asynchronous serial, the data is sent LSBit first.
Also, the 'start', requires a '0' (low) at the input, before the data byte
itelf is sampled. Then there is a high 'stop bit' at the end. So, 'A' is:

1010000010x1, with '0' being 0v, and '1' being 5v (the 'x' is the parity
bit, which would depend on whether this is enabled, and how it is set)

The _, is:

1011111010x1

Now the chip will start reading, when it sees a 0v for the first time.
Notice the five successive '1's in the second stream, and the five
successive '0's in the first.
If you invert the bit pattern for the 'A', you get:

0101111101/x0

Notice how if you shift this left one bit, it closely resembles what you
are receiving.
It looks suspiciously like you might be lacking a signal inversion in the
connection to the PIC (RS232 uses -3 to -25v for a '1', and +3 to +25v for
a '0').
Are you sure the converter you have is USB to RS232?. You speak about it
as being expensive, but these are incredibly cheap (well under 10$). I
have a nasty suspicion, that your converter, might be something like USB
to RS485, rather than RS232!. This would explain it's price. While I
agree, that the USB-RS232 converters can sometimes be troublesome, most
now work OK.
I would try the simple test of connecting it to another PC with RS232 (can
you borrow one from a friend?),using just the minimum 3 wire connection
(TX to RX, RX to TX, and GND to GND). At least this will allow you to
'rule out' the unit if it works.
I really would be looking at the snalling polarity, and the connections
round the MAX232.

Best Wishes

Well I'm a poor college student, so 20 dollars is expensive to me ;-)

The data*** for the part indicates USB to rs232 functionality; and
the chip that resides on the breakout board is the cp2102 which lists
as its applications rs232 to USB on its data***.

Here is the sparkfun product page:
http://www.sparkfun.com/commerce/product_info.php?products_id=198

I am not sure what snalling polarity is. Our connections to the
Max232 have been checked by many people, and we have done so according
to the numerous schematics we have found. Also, we know that the Max
works at least for data sent out from the PC and shorted back 'round
through the pins.

.