Author Topic: Using both LCD and IIC on the 52235EVB : pin usage  (Read 7982 times)

MarcV

  • Guest
Using both LCD and IIC on the 52235EVB : pin usage
« on: October 02, 2008, 08:34:36 PM »
Hello Mark,
I'm about to set up a configuration using both an LCD and an IIC interface. But the LCD uses both port AS and port TA and - if I'm correct - the IIC interface is an alternative function of some of the pins of one of those same ports.
I believe the IIC interface can be relocated to some other pins also. But from the source I cannot make out which pins are actually used by the IIC interface. Must be me I guess, I'm probably overlooking something... ::)

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Using both LCD and IIC on the 52235EVB : pin usage
« Reply #1 on: October 02, 2008, 10:09:34 PM »
Hi Marc

Check M5223X.c - assuming that you have the later service pack installed it will contain the following:

    #ifdef I2C_ON_QS                                                     // {31}
    PQSPAR |= ((ALT_1_FUNCTION_Q << BIT_2_Q_SHIFT) | (ALT_1_FUNCTION_Q << BIT_3_Q_SHIFT));   
    #else
    PASPAR |= ((PRIMARY_FUNCTION_Q << BIT_0_Q_SHIFT) | (PRIMARY_FUNCTION_Q << BIT_1_Q_SHIFT)); // configure the SDA and SCL pins
    #endif


If you don't use the latest (presently SP8) you can add this.

It sets up the ports for use as I2C pins. If you define I2C_ON_QS (usually in app_hw_m5223x.h) it will configure the project to use the alternative pins rather than the primary ones.

I2C can operate on port AS[0],AS[1] or alternatively on QS[2],QS[3]. The exact pins depend on the package and you can run the simulator to see to verify the port configuration and also the pin numbers.

Regards

Mark

MarcV

  • Guest
Re: Using both LCD and IIC on the 52235EVB : pin usage
« Reply #2 on: October 03, 2008, 03:29:05 PM »
Ah OK...
I've been looking all over the project for the string "IIC" (as it is called in the file iic_drv.c) but not for "I2C". That's probably why I didn't find this...