Toggle GPIO pin

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

Toggle GPIO pin

968 次查看
Shruthi_C
Contributor II

HI

 

I want to toggle PORTA 11th pin in S32K146 microcontroller So I have written code as bellow

-----------------------------------------

PORT_PCR_MUX(1);
GPIO_PDDR_PDD(0x800);
GPIO_PTOR_PTTO(0x800);

----------------------------------------

But its not working, 

Please can you support

 

 

0 项奖励
回复
2 回复数

954 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Shruthi_C,

PCC->PCCn[PCC_PORTA_INDEX ]|=PCC_PCCn_CGC_MASK; /* Enable clock for PORTA */
PORTA->PCR[11] = 0x00000100; /* Port A11: MUX = GPIO */
PTA->PDDR |= 1<<11; /* Port A11: Data Direction= output */
PTA->PTOR |= 1<<11; /* toggle output port A11 */

Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

856 次查看
Shruthi_C
Contributor II

HI Robin

Thanks for your support

 

0 项奖励
回复