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

Need help in programming the PCA9956B...Using I2C on PCA10040 board

I am a beginner in I2C need help to program this LED driver(PCA9956B). If you have any sample code that will be much better.

Parents
  • Hello,

    To see that you device is wired correctly, and able to communicate with the sensor, you may program it with the TWI Scanner example to see that it is working - just follow the example's documentation, and see that the LED driver shows up in the nRF52832's Logs.
    When that is confirmed, you may look at the TWI Sensor example to see how you may conduct the TWI communication. The example demonstrates how you can interface a senor by reading and writing to it - much like you will be doing with the LED driver.

    To see how you may structure your TWI driver in a good way you may take a look at the structure of the lis2dh12 TWI sensor interface, that you can find in /components/drivers_ext/lis2dh12.
    You will have to find the registers addresses / TWI interface from the LED drivers datasheet. Alternatively, you could look into public github repositories that might have implemented the TWI driver for the PCA9956B LED driver. A brief search yielded this repository which seems to do just that, among some other things - thought I have not looked closer into it.

    Best regards,
    Karl

Reply
  • Hello,

    To see that you device is wired correctly, and able to communicate with the sensor, you may program it with the TWI Scanner example to see that it is working - just follow the example's documentation, and see that the LED driver shows up in the nRF52832's Logs.
    When that is confirmed, you may look at the TWI Sensor example to see how you may conduct the TWI communication. The example demonstrates how you can interface a senor by reading and writing to it - much like you will be doing with the LED driver.

    To see how you may structure your TWI driver in a good way you may take a look at the structure of the lis2dh12 TWI sensor interface, that you can find in /components/drivers_ext/lis2dh12.
    You will have to find the registers addresses / TWI interface from the LED drivers datasheet. Alternatively, you could look into public github repositories that might have implemented the TWI driver for the PCA9956B LED driver. A brief search yielded this repository which seems to do just that, among some other things - thought I have not looked closer into it.

    Best regards,
    Karl

Children
Related