SCT Conflict resolution register not working

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

SCT Conflict resolution register not working

317 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kellykan on Fri Jul 17 03:36:25 MST 2015
When using the conflict resolution register on the SCT in the LPC 1820, I get no toggle on the SCT output. The CONNFLAG shows set but I dont get a toggle of SCT output when the resolution is configured for Toggle of the SCT pin.

e.g. taken code directly from the NXP PWM cookbook, but in my case im using SCT output 8. This code works fine with blinky example where there are two events so therefore its not an issue with the pin configs or mux.

void SCT_Init(void)
{
LPC_SCT->CONFIG |= (1 << 17); // two 16 bit timers, auto limit
LPC_SCT->CTRL_L |= (119 << 5); // PRE_L[12:5] = 120-1 (SCTimer/PWM clock = 12MHz/120 = 100 kHz)
LPC_SCT->MATCHREL[0].L = (100000/10)-1; // match 0 @ 10 Hz = 100 msec
LPC_SCT->EVENT[0].STATE = 0xFFFF; // event 0 happens in all state
LPC_SCT->EVENT[0].CTRL = (1 << 12); // match 0 condition only
LPC_SCT->OUT[8].SET = (1 << 0); // event 0 will set SCTx_OUT0
LPC_SCT->OUT[8].CLR = (1 << 0); // event 0 will clear SCTx_OUT0
LPC_SCT->RES = (3 << 0); // output 0 toggles on conflict
LPC_SCT->CTRL_L &= ~(1 << 2); // start timer
}

Any ideas?
标签 (1)
0 项奖励
1 回复

269 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by DF9DQ on Sat Jul 18 12:22:03 MST 2015
The resolution "toggle" is selected for output 0, not output 8! (which leaves output 8 with "no action"). It should be:
LPC_SCT->RES = (3 << 16); // output 8 toggles on conflict
0 项奖励