Recent

Author Topic: other version of i2cslave_unit.pas, to send backwards to Master  (Read 674 times)

pascalbythree

  • Sr. Member
  • ****
  • Posts: 266
other version of i2cslave_unit.pas, to send backwards to Master
« on: February 16, 2024, 12:52:07 pm »
https://github.com/ccrause/fpc-avr/blob/master/src/library/i2cslave_unit.pas

Does anybody have a variant of this unit to send bytes from this Slave to Master RPI ?

Greets, Wouter


ccrause

  • Hero Member
  • *****
  • Posts: 988
Re: other version of i2cslave_unit.pas, to send backwards to Master
« Reply #1 on: February 16, 2024, 02:14:49 pm »
You may have a better chance of getting helped if you explain why the demo does not meet the requirements for your I2C slave.

Also look at other slave devices to see how the master/slave data communication works. As an example of a complex slave device, consider the ICM-20948 motion sensor.  This sensor takes readings and perform many calculations per second to update information (orientation, speed, inclination etc.).  This information is stored in an internal buffer.  The master has to read this information from the sensor over I2C (or SPI, but the principle is still the same).  There is an optional interrupt pin on the slave that can be programmed to signal when some condition is met, for example when a new calculated value is available.  The principle remains that the slave device cannot initiate communication over I2C, but it can use another pin to signal that information is available for the master.  It is still the responsibility of the master to request data from the slave.

 

TinyPortal © 2005-2018