Hi,
I am trying to control multiple DA7280 Sparkfun boards from a Teensy 4.0 using the driver developed by Elias Santistevan. I know I can daisy chain the boards and use one set of I2C pins, but I don’t want to do that. I have multiple I2C channels available as in the Teensy: Wire(), Wire1(), etc, so I want to configure each board differently (e.g. frequency). However, only Wire() is working, and Wire1() etc does not work. I don’t think it is the DA7280, since the datasheet says that any I2C line that transmits the right device ID can access the chip. That leaves the driver itself. Does the driver specify which I2C line the uController will use? This doesn’t seem to be the case, since Sparkfun’s example code below shows Wire.begin() being called . Would this even be necessary if the I2C configuration was set up by the driver?
By the way, I confirmed that Wire.h is supposed to support multiple I2C lines.
#include <Wire.h>
#include “Haptic_Driver.h”
Haptic_Driver hapDrive;
//int pwmPin = 5; // Teensy
int pwmPin = 2; // Artemis
int power = 20;
int event = 0;
void setup(){
pinMode(pwmPin, OUTPUT);
//When using Teensy***************************************
//analogWriteFrequency(pwmPin, 10000); // Set to 10kHz
//When using Artemis***************************************
//analogWriteResolution(8); //This example assumes that analogWriteResolution() is set to 8-bits on the Artemis, uncomment this line if needed
analogWriteFrameWidth(1100); //Set to 10kHz (e.g. 10909Hz = 12000000/1100); too close to the boundary and the DA7280 will fault
Wire.begin();
Serial.begin(115200);