I'm trying to turn some pins on and off using DigitalWriteFast.
This is something I do with other pins in the project, and have never had a problem with it. Now I've started writing the code that deals with four pins that I hadn't been using before. The code looks something like this.
Which looks pretty straightforwards to me! The problem is that setting/clearing any of those four pins ALSO sets/clears pins GATE_OUT_1 & GATE_OUT_2.
I've dug down into the code for digitalWriteOut, and have made sure it's doing what I think it should.
I notice that one of the the Teensy SPI hardware units use pins 38 and 39. I am using that unit, and was wondering if that was somehow interfering with things, though I use a different CS pin, and I don't use the MISO at all. But do I have do some to explicitly turn it off?
Or is there something else going on?
Many thanks!
This is something I do with other pins in the project, and have never had a problem with it. Now I've started writing the code that deals with four pins that I hadn't been using before. The code looks something like this.
Code:
#define GATE_OUT_1 39
#define GATE_OUT_2 38
#define GATE_OUT_3 37
#define GATE_OUT_4 40
pinMode(GATE_OUT_1, OUTPUT);
pinMode(GATE_OUT_2, OUTPUT);
pinMode(GATE_OUT_3, OUTPUT);
pinMode(GATE_OUT_4, OUTPUT);
digitalWriteFast(GATE_OUT_4, HIGH); // Example - could be any of them.
Which looks pretty straightforwards to me! The problem is that setting/clearing any of those four pins ALSO sets/clears pins GATE_OUT_1 & GATE_OUT_2.
I've dug down into the code for digitalWriteOut, and have made sure it's doing what I think it should.
I notice that one of the the Teensy SPI hardware units use pins 38 and 39. I am using that unit, and was wondering if that was somehow interfering with things, though I use a different CS pin, and I don't use the MISO at all. But do I have do some to explicitly turn it off?
Or is there something else going on?
Many thanks!