Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

How to send a varying bit pattern to SDA?

2 posters

Go down  Message [Page 1 of 1]

Ed Graham



I'm trying to simulate an Arduino connected to an Adafruit INA219 current sensor.  Since there isn't an INA219 component for SimulIDE, I wanted to send a random pattern of bits to the SDA pin on the Arduino to provide some "realistic" inputs that I could then use in my code.

Which components should I use to send a varying bit pattern to an Arduino pin?  If I use a clock or a wave source, I get a repeating pattern of 0101010101010101... as I would expect.

Ideally I would like to send valid I2C bit patterns to the Arduino, as the INA219 communicates over I2C.  But for now I'll settle for a random bit pattern.

arcachofo

arcachofo

I wanted to send a random pattern of bits to the SDA pin on the Arduino to provide some "realistic" inputs that I could then use in my code.
You can't send random patterns to SDA.
That sensor is an Slave and it must reply to the MCU when it's required in the exact way it's suposed to do.

Ed Graham likes this post

Ed Graham



Thanks arcachofo - much appreciated. If you have any other suggestions for how I might simulate a sensor communicating with an Arduino over I2C then let me know.

arcachofo

arcachofo

If you have any other suggestions for how I might simulate a sensor communicating with an Arduino over I2C then let me know.
Not sure... maybe some basic functionality can be implemented by using an I2C RAM.

Ed Graham likes this post

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum