Hello I am trying to configure the TWR52259 UART 2 as interrupt UART to test the PPP (Point-to-Point) Example Application. The problem is that I need to use the UART1 UCTS1 and URTS1 pins (Tertiary function of PUBPAR ports 2 and 3: UTXD2 and URXD2).
First. I tried to test the printf function (Default IO channel) for the UART 2 to see if everything was right for that UART but I Cannot see anything on my console.
I have made the following changes to the BSP to configure the Default IO Channel to the TTYC:
1. Change the Default IO chanel definition in twrmcf52259.h file:
BSP_DEFAULT_IO_CHANNEL "ttyc:"
2. Enable TTYC in user_config.h file:
#define BSPCFG_ENABLE_TTYA 1
#define BSPCFG_ENABLE_TTYB 0
#define BSPCFG_ENABLE_TTYC 1
#define BSPCFG_ENABLE_ITTYA 0
#define BSPCFG_ENABLE_ITTYB 1
#define BSPCFG_ENABLE_ITTYC 0
3. Change the PUBPAR ports 2 and 3 to the tertiary function (case 2) at the _bsp_serial_io_init function as next:
_mqx_int _bsp_serial_io_init
(
uint_8 dev_num
)
{
VMCF5225_STRUCT_PTR reg_ptr = _PSP_GET_IPSBAR();
switch (dev_num) {
case 0:
reg_ptr->GPIO.PUAPAR |= 0
| MCF5225_GPIO_PUAPAR_TXD0
| MCF5225_GPIO_PUAPAR_RXD0;
break;
case 1:
reg_ptr->GPIO.PUBPAR |= 0
| MCF5225_GPIO_PUBPAR_TXD1
| MCF5225_GPIO_PUBPAR_RXD1;
break;
case 2:
/*tertiary function of PUBPAR ports 2 and 3*/
reg_ptr->GPIO.PUBPAR |= 0
| MCF5225_GPIO_PUBPAR_TXD2
| MCF5225_GPIO_PUBPAR_RXD2;
/*FOR NORMAL UART 2, commented*/
/*reg_ptr->GPIO.PUCPAR |= 0
| MCF5225_GPIO_PUCPAR_TXD2
| MCF5225_GPIO_PUCPAR_RXD2;*/
/*FOR NORMAL UART 2, commented*/
break;
default:
return -1;
} /* Endswitch */
return 0;
}
I don't know what I am doing wrong or what else I need to do to make printf function works in TTYC in the UART1 UCTS1 and URTS1 pins.
Once I ensure the TTYC works fine I will proceed to the next step: test the PPP (Point-to-Point) Example Application in UART 2 .
My objective is to get GPRS connectivity through PPP and a MODEM
Can anyone help me or giveme some advice to achieve my objective.
I will appreciate that.
Thank you and my best regards.
Alejandro.