MCF52233 uart 2 in 80 pin package

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

MCF52233 uart 2 in 80 pin package

1,913 Views
gideonr
Contributor I
Hi,
I am struggling to get uart 2 (the third uart) to work in the 80 pin package. In this package it does not have primary function pins, so I am trying to use pins 79 and 80 in their tertiary mode.
 
I am setting PASPAR to tertiary mode (0xF0). Do I need to set anything else?
 
Thanks in advance,
Gideon.
 
Labels (1)
0 Kudos
4 Replies

485 Views
mjbcswitzerland
Specialist V
Hi Gideon

PASPAR should be set to 0x0f (not 0xf0) and then it should work.

With 0xf0 the pins 19 and 20 are set to FEC_MDC and FEC_MDIO respectively.

 PASPAR |= ((ALT_2_FUNCTION_Q << BIT_0_Q_SHIFT) | (ALT_2_FUNCTION_Q << BIT_1_Q_SHIFT));

 
You may like to take a look at the uTasker simulator (see link below and screen shots on the home page). It can be set up for 80 pin, 121 pin or 112 pin package and displays the function that ports (and pin numbers) can do, as well as the presently programmed one (from the register settings the program has set) so makes correct port register set up very easy to verify.

It displays also the state of GPIO pins and can be used to test input states by toggling with mouse click. If the edge ports have been set up to generate interrupts the simulator will call the real interrupt code so that it can also be verified. (see also
 http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&thread.id=2984 )

Regards

Mark

www.uTasker.com

0 Kudos

485 Views
gideonr
Contributor I
Thanks Mark, that works. Seems the CodeWarrier #define for these pins isn't quite what it should be, I should have spotted that, doh...
 
Gideon.
 
0 Kudos

485 Views
osanz
Contributor I
Hi!
 
I'm trying to use also UART2 on 80 pin MCF52233, but in my case, as i'm using I2C also,  i need to use on pins 15 and 16. This is on UART1   *UCTS1 and *URTS1 pins, isn't it?
 
My setup for this port is MCF_GPIO_PUBPAR |= 0xF0,  and  
 
MCF_GPIO_PUBPAR = 0   | MCF_GPIO_PUBPAR_URXD1_URXD1 | MCF_GPIO_PUBPAR_UTXD1_UTXD1; 
because i use also UART1, ( in fact i need the UART0 also.... ).
             
My problem is when trying to write via printf on this PORT. I already have modified the MCF52233_support.c file to can use "printf()" on UART2 by modifiyng "WriteUARTN()" function, but when the progam calls "uart_putchar()" it stops at:
while (!(MCF_UART_USR(channel) & MCF_UART_USR_TXRDY));
 
Obviusly  MCF_UART_USR_TXRDY flag is not set, but WHY??? I have used the same initialization for the other 2 UARTS without problems...
 
Sure I'm doing something wrong but, what?
 
Thanks;
Oscar.
0 Kudos

485 Views
osanz
Contributor I
Hello again;
 
I have found the problem:
 
 MCF_UART2_UCR = (0
  | MCF_UART_UCR_TX_ENABLED
  | MCF_UART_UCR_RX_ENABLED);
 
The first 0 was a 2??
As I have added support for the 3 UARTS on the "uart_init" function, provably changed it by mistake...
 
Thanks!
 
0 Kudos