Using GPIO port B

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Using GPIO port B

1,270 次查看
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 回复数

857 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi,

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

Regards,

Jing

857 次查看
ashkanrezaee
Contributor III

No, how can I do that?

0 项奖励
回复