ADS1115 With Simulink / Raspberry Pi (ADS1x15 Block) – Multi-Channel Read Issue?
Hi there,
I have a simulink model that is being deployed on a raspberry pi 4 model B. I am trying to use the ADS1x15 block from the "Simulink Support for Raspberry Pi Hardware" package. My issue is that I am not able to read from more than one channel at once. If I create two instances of the block, and select the appropriate channels, they output the same thing. Is this a known issue, or have I not configured the block or model properly? Or is there some workaround for this?
I saw a previous question posted on the Matlab Answers forum and the only answers seem to keep pointing at this one 8 year old video on youtube that creates an S-Function instead of using the dedicated library blocks (the video is also for Arduino, not raspberry pi).
Here is a screen capture of the model:
Here is block "ChannelA" properties (Note in the advanced tab, enable comparator is not checked):
Here is block "ChannelB" properties (Same as Channel A, but selected a different channel):
If the conversation mode is "Single Shot" then both blocks just output channel A.
If the conversation mode is continuous, then both blocks output whatever channel has most recently changed voltage. Very strange. It seems like the i2c information is being sent to both blocks although different channels are selected.
I have all of the hardware breadboarded and the voltages / connections are all correct. Ruled that out.
Some help with this blockset would be appreciated. I cannot seem to get this working. For testing this I am using the Simulink run on hardware feature with my raspberry pi and I am on version R2024a of maltab/simulink.
Thanks – Kyle.Hi there,
I have a simulink model that is being deployed on a raspberry pi 4 model B. I am trying to use the ADS1x15 block from the "Simulink Support for Raspberry Pi Hardware" package. My issue is that I am not able to read from more than one channel at once. If I create two instances of the block, and select the appropriate channels, they output the same thing. Is this a known issue, or have I not configured the block or model properly? Or is there some workaround for this?
I saw a previous question posted on the Matlab Answers forum and the only answers seem to keep pointing at this one 8 year old video on youtube that creates an S-Function instead of using the dedicated library blocks (the video is also for Arduino, not raspberry pi).
Here is a screen capture of the model:
Here is block "ChannelA" properties (Note in the advanced tab, enable comparator is not checked):
Here is block "ChannelB" properties (Same as Channel A, but selected a different channel):
If the conversation mode is "Single Shot" then both blocks just output channel A.
If the conversation mode is continuous, then both blocks output whatever channel has most recently changed voltage. Very strange. It seems like the i2c information is being sent to both blocks although different channels are selected.
I have all of the hardware breadboarded and the voltages / connections are all correct. Ruled that out.
Some help with this blockset would be appreciated. I cannot seem to get this working. For testing this I am using the Simulink run on hardware feature with my raspberry pi and I am on version R2024a of maltab/simulink.
Thanks – Kyle. Hi there,
I have a simulink model that is being deployed on a raspberry pi 4 model B. I am trying to use the ADS1x15 block from the "Simulink Support for Raspberry Pi Hardware" package. My issue is that I am not able to read from more than one channel at once. If I create two instances of the block, and select the appropriate channels, they output the same thing. Is this a known issue, or have I not configured the block or model properly? Or is there some workaround for this?
I saw a previous question posted on the Matlab Answers forum and the only answers seem to keep pointing at this one 8 year old video on youtube that creates an S-Function instead of using the dedicated library blocks (the video is also for Arduino, not raspberry pi).
Here is a screen capture of the model:
Here is block "ChannelA" properties (Note in the advanced tab, enable comparator is not checked):
Here is block "ChannelB" properties (Same as Channel A, but selected a different channel):
If the conversation mode is "Single Shot" then both blocks just output channel A.
If the conversation mode is continuous, then both blocks output whatever channel has most recently changed voltage. Very strange. It seems like the i2c information is being sent to both blocks although different channels are selected.
I have all of the hardware breadboarded and the voltages / connections are all correct. Ruled that out.
Some help with this blockset would be appreciated. I cannot seem to get this working. For testing this I am using the Simulink run on hardware feature with my raspberry pi and I am on version R2024a of maltab/simulink.
Thanks – Kyle. simulink, raspberry pi, ads1115, i2c MATLAB Answers — New Questions