Closed JeremyGrosser closed 2 years ago
as requested by Jeremy I am attaching the pictures of the logic analyser
this is the Micro Python version, which works:
this is the current RP implementation, which does not work:
and here after my very dirty hack:
the hack (RP.I2C_Master.Mem_Write): declare My_Data : I2C_Data (0 .. Data'Last + 1); begin My_Data (0) := UInt8 (Mem_Addr); for Index in Data'Range loop My_Data (Index + 1) := Data (Index); end loop;
This.No_Stop := False;
This.Master_Transmit (Addr => Addr,
Data => My_Data,
Status => Status,
Timeout => Timeout);
end;
I am afraid, that maybe Mem_Read needs fixing, too.
I changed Mem_Write to use a single Master_Transmit rather than a repeated start between address and data (5879969b90cb0890e3ab445f598431037e00973c).
Mem_Read needs the repeated start because it has to change the I2C address' LSB from write to read between sending the memory address and reading the data.
See conversation on Gitter for details.