LPCXpresso 1769 GPIO and functions

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

LPCXpresso 1769 GPIO and functions

879 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by monnoliv on Tue Nov 15 03:53:53 MST 2011
Hello,
I have configured timer0 with match1 register in order to toggle the P1.29 pin every 1mS, works well.
Instead of toggling the pin, I've tried to clear the pin (this is ok) and then to set the pin in the interrupt routine, this is not working. I think this is because the P1.29 pin is configured as a function and not as a GPIO, right?
Question, how to set these pin manually ? Since there is a possibility to clear (or set) the pin automatically, it must be possible to set (clear) it afterwards.
Olivier
0 项奖励
回复
2 回复数

802 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by monnoliv on Tue Nov 15 06:14:26 MST 2011
Woaw, well done. Indeed EMx are linked to MATn.x
Thank you very much
Olivier
0 项奖励
回复

802 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Nov 15 05:42:40 MST 2011

Quote: monnoliv
...it must be possible to set (clear) it afterwards



Yes, it is

A simple way to do this is to use EMX-bit in EMR after stopping the timer :eek:

LPC_TIM0->TCR = 0;                //stop timer
LPC_TIM0->EMR |= (1<<0);            //set   MAT0.0

or

LPC_TIM0->EMR &=~(1<<0);            //reset MAT0.0
0 项奖励
回复