SCI on PAN82154 (GT60)

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

SCI on PAN82154 (GT60)

2,514 Views
SyaZ
Contributor I

Hello.

 

I have been stuck trying to get Serial Communication Interface on this low power module for days! Let me explain:

 

-PAN82154HAR00 with MCU S08GT60 (Based on SARD)

-Started with Freescale BeeKit SMAC demo: PER test

-Everything worked after some header modifications to support my module. Except nothing is displayed on my Hyperterminal. Baud rate 38.4k, 8-N-1, no flow control setting as suggested by the demo and PAN82154 data sheet. SCI COM port is set to 1

-Learnt that I need to set pin 6 of port C to high, otherwise RS-232 IC will go into sleep mode to conserve power

-Still nothing on Hyperterminal

 

I have tried going through the SCITransmitStr() function step by step in debug mode using CodeWarrior.  I can pretty much understand what it's doing and it appears to be sending a character at a time everytime TX buffer is empty. How can I still not see them on my Hyperterminal? Any idea what I am missing?

 

Really hope someone can shed some light...

Labels (1)
0 Kudos
Reply
6 Replies

1,106 Views
SyaZ
Contributor I

Hello again.

 

After further reading on DTE and DCE I became convinced that I need to do the cross-over, and I did, and it worked.

 

Can't believe how simple the solution to such a troublesome problem.  =/

 

Thanks for all your help bigmac.

0 Kudos
Reply

1,106 Views
SyaZ
Contributor I

>In the absence of an oscilloscope, you might be able to make use of a "break-out box", that will reveal the voltage state on each line associated with a RS232 9-pin connector, using bi-directional LEDs.  You might be able to observe the LED flicker as data is sent, to confirm the presence of data on a particular line.

 

Thanks for the suggestion, but I've already got permission to use the lab with o-scope on Friday so I'll use that.

 

>When you measured the static voltages on the data lines, was this with the other end of the cable connected to the computer serial port, or with no cable?  The latter would seem to be indicated by your voltage readings, or perhaps an incorrect or faulty cable.

 

I measured it on the other end of the cable connected to the module, should be the same as reading from the pin itself, I think.

 

>With no cable connected, the pin number of the 9-pin (DB9) connector on which you observed -9 volts --- was this pin-2 or pin-3?  Pin-2 would suggest a DCE configuration (straight cable), and pin-3 a DTE configuration (cross-over cable required).  The voltages should be relative to pin-5 (ground).

 

 Pin 3 (TX) is the one giving -ve reading, with or without cable connection. So I need to swap the TX and RX connection on the module, right?

 

 

Thanks a lot.

0 Kudos
Reply

1,106 Views
SyaZ
Contributor I

First of all THANK YOU for the reply. At last some direction. Serial comm is the key to my project and without it the development is pretty much halted.

 

Now some answers and questions:

 

>I suggest that you check out the hardware connections, using an oscilloscope.

 

I have a multimeter, is that sufficient?  I can however find that creature in one of my University's lab, but I need your instruction as to what do I do with it...

 

>Then check the output of the RS232 voltage converter, and the output pin of the DB9 connector on the board.  At this point, also check that that the voltage swing at the pin is both positive and negative, approximately +/-9 volt, otherwise the converter might have been bypassed.

 

I've checked it many times before and the result is consistent, 0.065 V on RX wire and about -9 V on TX wire. Is that what you mean?

 

>You should also confirm that the connector is configured as a data communication equipment (DCE), to be directly compatible with the serial port on the computer, which is wired as data terminal equipment (DTE).

 

How do I check?

 

Please if possible be as clear as you can, as I'm new to all these stuff. Thanks in advance.

0 Kudos
Reply

1,106 Views
bigmac
Specialist III

Hello,

 

A multimeter will only provide a measurement of static voltage levels.  It will not respond quickly enough to reveal whether data is present on a line.

 

In the absence of an oscilloscope, you might be able to make use of a "break-out box", that will reveal the voltage state on each line associated with a RS232 9-pin connector, using bi-directional LEDs.  You might be able to observe the LED flicker as data is sent, to confirm the presence of data on a particular line.

 

When you measured the static voltages on the data lines, was this with the other end of the cable connected to the computer serial port, or with no cable?  The latter would seem to be indicated by your voltage readings, or perhaps an incorrect or faulty cable.

 

With no cable connected, the pin number of the 9-pin (DB9) connector on which you observed -9 volts --- was this pin-2 or pin-3?  Pin-2 would suggest a DCE configuration (straight cable), and pin-3 a DTE configuration (cross-over cable required).  The voltages should be relative to pin-5 (ground).

 

When a cable is connected to the computer, the static voltage at the other data pin should also be about -9 volts, as sourced from the computer serial port.

 

Regards,

Mac

0 Kudos
Reply

1,106 Views
SyaZ
Contributor I

Man, how hard is this really? From what I've found and read it's just a matter of writing a byte to SCI1D to transmit that byte via serial to the PC, and read from it for RX... right?

 

And of course I've initialized SCI1BDL and SCI1BDH with their proper values, set bit SCI1_TE and SCI1_RE, and wake up the SCI IC by setting PTCDD_PTCDD6 = 1 and PTCD_PTCD6 = 1. What am I still missing? Nothing came out on my terminal and the module is not receiving any too.

 

Here's my code:

 

 

void main(void) {         byte T = 'A';  byte R = ' ';    EnableInterrupts; /* enable interrupts */  /* include your code here */         PTCDD_PTCDD6 = 1;  PTCD_PTCD6 = 1;  SCI1BDL = 13;  SCI1BDH = 0;  SCI1C2_TE = 1;  SCI1C2_RE = 1;    while(!SCI1S1_TDRE);  SCI1D = T;          for(;;) {      if((SCI1S1 & SCI1S1_RDRF) == 1) {      PTDDD_PTDDD0 = 1;      PTDD_PTDD0 ^= 1;      R = SCI1D;    }        __RESET_WATCHDOG(); /* feeds the dog */  } /* loop forever */  /* please make sure that you never leave main */}

 

I transmit T and wait for RDRF to be set to receive char from RX line, and toggle the LED as indication. SCI1D gets reset right away after it's assignment with T, so I assume it already sent T, correct?

 

0 Kudos
Reply

1,106 Views
bigmac
Specialist III

Hello,

 

I suggest that you check out the hardware connections, using an oscilloscope.  As you send each character, check that the data appears at the appropriate TXD pin of the GT60. Then check the output of the RS232 voltage converter, and the output pin of the DB9 connector on the board.  At this point, also check that that the voltage swing at the pin is both positive and negative, approximately +/-9 volt, otherwise the converter might have been bypassed.

 

You should also confirm that the connector is configured as a data communication equipment (DCE), to be directly compatible with the serial port on the computer, which is wired as data terminal equipment (DTE).  If the board is DCE, you would use a straight-through cable.  However, if the board happens to be DTE, a "null modem" (cross-over) cable will be required.

 

Regards,

Mac

 

0 Kudos
Reply