Controlling 7-segment displays with i2c drivers

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

Controlling 7-segment displays with i2c drivers

163 Views
Transidico
Contributor II

Good morning,

I have a question. I am using the i2c pca9956btwy driver to control two 3-digit 7-segment displays. I am using the i2c peripheral in polling mode with the I2C_MasterTransferBlocking function. In the background, I have a kind of scheduler with systick that uses some interrupts as timers. The problem is that I change the text on the displays very often within the while(1) of the main, so I lose some interrupts. My question is: if I keep the i2c peripheral in polling mode with the blocking function when I wait for the end of a transfer, if the interrupt triggers, I won't miss it, correct? Do I execute the interrupt and then return to waiting for the end of the transfer? What causes me to lose interrupts are the continuous transfers via 12c, correct?

Thank you in advance for your reply.

Best regards

0 Kudos
Reply
4 Replies

142 Views
ErikaC
NXP TechSupport
NXP TechSupport

Hello

Yes, interrupts should still be executed. However, what might be causing you to miss some of them is the frequent I2C transfers you're performing. These can overload the CPU and delay the handling of interrupts, especially if you're using blocking calls.

By the way, what microcontroller are you using?

0 Kudos
Reply

123 Views
Transidico
Contributor II

Thank you for your reply.
I am using mcxc242 and pca9956btwy to control the displays. Regarding the driver, is there a single command that allows me to select the PWM intensity of each pin in sequence without having to send the command for each pin in sequence?
Thank you again.

Regards

0 Kudos
Reply

98 Views
ErikaC
NXP TechSupport
NXP TechSupport

Hello,

Please see the GRPPWM register (section 7.3.4 of the Datasheet)

https://www.nxp.com/docs/en/data-sheet/PCA9956B.pdf

0 Kudos
Reply

82 Views
Transidico
Contributor II

Good morning,

thank you for your reply,

but I have solved the problem by auto-incrementing the LEDs. Now the interrupts are almost never lost. I have implemented a way to avoid sending continuous transmissions to the display if they are the same as the previous status. Unfortunately, I read the status of the buttons with the pca9534d driver every 20 ms, and I don't know how to reduce the transmissions, which means that I lose some interrupts. I can't increase the reading time, otherwise the buttons would not be in real time. Perhaps I could solve this by setting different interrupt priorities?

Thank you again.

0 Kudos
Reply