LPC1778的P0.29和P0.30做普通输出口的问题

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

LPC1778的P0.29和P0.30做普通输出口的问题

811 Views
911138316
Contributor I

嗨,我用的是LPC1778FBD144,想把P0.29和P0.30作为普通IO输出口使用。但是怎么设置口的输出都是低电平。

我也知道,这两个都要设置成同一个方向,我也这么操作了,但是就是不行。请大侠指教!

int main (void)
{
   SystemInit();  
   LPC_GPIO0->SET |= (3ul << 29);
   LPC_GPIO0->DIR |= (3ul << 29);
   LPC_GPIO0->SET |= (3ul << 29);

   while(1);
}

总是第电平!

0 Kudos
1 Reply

540 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi 泉 杨 ,

I would recommend that you use the periph_blinky example from the LPCOpen package as reference, the example shows how to initialize, choose the direction and how to set or clear the output. The LPCOpen package can be found on your MCUXpresso IDE installation.

C:\nxp\MCUXpressoIDE_10.2.1_795\ide\Examples\LPCOpen\lpcopen_2_10_lpcxpresso_ea_devkit_1788.zip


Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos