Need better SCT examples

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

Need better SCT examples

2,612 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rickta59 on Thu Aug 08 10:26:06 MST 2013
I'm trying to use the SCT peripheral to reshape a serial clocked input signal.

There are 2 inputs, a serial clock pin and a data pin. There is one output.  I want to use the data pin to decide if i should output a pulse of ~375ns when the pin is high and ~750ns when the pin is low.

I've looked at the various samples. Some of them seem to be close to what I want to do. However I'm at a loss to figure out some of the techniques they use. The IRQ thing seems to be something I might want to use but I have no idea what it does.

Basically the SCT should sit and wait for a low->high transition on the serial clock pin.
Then it should sample the data pin and set an output pin hi until it reaches one of two matches times depending on the value of the data pin.
When the proper match is made it should set the output pin low.
Then it should go back and wait for another lo->high transition on the serial clock pin.

Seems simple enough. Sadly, I've not been able to figure it out though.
Any hints or a working example would be appreciated.

Thanks,

-rick
标签 (1)
0 项奖励
回复
12 回复数

2,365 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Sat Jun 27 06:50:16 MST 2015
Hi fjrg,
Yes, all examples from obsolete cookbook are in the AN11538. Please use this appnote
0 项奖励
回复

2,365 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fjrg76 on Fri Jun 26 19:39:10 MST 2015
http://www.lpcware.com/content/nxpfile/lpc80-sct-cookbook-and-tutorial-code-examples

Broken link  :~

Is this doc the same as the AN11538?
0 项奖励
回复

2,365 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Paul on Fri Aug 23 13:36:05 MST 2013
The switch matrix does map to the GPIO pins (the PINASSIGN register requires that you use PIO0_x values).
I would like to re-iterate that although it may be possible, I would not recommend using undocumented port pins since it may cause problems in future revisions of the silicon.
0 项奖励
回复

2,365 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cpldcpu on Fri Aug 23 06:30:23 MST 2013

Quote: NXP_Paul
Although it may be possible to use undocumented ports, it is not recommended since these could be removed in future silicon revisions.  Only documented features are guaranteed to be available and tested.



Well, does the internal forwarding in the switch matrix even use the GPIO?
0 项奖励
回复

2,365 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Paul on Fri Aug 23 06:19:43 MST 2013
Although it may be possible to use undocumented ports, it is not recommended since these could be removed in future silicon revisions.  Only documented features are guaranteed to be available and tested.
0 项奖励
回复

2,365 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cpldcpu on Sat Aug 17 07:21:41 MST 2013
Thank you for your response. Could you also comment on the question whether signals can be routed to the SCT through P0.6 to P0.17 on the LPC 810 as discussed in this thread: http://www.lpcware.com/content/forum/controlling-ws2812-led-strips-lpc810 ?

From the documentation it is not quite clear whether this is an intended or a hidden feature. The user manual states that the switch matrix is the same in all LPC800 devices. It also states that the SCT can be connected to "internal signals". So far I would interpret these statements as indication for being officially able to use P0.6 to P0.17 for _internal_ routing?
0 项奖励
回复

2,365 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Paul on Wed Aug 14 12:28:00 MST 2013
Thank you for your feedback.
We are looking into the possibility of having Red State remove the unused registers.  I do not have a timeline if/when this could be done.  For now, it is better to have this code included, and then the user can decide if it can be removed.
We will include a "CALL" explanation in the next revision of the SCT document.
I agree that a concise listing of the registers should be included.  In order to get the SCT Cookbook and Tutorial online, this information was skipped in version 1, but it will be included in the next revision.
I cannot commit to having the user manual updated, but I will review your suggestions and see what can be done to make improvements.
We really appreciate suggestions for improvement to the LPC800 SCT Cookbook and Tutorial.
0 项奖励
回复

2,365 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cpldcpu on Fri Aug 09 23:49:40 MST 2013

Quote: NXP_Paul
We have just uploaded an LPC800 SCT Cookbook and Tutorial.  You can find it at:
http://www.lpcware.com/content/nxpfile/lpc80-sct-cookbook-and-tutorial-code-examples



Thank you, this is really helpful. Some things that came to my mind, maybe it is useful:

[list]
[*] Why does the Red State Code produce so much redundant code. Instead of having to explain it in the cookbook, maybe it would be possible to update RSC to only initialize unused registers upon request?

[*] What is a "CALL"? This is not explained.

[*] It could be helpful if the cookbook contained a concise listing of the registers and their function.
[/list]
I know it can be cross referenced to the user manual, but the listing there is a bit cluttered. Some of issues:
[list]
[*] Registers with the same function are duplicated in the list, making it excessively long. This could be remedied by grouping registers with the same function.

[*] The naming of registers in the UM and the C-header is different. For example the event registers are called EVx_ instead of Event[x] or Eventx

[*] The register names are not part of the subtitles. E.g. "10.6.10 SCT match/capture registers mode register" refers to "REGMODE". Due to this it takes a much longer time to find registers descriptions just be skimming the manual.
[/list]
0 项奖励
回复

2,365 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rickta59 on Fri Aug 09 11:50:15 MST 2013
Thanks! just what I need.
0 项奖励
回复

2,365 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Paul on Fri Aug 09 11:30:21 MST 2013
We have just uploaded an LPC800 SCT Cookbook and Tutorial.  You can find it at:
http://www.lpcware.com/content/nxpfile/lpc80-sct-cookbook-and-tutorial-code-examples
0 项奖励
回复

2,365 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rickta59 on Thu Aug 08 15:09:33 MST 2013
Yes that is what I have been trying to use.

I followed along with the red state tutorial and thought it would be easy. Then I realized that contrary to the tutorial the lpc810 can only have 2 states. I've done some more experimenting and done some simple tests using the U_ALWAYS.  I'm not doing all the tests. I mainly wanted to figure out the slew rate between edge detection and the SCT peripheral.

I've attached the .rsm file I'm using you have to rename it from .txt to spi2ws2811.rsm to open it with Red State.

Seems like there is a 3 instruction delay ( ~240ns) .. this should work out ok if i can figure out how to do the rest.

-rick
0 项奖励
回复

2,365 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Thu Aug 08 14:47:30 MST 2013
Have you looked at Red State - the SCT tool provided for free in LPCXpresso?
0 项奖励
回复