Hello,
I'm currently working on a MCB08 module (http://www.embeddedsys.com/subpages/products/mcb08.shtml) which has a MC9S08GB60 as its core.
My application needs to use both SCI interfaces available. The simplest requirement would be to pass data received from one SCI to the other.
The MCB08 comes with one DB9 port, which I am successfully using at 230400 baudrate with SCI1. When I try to use SCI2 (RxD pin, no DB9), the data I receive seems to match the amount I <should> be receiving, but the data itself is non-sensical. The grounds are shared and the SCI2 configured properly.
I have tried this with both polled and interrupt methods. I have tried directly connecting the RxD to the other module's (not freescale) Tx pin, which uses the same voltage logic levels. I have tried using a level-shifter (MAX3232) and DB9 connection between the MCB08 and the other module. I have tried a completely different module (with all of the above variations). It is always the same. I receive characters when I should, but the characters are wrong. I've tested the functionality of the modules using my computer's serial port, and my computer receives the right data. One of the modules uses ~38000 baudrate while the other uses 9800 baudrate. I have also tried inverting Rx/Tx pins of the DB9 at every possible time.
One interesting note is data that I send out from SCI2 is similarly garbled (with my computer receiving it).
The MCB08 has jumpers that can choose which SCI port uses the onboard DB9 connector. In the above tests, the problematic SCI of course does not use this connector. What baffles me is, if I set SCI2 to use the on-board DB9 using those jumpers (without using SCI1), everything works perfectly. Whenever I try to use the pins themselves do I run into trouble.
I'm not sure where to go from here. Any help would be appreciated.
Thank you.
Hello,
Keep in mind that the MAX3232 provides polarity inversion of the data. If the data received from the other device is correct with the level converter in place, the received data polarity obviously requires an inversion by some means, for correct operation of the SCI module.
Regards,
Mac
Hello,
In the MAX3232 the signal is sort of inverted. a high becomes a negative voltage and a low becomes a positive one. Mostly you don't need to concern yourself with this as the inversion (if thats what it is called) is undone at the other end by the converter used there.
Normally:
TTL TxD--------MAX3232-----------MAX3232----------TTL RxD
TTL RxD-------MAX3232-----------MAX3232----------TTL TxD
The levels at either end will match and be correct.
I see you were referring to the RS232 specification and not the MAX3232 in specific. It seems the logic inversion is not the problem as both sides use RS232 transceivers. I also get the exact problem when interfacing directly with the UART of a module with exactly the same voltage/logic levels. Would you by any chance know any other possible reasons for my problem?
Thank you.
Hello,
My understanding of your original post was that the third-party board provided a data output with 3 volt logic levels, and that you wished to directly interface with the RXD2 pin of the 'GB60 device. But this did not work. You also seemed to indicate (as a final comment) that, when a RS232 receiver within the MAX3232 device, was then interspersed (with the 3 volt logic output level presumably just sufficient to drive the receiver), the operation seemed satisfactory. Are these details correct?
Yes, the RS232 receiver does provide logic inversion, and it would seem that the third-party board probably provides inverted 3 volt logic output. This would mean that the signal should be inverted before being applied to the RXD2 pin.
Check the voltage output from the third-party board during data idle condition. If logic high the signal is normal, and if logic low the signal is inverted.
Although the use of the RS232 receiver may appear to correct the problem, it is not designed for 3 volt logic at the receiver input, and may not always be reliable.
Regards,
Mac
Hello,
A MAX3232 device does indeed work correctly at 3 volts. It is the low voltage version of the venerable MAX232.
I presume you are quoting that device because that is what the board manufacturer has used on SCI1.
Hello Peg,
The operating supply range for the MAX3232 device should not be confused with the logic switching levels for the receiver input, which would normally accommodate RS232 voltage swings. As it turns out, the worst case switching thresholds are actually 0.8 volt and 2.4 volt, so would switch correctly with an applied signal swing of 0 to 3 volts. This was my initial concern when it seemed that the OP might be testing/operating in this manner.
Regards,
Mac
Hi bigmac,
Sorry to have confused you. The device I am trying to interface with also has an RS232 transceiver. So I have tested with two configurations: 1) bypass RS232 at both ends and interface directly with the 2 UARTS ( same voltage). 2) use RS232 at both ends. I don't try to connect the TTL level directly to the RS232 input
One clarification.
All of the devices above use 8N1 with no parity. The SCI is configured as such.
Hello and welcome to the fora.
It would seem from your description that you are simply not converting the TTL level chip signals to RS-232 levels at a DB-9.
This should simply be a matter of duplicating the circuit already present on SCI1.
I have used a GB60 (and a GT16A) as a kind of protocol converter where the GB60 goes in the middle of a cable between two devices using different communications protocols. I am using both SCI's at once with different baudrates without any issues.
Hi,
My experience is only with low data rates. I know of others that use very high rates though.
Bear in mind that at these rates you start to run out of processing time to manage 2 outgoing and 2 incoming data streams. If it seems to be almost working, I would halve the baudrate and see what happens.