The SAM chip apparently has two I2C interfaces. Does the Arduino Wire library support the second interface? I'd like to have two interfaces, operating at different speeds (100kHz, and 2MHz).
Regards,
Ray L.
The SAM chip apparently has two I2C interfaces. Does the Arduino Wire library support the second interface? I'd like to have two interfaces, operating at different speeds (100kHz, and 2MHz).
Regards,
Ray L.
Use Wire1 for the second one. Remember it doesn't have pullup resistors on the Due board.
You can mix speeds if you have to although if you have a device which is totally incapable of the high speed, it may see its address in the glitches and interfere with the high-seed device.
Wire1 it is! Thanks!
Regards,
Ray L.
All working perfectly now. Important to add pull-up resistors to BOTH SCL1 and SDA1.
Regards,
Ray L.
Hi RayLivingston,
Would you be able provide your code, I'm trying to connect HMC5883l , but no luck on getting correct out come yet
thanks
nuwanw:
Hi RayLivingston,
Would you be able provide your code, I'm trying to connect HMC5883l , but no luck on getting correct out come yet
thanks
It's exactly the same as for the first interface, just using Wire1 instead of Wire. If you're having a problem with your code, post your code.
Regards,
Ray L.
Please refer the attached
Thank you in advance
HMC5883L.cpp (3.4 KB)
HMC5883L.h (2.03 KB)
Simple.ino (1.23 KB)
First it is necessary to change all of the references to "Wire" to "Wire1" in your .cpp and .ino files.
Do you have pullup resistors?
The problem is , I'm not getting correct output , I'm using 20 and 21 pins, the code I posted is written for uno, but I'm checking for due, should the program change since it is 32 bit one?
Thanks
WELL IF YOU DON'T POST THE CODE THAT HAS THE ERROR THEN YOU WON'T GET A USEFUL REPLY.