Arduino 3xI2C device, 2xDAC, 1xLCD, LCD went crazy

Nico_21802
Nico_21802 Altair Community Member
edited July 2023 in Community Q&A

I want to use three I2C devices. 2xDac and 1xLCD to display the values ​​of a controller. The LCD is said to run at 10Hz and the DAC at 800Hz. I used the enabled execution of the compound blocks.

First in the Arduino IDE the 3 I2C devices works fine. You don't specify any frequency there.

When I run the program on the Arduino the LCD just displays random characters and cycles through turns on and off.

When I run all 3x I2C devices at 10Hz it works fine.

Does the I2C bus have problems with different frequencies of the individual devices?
I've been trying to solve the problem for days.
Thanks for the help

image

 

Tagged:

Answers

  • Sreejith_21826
    Sreejith_21826 New Altair Community Member
    edited July 2023

    Hi Nico,
    Arduino IDE wont provide any scheduler (interrupt time specific call) for application. In Embed it's a time specific scheduler call is the base level option, and if you dont want your application run in interrupt scheduler you have to select your blocks and put under back ground thread. 

    In Embed systemProperties->frequency is your base timer tick( scheduler speed) you can derive any speed on top of it. Accuracy depends on your base speed. Example if your system frequency is 1sec (1hz) you can derive 2sec, 10sec etc, but if your try to trigger something on 2.5sec it will run at 3sec only.

    Attached a diagram for your reference, System speed is 10hz and 2DAC device run at 800hz. so every 80th Trigger it will call DAC functions. 

    Sreejith