Hi,
I am downloading my code to my custom board and sending commands through a USB virtual COM port. I basically echo and execute some GPIO operations after decoding the commands, then printing stuff to check that the right code was executed.
I have a small motor on my board, enabled by GPIO P0.14, and 3 LEDs. I have defined those GPIOs in custom_board.h as follows:
#define LEDS_NUMBER 3 #define RED_LED NRF_GPIO_PIN_MAP(0,12) #define GREEN_LED NRF_GPIO_PIN_MAP(1,9) #define BLUE_LED NRF_GPIO_PIN_MAP(0,11) #define LEDS_ACTIVE_STATE 0 #define LEDS_LIST { RED_LED, GREEN_LED, BLUE_LED } #define CONFIG_GPIO_AS_PINRESET /Output GPIOs #define MOTOR_EN_ERM NRF_GPIO_PIN_MAP(0,14) //And then some more GPIOs defined, and 2 SPI channels.
What is happening is that the motor GPIO works well by itself, responding to commands "motor on" and "motor off" as expected. But when I put LEDs to 1, the LEDs don't react, and when I put the LEDs to 0 the motor turns on, and I have to turn it off with "motor off".
Also, just after downloading the code to my board, I have to disconnect and reconnect the COM port, and after that, if I disconnect the COM port the motor turns on until I reconnect the COM port.
I have tinkered a bit with my code, and the signal that affects the motor is the Green LED signal, P1.9. Does anyone have any idea about what may be happening? Maybe I am missing something in my definitions? Thank you very much in advance.
Best regards,
Alin O. Dragomir