LED on/off

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

LED on/off

跳至解决方案
1,432 次查看
Mustafa123
Contributor I

Good morning ,

please  iam beginner and i use MPC5748g development board for  GPIO to make led PA10 to make it on//off 

I know that this led is active low

i use 

 SIUL2.MSCR[10].B.OBE=1;
 SIUL2.GPDO[10].R=1;    //to make led off

 SIUL2.GPDO[10].R=0    // to make on 

 

but my problem to use masking it does.not working 

  SIUL2.GPDO[2].R|=(1<<23);  // to make it off     it is on the board still on 

(please i don#t understand the concept of byte access and the probelm in the same time in data sheet 

show PDO_4n,PDO_4n+1,PDO_4n+2,PDO_4n+3) what that mean ?

 

and please is there any ready made function for delay

again thank you very much for time and help 

0 项奖励
回复
1 解答
1,415 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

Pay attention to following example code:

https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-MPC5748G-PinToggleStationery-GHS614/ta-p...

For PA10, shift 8 by bits.

SIUL2.GPDO[2].R|=(1<<8);  (32-bit register, shift to the left)

GPDO[0] consist of PA0, PA1, PA2, PA3 (from left)

GPDO[1] consist of PA4, PA5, PA6, PA7

GPDO[2] consist of PA8, PA9, PA10, PA11

 

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,416 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

Pay attention to following example code:

https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-MPC5748G-PinToggleStationery-GHS614/ta-p...

For PA10, shift 8 by bits.

SIUL2.GPDO[2].R|=(1<<8);  (32-bit register, shift to the left)

GPDO[0] consist of PA0, PA1, PA2, PA3 (from left)

GPDO[1] consist of PA4, PA5, PA6, PA7

GPDO[2] consist of PA8, PA9, PA10, PA11

 

0 项奖励
回复