Using GPIO port B

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using GPIO port B

1,035 Views
ashkanrezaee
Contributor III

Hi, i try to use GPIO B as an output, but the port didn't work and I don't know why.

These are my definitions:

#define BOARD_GPIO_B GPIOB
#define PB00 0U
#define PB01 1U

These are my pin configuration:

GPIO_PinInit(BOARD_GPIO_B, PB00, &(gpio_pin_config_t){kGPIO_DigitalOutput, 0U});
GPIO_PinInit(BOARD_GPIO_B, PB01, &(gpio_pin_config_t){kGPIO_DigitalOutput, 0U});

And then in the "if" command I wrote:

if ((X == 0U)&&(Y == 1U)) {
//PB00_ON();
GPIO_SetPinsOutput(BOARD_GPIO_B, 1U << PB00);
//PB01_ON();
GPIO_SetPinsOutput(BOARD_GPIO_B, 1U << PB01);

else if (Y == 0U) {

//PB00_OFF();
GPIO_ClearPinsOutput(BOARD_GPIO_B, 0U << PB00);
//PB01_OFF();
GPIO_ClearPinsOutput(BOARD_GPIO_B, 0U << PB01);

Port A and LEDs work correctly but port B and GPIO B doesn't work.

I use MCUXpresso IDE and qn9080-DK.

2 Replies

622 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

The default function of PB0/PB1 is xtal clock. Have you configed them to gpio?

Regards,

Jing

622 Views
ashkanrezaee
Contributor III

No, how can I do that?

0 Kudos