Hello,
I have a problem while communicating the MIMXRT1064-EVK with an Arduino Uno.
I imported the example called: lpi2c_edma_b2b_transfer_master
and I'm doing the follwing code in Arduino:
#include <Wire.h>
# define I2C_SLAVE_ADDRESS 126 // 12 pour l'esclave 2 et ainsi de suite
#define PAYLOAD_SIZE 34
void setup()
{
Wire.begin(I2C_SLAVE_ADDRESS);
Serial.begin(9600);
Serial.println("-------------------------------------I am Slave1");
delay(1000);
Wire.onRequest(requestEvents);
Wire.onReceive(receiveEvents);
}
void loop(){}
int n = 0;
void requestEvents()
{
Serial.println(F("---> recieved request"));
Serial.print(F("sending value : "));
Serial.println(n);
Wire.write(n);
}
void receiveEvents(int numBytes)
{
Serial.println(F("---> recieved events"));
n = Wire.read();
Serial.print(numBytes);
Serial.println(F("bytes recieved"));
Serial.print(F("recieved value : "));
Serial.println(n);
}
I can't perform this communication, meanwhile with 2 NXP boards yes. Could you please give me some hints about how to continue??
Best regards,
Alberto.
解決済! 解決策の投稿を見る。
Hello @Alberto_isorna,
Since you mention that between two NXP boards this work, I suspect that the communication error is due to some problem in the Arduino code. I suggest being sure that the correct length package is used and give a try using the example without DMA.
Best Regards,
Alexis Andalon
Hello @Alberto_isorna,
Since you mention that between two NXP boards this work, I suspect that the communication error is due to some problem in the Arduino code. I suggest being sure that the correct length package is used and give a try using the example without DMA.
Best Regards,
Alexis Andalon