Author Topic: I2C use to Uart_2 (tertiary function)  (Read 9172 times)

Offline cpr_01

  • Newbie
  • *
  • Posts: 1
    • View Profile
I2C use to Uart_2 (tertiary function)
« on: September 26, 2007, 09:55:39 AM »
I use MCF52233CAF60 (80 pins) and i need 3 uarts. I use without problem 2 uarts (uart0 and uart1) , but the last i have some difficulty to use it. The pins SCL (79) and SDA (80) must be use in the tertiary function and after i not sure that i can use a standard driver :
        tsci2.Channel = 2;                           
        tsci2.ucSpeed = SERIAL_BAUD_9600;
        tsci2.Rx_tx_sizes.RxQueueSize = RX_OMRON_BUFFER_SIZE;       
        tsci2.Rx_tx_sizes.TxQueueSize = TX_OMRON_BUFFER_SIZE;       
        tsci2.Task_to_wake = TASK_COUPLEUR;                       
        tsci2.usConfig = (CHAR_8 + NO_PARITY + ONE_STOP + CHAR_MODE + DCE_MODE);
        tsci2.ucDMAConfig = UART_TX_DMA;                 
        SerialPortID_2 = fnOpen(TYPE_TTY, FOR_I_O, &tsci2);
        fnDriver( SerialPortID_2, ( TX_ON | RX_ON ), 0 );
If you have one example how to use quad function pins ( uart example)

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: I2C use to Uart_2 (tertiary function)
« Reply #1 on: September 26, 2007, 06:02:36 PM »
Hi

If you have the SP5 you can configure which UART configuration you would like to use in the project file app_hw_m5223x.h.

Look for the serial interface set up (SERIAL_INTERFACE).

You will find the following three lines:

Code: [Select]
  //#define UART1_ON_QS                                                  // alternative UART pin mapping {7}
  //#define UART2_ON_AS                                                  // alternative UART pin mapping (set automatically with 80 pin package)
  //#define UART2_ON_UB                                                  // alternative UART pin mapping

These are the other possible pin mapping configurations.
In fact the 'problem' with UART2 not having its own pins is only encountered if you are using the 80 pin device. In this case it will default to the AS port if opened using channel 2 (make sure that you have the define CHIP_80_PIN active in the file - it is automatically set if you specify use of the M52233DEMO board in config.h, but you can also set it if you are using your own board with this type).

If you prefer to set it to port UB simply comment in UART2_ON_UB.

Finally note that also UART1 can be mapped to port QS rather than use its primary location if you require.

Good luck

Regards

Mark