Closed LibrEars closed 1 year ago
I made some progress. Turns out I should have used SDA0 and SDA0 (pin A1 and pin A2) from the start and then it works. But take care! I found out, that the analog pins A0 and A2 are not labeled right on the board! (they need to be swaped)! I opened a new issue for that: https://github.com/uStepper/uStepperS/issues/35
Also pin D7 (SCL1) and D8 (SDA1) are somehow always HIGH (missing pullup resistor?) which causes problems in my setup (not enough pins). If you for some reason need to use the SCL1 and SDA1 pins for the display (or similar) as well, I found a way :)
This is not possible by default due to missing firmware. Therefore we need to add support for the microcontroller. Here is what I did:
#include <Wire.h>
to #include <Wire1.h>
and #include "rgb_lcd.h"
to #include** "rgb_lcd1.h"
extern TwoWire1 Wire1; // insert this line is the modification to include Wire1 (SDA1 / SCL1) .…
Wire.xxx()
with Wire1.xxx()
! Make sure to not replace the lines added above a second time! #include <Wire1.h>
and #include "rgb_lcd1.h"
Further information: • https://github.com/MCUdude/MiniCore This lib adds support for the ATmega328PB, in detail for serial communication with the lib Wire1.h • https://www.instructables.com/How-to-share-i2C-connection-on-Due/ To get the display running, we need to change its lib rgb_lcd.h
A0/A2 swap has been corrected in release 2.2.4. The high level on D7 and D8 is caused by pull-up resistors for the i2c.
Hi all,
did someone get the I2C ports SDA1 and SCL1 (Digital pins D7 & D8) of the uStepperS up running? I tried to connect a grove-LCD display (RGB Backlight) but it did not work so far.
The examples of the grove library did not work and I also tried without success to detect the I2C ports in general with the i2c_scanner from the arduino uno examples (with and without the pins connected, code see below)
The scanner uses the wire library. Does someone knows if this should work in principle or is there more hard stuff necessary to get it running?