Skip to content

Wire.write problem as I2C slave #23

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

Open
alejandroImagina opened this issue Oct 18, 2018 · 0 comments
Open

Wire.write problem as I2C slave #23

alejandroImagina opened this issue Oct 18, 2018 · 0 comments

Comments

@alejandroImagina
Copy link

Hi, I've detected a wired problem with the I2C library.

The SAMD21 acts as a slave and only send one byte as the master requests.

I've found that if the bytes to send is greater than 7F, and it is stored in a variable. The function send FF instead of the correct value.

Example:

uint8_t toSend=0x80;
.
.
.
void OnRequest()
{
    Wire.wirte(toSend);
}

If I change the Wire.write(toSend) to Wire.write(0x80) or Wire.write(0xAB), the byte sent is correct.

I've also tried to change the type of the toSend to unsigned char and to char. And the results were the same.

I'm using the Arduino IDE 1.8.7 and the SAM D|L|C 1.6.18 beta-1

Regards,
Alex.

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

1 participant