I just redesigned a board that I am using the DUE to drive. I realized I switched some pins around, and for one I put some IO lines on the SDA1 and SCL1 pins.
For some reason these pins are not behaving as I intended. I am defining them as pins 70 & 71 in the software and I am curious if there is anything special I need to do with these pins to get them to work?
When I say not behaving as I intended, I mean I am driving one low and another high, but then i look and they're both high at 3.3V.
You don't need my code, I am asking if there is anything special that needs to be done to use SDA1 and SCL1 pins as digital IO, if there is anything special about them that requires extra work to make operate as Digital I/O pins.
I don't see any trouble, but it is a high number. Maybe there is a bug somewhere.
Can you make a minimal sketch that does not include a library and only sets the pinMode for those two pins and toggle them. Try to measure them with a multimeter.
Show the sketch and tell us what the result is.
uint8_t PM1 = 70;
uint8_t I2C = 71;
void setup() {
// put your setup code here, to run once:
pinMode(70, OUTPUT); // Power mode pin 1.
pinMode(71, OUTPUT); // Power mode pin 1
digitalWrite(70, HIGH);
digitalWrite(71, HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
}
Alright so I did this code, and they did exactly what I wanted when not placed on the PCB I designed ( get 3.3V w the DMM when digitally written to HIGH and 0V when digitally written to LOW). Which tells me it is probably a problem with my schematic then (since it works fine when not attached to my board). I noticed that pin 13, is doing the same thing...
where when I put the DUE on my PCB and run the code, they stay pulled high no matter what I set the digitalWrite to (they meaning pins 70, 71, and 13 when I added 13 n there). And there is no pull up resistor on either of these rails.
I am using them to drive a power mode select pin (PM1) on an energy metering chip and an I2C select pin on the same chip. which is why I have PM1 = 70 and I2C = 71, just for reference when using the DMM.
Yeah, that's what happens when you compile using an UNO (haven't used a DUE in 3 years) and make the pin names match the diagram. I know about the default low thing and the default high thing (with pullups enabled), but no harm done here.