Can I use the 3rd Uart on the M52233Demo board?

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

Can I use the 3rd Uart on the M52233Demo board?

1,152 Views
terryt
Contributor I

Hey Guys,

 

Does anybody know if and how I can use the 3rd uart (UART 2) on the M52233Demo board?

I believe it's doable by using the SCL & SDA pins as UTXD2 & URXD2. 

 

 This is the table from the Pin Functions:

 

MCF52235 ColdFire® Integrated Microcontroller Reference Manual, Rev. 5

 

SCL & SDA Alternate functions.

  

 SCL   CANTX4    UTXD2  PAS[0]   PDSR[0]

 SDA   CANRX4   URXD2   PAS[1]   PDSR[0]

 

 

 

I'm using the Inter-niche program. I'm Defining the pins like this: 

 

MCF_GPIO_DDRAS = (0
        | MCF_GPIO_DDRAS_DDRAS1); //only AS1 or UTXD2 is an output. 

 

MCF_GPIO_PASPAR = (0
       | MCF_GPIO_PASPAR_SDA_URXD2
            | MCF_GPIO_PASPAR_SCL_UTXD2);

 

The demo board is an 80 pin part that doesn't have a UTXD2 or URXD2 primary pin. SDA & SCL in an  alternate purpose is the way to create a 3rd UART. The question I have is when an interrupt is created where is the vector interrupt? Where UTXD2 & URXD2 normally are? It's not working.

 

 Any ideas?  

 

TT

Labels (1)
0 Kudos
Reply
1 Reply

458 Views
mjbcswitzerland
Specialist V

Hi TT

 

On the 80 pin M52233 the UART2 can be connected to the AS or the UB ports. Otherwise its internal workings are identical to when it available on UC.

 

UART2 TX = AS[0] or UB[2] - tertiary function

UART2 RX = AS[1] or UB[3] - tertiary function

 

1) You don't need to  set DDR when configuring a UART - just sets its tertiary function. You seem to have set AS1 to an output. This is Rx and not Tx.

 

2) PASPAR is a quad pin function register. To set the tertiary function you need to set two bits to '1'. To set UART2 TX 0x03

To set UART2 RX 0x0c

Therefore for both, use 0x0f

 

Regards

 

Mark

 

www.uTasker.com

0 Kudos
Reply