PCA8885 example code to set up and read

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PCA8885 example code to set up and read

1,041 Views
support2
Contributor I

I am new to Touch sensors and I2C comms. I have PCA8885 and the Port Extender PCA9535. This is part of a University course.

Is there example code that I can see that shows me how to communicate with these devices to set them up for use and then to read the SENS register. One device has an address of 0x20 thats fine, but does the registers have an address or an offset???? The Datasheet is not clear on that.

Thanks and regards

Paul

0 Kudos
2 Replies

869 Views
reyes
NXP TechSupport
NXP TechSupport

Hi Paul,

Unfortunately, there are no standalone drivers or example codes specifically for the PCA8885, however, you can find an example code for the MPC5748G (MCU) in which is included a PCF8885 Touch sensing demo and PCA9535 demo. So I think it can be useful as a reference for your application, please download the “Example_MPC5748G_PCF8885-Touch_sensing_demo-v1_0-GHS614.zip” file from the following link: https://community.nxp.com/docs/DOC-339375

 

Then go to source folder and open the main.c file. In this fil you can find the example code for the PCF8885 and the PCA9535.

 

The PCF8885 supports direct reading of the sensor state from the SENS register. If - after sending the address - the R/W bit is immediately set to logic 1 without sending a command, the circuit recognizes that it must immediately return the content of the SENS register. When the transaction, after reading the SENS register, is not terminated with a STOP bit, the PCF8885 repeatedly sends the content of SENS again.


Have a great day,

Jose
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

869 Views
support2
Contributor I

Jose, thank you very much for your assistance. I will follow your advice.

0 Kudos