From 9fc02fbebace51c5a770f40365eb42927695bc4b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 14 Apr 2023 09:36:32 -0400 Subject: [PATCH] try i2c bus 1 for clockgen, then try bus 2 if fails. --- cubesatsim/cubesatsim.ino | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 0b1887bf..5122c335 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -5025,11 +5025,17 @@ void start_clockgen() { Wire1.setSCL(3); Wire1.begin(); - if (clockgen.begin(&Wire1) != ERROR_NONE) + if (clockgen.begin(&Wire) != ERROR_NONE) { /* There was a problem detecting the IC ... check your connections */ - Serial.println("No Si5351 detected ... Check your wiring or I2C ADDR!"); - return; + Serial.println("No Si5351 detected on bus 1"); + + if (clockgen.begin(&Wire1) != ERROR_NONE) + { + /* There was a problem detecting the IC ... check your connections */ + Serial.println("No Si5351 detected on bus 2 ... Check your wiring or I2C ADDR!"); + return; + } } Serial.println("Starting clockgen frequency 434.9 MHz");