Hi,
I am currently testing SCM20260N on a PCB. I have four LED’s on the PCB, but I am now starting to think I cannot use any GPIO pin to drive an output high?
I have tried the LED example:
var led = GpioController.GetDefault().OpenPin(SC20260.GpioPin.PJ4);
led.SetDriveMode(GpioPinDriveMode.Output);
while (true) {
led.Write(GpioPinValue.High);
Thread.Sleep(100);
led.Write(GpioPinValue.Low);
Thread.Sleep(100);
}
But starting to wonder if only PWM pins will works since the debugger gives me an exception error:
#### Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (1) ####
#### Message:
#### GHIElectronics.TinyCLR.Devices.Gpio.Provider.GpioControllerApiWrapper::OpenPin [IP: 0000] ####
#### GHIElectronics.TinyCLR.Devices.Gpio.GpioPin::.ctor [IP: 001e] ####
#### GHIElectronics.TinyCLR.Devices.Gpio.GpioController::OpenPin [IP: 0005] ####
#### SCU.Controller.Program::Main [IP: 006a] ####
Exception thrown: ‘System.InvalidOperationException’ in GHIElectronics.TinyCLR.Devices.Gpio.dll
An unhandled exception of type ‘System.InvalidOperationException’ occurred in GHIElectronics.TinyCLR.Devices.Gpio.dll
If I use a PWM pin there are no errors, but I don’t need PWM, I just want to drive it high. Are the LCD pins not general purpose (since I am not using an LCD)? It is not really clear which pins are general purpose or mandatory/fixed for a specific purpose from the colors in pinout picture.
Or, I could not find it at least… is it mandatory to use PWM pins for LED’s even when I only want to drive max. current?
Thanks.
Remco