[LPC824] SCT PWM at 25KHz. MATCHREL and MATCH registers usage

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by ramniraj10 on Mon Dec 08 04:56:23 MST 2014
From Aplication manual, MATCH1 counter register is updated from MATCHREL1 when MATCH0 reaches 0.
So, if we load MATCHREL1 with some value when MATCH1 is not 0, is it ok to do this?

I am trying to do multiplexing PWM out pin, so loading MATCHREL1 after each complete cycle is required. When MATCH1 reaches 0 i want value in MATCHREL1 to be next value which should be loaded into MATCH1.

Application: Multiplexing 256 leds and refresh rate 100 Hz.
PWM frequency 25600 Hz
so that, each PWM cycle represents a single led. Scanning is done like in steps below:
1. Update MATCHREL1.
2. Start SCT
3. When MATCH1 reaches 0, SCT ISR is called where update from MATCHREL1. (MATCH1 will automatically reloaded from MATCHEL1) in next PWM cycle.

Please suggest if this implementation is OK?