I am writing a general-purpose stepper motor driver C shared library for the Raspberry Pi using PIGPIO (pigpiod C interface) for 4 to 7 motors using A4988 drivers. I designed an interface board (basically a GPIO breakout board for the driver chips and limit switches) but I have run out of 'normal' GPIO pins to control the ENA pin of one of the motors so I am trying to use GPIO 1 (the ID_SC pin) for this purpose (or GPIO 0). However, I cannot change its state with the gpio_write function or the pigs' command-line utility.
I am using Raspbian on an RPi v3b (not b+).
My research suggests there may be issues with RPi3 and I2C in this regard. So I set "Disable automatic loading of I2C kernel module" in raspi-config 'Interfaces' but that did not help.
In this post about the same/similar issue on the raspberry pi forum:
https://www.raspberrypi.org/forums/viewtopic.php?t=162119
It was suggested that setting the pin "to normal" should fix the issue but I don't know what that means or how to set the pin to "normal".
With pigpiod running I type:
$ pigs mg 0 mg 1
and I get:
0
0
Then I type:
$ pigs w 1 1
and I get:
-41
ERROR: no permission to update GPIO
The same result occurs with sudo.
Running the pigpio test utility, gpiotest, I get:
Testing...
Skipped non-user gpios: 0 1 28 29 30 31
Tested user gpios: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
Failed user gpios: None
Again, sudo makes no difference. By searching the net I found no method to change the 'non-user' gpios into user ones (obviously I am not interested in the power and ground pins - it's just 0 and 1 I'm after).
My driver board and interface code work fine as is but I must leave one motor permanently enabled - with some motors this causes significant heating. I would like to use GPIO 1 and GPIO 0 to write pins if possible. (Please note: I am aware that you can increase the number of GPIOs via I2C expansion boards using MCP23017 or similar. I don't want to do that for this project - and my understanding is that pigpio won't work with those anyway).
So my questions are: Is it possible to set the level of GPIO 1 on the RPi3 without additional hardware? If so, how can I achieve this?
Many thanks in advance.