This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52DK + 4 wire resistive touch interface

main.c

We have interfaced 4 pins of touch screen to nRF52DK pins P0.04, P0.05,P0.06, P0.07 and pulled the pin P0.04 high to detect the touch by configuring the pin to sense high to low transistion and it detects the touch first time. No issues there and the IN register confirms the bit P0.04 set to 1 when pulled high. And when a touch is detected, the handler function calculates the x and y position by configuring the pins P0.04 as analog AIN2 and P0.05 as AIN3. The handler function does this calculation as long as it detects touch and when there is no touch it exits and waits for another touch event. However in our case when it configures the pin again to detect touch by pulling the P0.04 high, the corresponding bit in the IN register is not set to 1 and is 0 and always return's true.This is causing the handler to loop forever. Should we ought to disable the analog pin's P0.04 and P0.05 explicitly to NRF_SAADC_INPUT_DISABLED by using function before we configure it as digital input with pull up. Attached is the source code with enough comments.

Cheers, Maddy

PS: I don't own the DK and the touch interface at the moment to test it and the testing was done remotely by setting the Eclipse to debug. Would really appreciate any help.

Parents Reply Children
No Data
Related