Using GPIO port B

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Using GPIO port B

1,271件の閲覧回数
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 返答(返信)

858件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi,

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

Regards,

Jing

858件の閲覧回数
ashkanrezaee
Contributor III

No, how can I do that?

0 件の賞賛
返信