Skip to content

I2C Mem_Write sends a repeated start #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JeremyGrosser opened this issue Feb 26, 2022 · 3 comments
Closed

I2C Mem_Write sends a repeated start #33

JeremyGrosser opened this issue Feb 26, 2022 · 3 comments

Comments

@JeremyGrosser
Copy link
Owner

See conversation on Gitter for details.

@hgrodriguez
Copy link

hgrodriguez commented Feb 26, 2022

as requested by Jeremy I am attaching the pictures of the logic analyser

this is the Micro Python version, which works:
MicroPython_Write_Correct

this is the current RP implementation, which does not work:
RP2040_Write_Wrong

and here after my very dirty hack:
RP2040_Write_Correct

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;

@hgrodriguez
Copy link

I am afraid, that maybe Mem_Read needs fixing, too.

@JeremyGrosser
Copy link
Owner Author

I changed Mem_Write to use a single Master_Transmit rather than a repeated start between address and data (5879969).

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.

EEPROM write trace
EEPROM read trace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants