Content originally posted in LPCWare by larryvc on Sun Dec 07 19:00:35 MST 2014
Firstly I want to say that I think the SCT is an awesome peripheral. I intend to use it to replace processor intensive software bit-banged pattern generators in a few of my devices. But I do have some concerns with the quality of some of the example programs that are provided in LPCOpen.
Example program periph_sct in LPCOpen v2.13 for the LPC824 will not work as written because there is setup code missing. The SCT interrupt will never happen without first enabling a state for event 0, starting (unhalting) the SCT counter, and setting event 0 as the limit for the counter.
This is the working code, sct.c, with changes indicated in red:
Firstly I want to say that I think the SCT is an awesome peripheral. I intend to use it to replace processor intensive software bit-banged pattern generators in a few of my devices. But I do have some concerns with the quality of some of the example programs that are provided in LPCOpen.
Example program periph_sct in LPCOpen v2.13 for the LPC824 will not work as written because there is setup code missing. The SCT interrupt will never happen without first enabling a state for event 0, starting (unhalting) the SCT counter, and setting event 0 as the limit for the counter.
This is the working code, sct.c, with changes indicated in red:
|
Original Attachment has been moved to: sct_2.c.zip
UPDATE: I have updated the code above as it was missing this
The code now functions as it should.