lpcware

LPC11U67 LPCOpen, Help on STC block, how to make 1KHz (50% duty) into  SCT0_OUT1

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by riscy00 on Tue Aug 05 08:45:26 MST 2014
Hi

How to setup STC block ( to generate 1Khz clock into SCT0_OUT1 without involving interrupt?

Chip_IOCON_PinMuxSet(LPC_IOCON,2,02, IOCON_FUNC3 | IOCON_MODE_INACT|IOCON_DIGMODE_EN); // SCT0_OUT1
//================================================================================Setup 1KHz Clock Source.
Chip_SCT_Init(LPC_SCT0);
// Configure the SCT as a 32bit counter using the bus clock
Chip_SCT_Config(LPC_SCT0, SCT_CONFIG_32BIT_COUNTER | SCT_CONFIG_CLKMODE_BUSCLK);
// Set the match count for match register 0
Chip_SCT_SetMatchCount(LPC_SCT0, SCT_MATCH_0, SystemCoreClock / 1000);//1Khz
// Set the match reload value
Chip_SCT_SetMatchReload(LPC_SCT0, SCT_MATCH_0, SystemCoreClock / 1000);//1KHz

STC documentation, wow!, so many register, no guideline how to use it for simple a task....!

I'm not sure what I'm doing. I tried using STC Tool kit but it does not make sense to me. What further modification to make it work?

R.

Outcomes