MC9S08PT60 SCI0 on PTA3 PTA4 TX PIN wont work

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

MC9S08PT60 SCI0 on PTA3 PTA4 TX PIN wont work

Jump to solution
996 Views
carlnormansuret
Contributor V

Hi Guys,

 

I have the MC9S08PT60 processor (44pin), I am using all three SCI UART modules in my application, 2 work perfectly fine (SCI1 and SCI2). SCI0_RX works, but SCI0_TX just wont work.

 

I have SCI0 on PTA2/3 (44pin package, pins 33/32). I changed SYS_SOPT1 bit 7 to 1 (Confirmed with debugger so mapping is correct)

/* SYS_SOPT1: PTA3/PTA2 SCI0, BKGDPE=1,RSTPE=1,FWAKE=0,STOPE=0 */

  clrSetReg8Bits(SYS_SOPT1, 0x03U, 0x8CU);

 

Using processor expert for a really simple test I set internal clock to 16Mhz, added SCI0, added SCI1, set both to 9600baud, modified SYS_STOP1 bit 7 to 1 as above, then added basic test code just to see TX data on each SCI module

  {

   setReg8(SCI0_C2, 0x0CU);           //Enable TE / RE

   setReg8(SCI1_C2, 0x0CU);          //Enable TE / RE

  while(1)

  {

       if(SCI0_S1_TDRE) SCI0_D = 0x31;                 //Setup next byte to transmit on the comm port

       if(SCI1_S1_TDRE) SCI1_D = 0x31;                 //Setup next byte to transmit on the comm port

  }

 

Using my oscilliscope and measuring the bare board PIN with nothing attached (PIN32)

SCI1 I see data on the bare output PIN perfectly fine at 9600baud

SCI0 i see nothing ever on the data PIN.

 

Also, I set up RX interrupts to see if the RX interrupt fires and I get valid data, which i do, on both SCI0 and SCI1! I also use this code (with no real changes other than names on the AC128 and it works in production no problem)

 

If I turn the pin to and output it toggles on and off no problem, and RX input works, TX/RX work on the other SCI ports. I cant find anything else you have to do to get this TX module to work, im stuck! I can only imagine there is a problem with these chips, or, some documentation I cant find.

Labels (1)
0 Kudos
1 Solution
522 Views
vicentegomez
NXP TechSupport
NXP TechSupport

Hi Carl

As I remember the PTA2 and PTA3 are true open drain pin.  You need to add a pull up, I do not remember if you can use the internal pull up or need to add and external pull up

Regards

Vicente

View solution in original post

0 Kudos
4 Replies
523 Views
vicentegomez
NXP TechSupport
NXP TechSupport

Hi Carl

As I remember the PTA2 and PTA3 are true open drain pin.  You need to add a pull up, I do not remember if you can use the internal pull up or need to add and external pull up

Regards

Vicente

0 Kudos
522 Views
carlnormansuret
Contributor V

Ok, so the documentation is wrong, or at least very misleading. In short, the SCI module drives the output drive circuit, and PTA3 is open drain, so, you need a hard pullup on the OUTPUT PTA3 SCI0.

The SCI block diagram should not show the SCI output directly connected to the output pin, it should be connected to the port drive circuit so its clear that they are dependent on how those pins are driven.

Section 2.2.6

"The pulling devices are disengaged when configured for output mode except when PTA2 and PTA3 are used as SDA and SCL function."

should read as:

"The pulling devices are disengaged when configured for output or SCI mode. When PTA2 and PTA3 are used as SDA and SCL function pullups remain engaged."

And

"PTA3 and PTA2 provide true open drain when operated as output."

should read:

"PTA3 and PTA2 provide true open drain when operated as output. This also applied when SCI0_TX is mapped to PTA3"

0 Kudos
522 Views
Stano
NXP Employee
NXP Employee

Hi Carl,

the internal pull-up resistors are usable, but they are weak. I suggest you to use the external pull-ups about 5-10k.

Best Regards,

Stano.

0 Kudos
522 Views
carlnormansuret
Contributor V

The pull up cannot drive the gate of a BSS123, it appears to be disengaged as the SCI drives the output circuit for PTA3, and the pullups only work in I2C mode according to the reference manual.

0 Kudos