I am trying to get the touch screen framework working on my custom PCB. I have tried to set up the framework and drivers in the configurator but so far I am not getting the I2C to work at all.
I have used this same touch screen display on a PCB I made to attach to S7G2 dev kit and it works well. Now I have it on my actual product PCB.
Results observed with scope:
- On power on I get a reset on the touch chip
- When screen is touched:
- I get an irq on IRQ7 (P408)
- I see one negative pulse on SCL and that is all
Code observations:
- in r_riic.c I can breakpoint on riic_open_hw_master and I get to this point
- When I touch the screen I can breakpoint inside "R_RIIC_MasterWrite" so the code is seeing IRQ7 and trying to communicate with the touch chip
Setup:
- Framework g_sf_touch_panel_i2c Touch Panel Framework on sf_touch_panel_i2c
- Touch Chip = g_sf_touch_panel_i2c_chip_ft5x06 (correct for my touch panel)
- The rest of the parameters are obvious and set to my display size, etc.
- I2C driver:
- g_i2c I2C Driver on r_riic
- All 4 interrupts set to Priority 3
- Channel = 0
- Rate = Standard
- Slave Address = 0x38
- Address mode = 7-Bit
- Callback = NULL
- Pin configurator / hardware
- My PCB Hardware = Port 4 pin 00 = SCL0_A, Port 4 pin 07 = SDA0_B
- Peripherals:
- RIIC:
- IIC0_PinOption_B:
- Operation mode = Enabled
- SCL0_B = P204
- SDA0_B = P407
- PORTS:
- P407:
- Mode = Peripheral Mode
- Pull Up = none
- Drive Capacity = Medium
- Output type = n-cn open drain
- P407: = SDA0_B
- P407:
- IIC0_PinOption_B:
- RIIC:
- The thread for the display is named hmi_thread
- In hmi_thread_entry.c just before the while( 1) loop:
- g_ioport.p_api->pinCfg( IOPORT_PORT_04_PIN_00, (0x00000000 | IOPORT_PERIPHERAL_RIIC | IOPORT_CFG_DRIVE_MID | IOPORT_CFG_NMOS_ENABLE | IOPORT_CFG_PERIPHERAL_PIN | IOPORT_CFG_PULLUP_ENABLE) );
- This should set up SCL0_A as the SCL pin associated with RIIC channel 0
- In hmi_thread_entry.c just before the while( 1) loop:
I do not understand why I am not getting at least 8 clocks on SCL ???
Any Ideas ???
Thanks,
Steve D