Problems with only one of two SCI ports (MC9S08GB60)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problems with only one of two SCI ports (MC9S08GB60)

1,876 Views
huio
Contributor I

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.

Labels (1)
0 Kudos
13 Replies

870 Views
bigmac
Specialist III

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

0 Kudos

870 Views
huio
Contributor I
Thank you for your reply. I'm not quite sure what you mean by polarity inversion. I've browsed through the data sheet again and could not find any mention of it. I have to admit I'm far from comfortable with circuits and electrical specifications in general.(http://datasheets.maxim-ic.com/en/ds/MAX3222-MAX3241.pdf) When you say polarity inversion, do you mean voltage polarity? If so, where is the inversion being done? What is the reason for the inversion? As a guess, I assume I need to fix the RX polarity between the MAX3232 and the SCI RxD, and the TX polarity between the MAX3232 and the DB9 Tx pin? And for the most important question: How should I go about fixing this problem (bonus points if you cater the solution to my newbie level of electrical knowledge)? Sorry for bombarding you with so many questions!
0 Kudos

870 Views
peg
Senior Contributor IV

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.

 

0 Kudos

870 Views
huio
Contributor I

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.

0 Kudos

870 Views
bigmac
Specialist III

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

0 Kudos

870 Views
peg
Senior Contributor IV

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.

0 Kudos

870 Views
bigmac
Specialist III

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

 

0 Kudos

870 Views
huio
Contributor I

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 :smileyhappy:

0 Kudos

870 Views
huio
Contributor I

One clarification.

 

All of the devices above use 8N1 with no parity. The SCI is configured as such.

0 Kudos

870 Views
peg
Senior Contributor IV

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.

 

0 Kudos

870 Views
huio
Contributor I
Thank you for your reply. Unless I am misunderstanding you, I am using MAX3232 to convert the signal to RS-232 levels. I'm relieved to hear about your experience with the GB60, although I suspected the MCB08 device rather than the GB60 to be at fault. One question: what was the highest baud rate you have successfully used using on the GB60?
0 Kudos

870 Views
peg
Senior Contributor IV

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.

 

0 Kudos

870 Views
huio
Contributor I
I was hoping you had an answer to another unrelated problem I was having. Using the 230400 module, I cannot get ANYTHING to run if I enable interrupts for the SCI. This happens even if i TX nothing, and dump all data received. I forgot the specifics in regards to how far along the program runs before screeching to a halt, but it had something to do with the interrupt handler (PE generated default). Disabling interrupts and polling fixes this problem. The interesting thing is the same code works perfectly (with interrupts) for a device with lower baud rate (didn't test upper limit). As for my current problem, unfortunately the baud rates of the external modules cannot be configured. But the problem can be replicated by only using SC2 so I doubt it is related to processing time.
0 Kudos