Toggle GPIO pin

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

Toggle GPIO pin

619 Views
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 Kudos
2 Replies

605 Views
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 Kudos

507 Views
Shruthi_C
Contributor II

HI Robin

Thanks for your support

 

0 Kudos