This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problems with the Touch Interface and I2C

Good afternoon,

using here the STM32F429ZIT6 Discovery board and Keil uVision 5.14
I am developing a prototype for a DSP project with a GUI that makes use of the touch screen.
The DSP part works ok, as it does the GUI display built with GUIBuilder.
The problem is in the touch interface... the touch controller makes use of the I2C3 port, which has been configured as per the example program contained in apnt_268, i.e. with I2C3_SCL assigned to PA8 and I2C3_SDA assigned to PC9.

What happens is that the program apparently hangs. I traced its execution and found this sequence of calls :
GUI_Init => GUI_X_Init => GUI_TOUCH_Initialize => Touch_Initialize => Touch_Write

Inside Touch_Write there is this statement :

  while (ptrI2C->GetStatus().busy);

Well, that is where the program hangs... it looks like the I2C controller is always busy and the while loops continuously...

Does anybody have words of wisdom to help me to surpass this impasse ?
Thanks

Alberto

Parents
  • Well, it looks like I solved myself the problem, though not in the most satisfactory way...
    I saw in routine I2C_STM32F4xx.c these statements :

            case ARM_I2C_BUS_SPEED_FAST:
              /* Clock = 400kHz,  Rise Time = 300ns */
              if (pclk > 42000000U) { return ARM_DRIVER_ERROR_UNSUPPORTED; }
    


    The "if" was satisfied, as pclk had the value 45000000, so the routine returned with the error code ARM_DRIVER_ERROR_UNSUPPORTED.

    At this point I reduced the clock speed from 180 MHz to 168 MHz, and.. lo and behold.. everything now worked....

    Given that I have to do DSP computations at the maximum possible speed, I would have preferred to have the processor running at its maximum speed of 180 MHz... does anybody know if there is the possibility to convince the I2C interface to function also at that speed ?

    Thanks

    Alberto

Reply
  • Well, it looks like I solved myself the problem, though not in the most satisfactory way...
    I saw in routine I2C_STM32F4xx.c these statements :

            case ARM_I2C_BUS_SPEED_FAST:
              /* Clock = 400kHz,  Rise Time = 300ns */
              if (pclk > 42000000U) { return ARM_DRIVER_ERROR_UNSUPPORTED; }
    


    The "if" was satisfied, as pclk had the value 45000000, so the routine returned with the error code ARM_DRIVER_ERROR_UNSUPPORTED.

    At this point I reduced the clock speed from 180 MHz to 168 MHz, and.. lo and behold.. everything now worked....

    Given that I have to do DSP computations at the maximum possible speed, I would have preferred to have the processor running at its maximum speed of 180 MHz... does anybody know if there is the possibility to convince the I2C interface to function also at that speed ?

    Thanks

    Alberto

Children