- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am looking for an expert advice on how to decode 2 asyncronous pulse streams with a PSOC4 BLE.
I have 2 signals with a strange proprietary protocol. The maximum pulse length is 200µs and the minimal pulse length 10µs. I need to measure the pulse length with at least 1,5µs resoluton.
Now I am looking at the most efficient use of internal resources to archeive this with the minimul amount of CPU time possible (the CPU needs to handle the BLE communication and this shouldn't interfere with the measurements).
What would be the "best" timer configuration for this?
Solved! Go to Solution.
- Labels:
-
PSoC 4 Architecture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Because resetting the timer after pulse measure is a required action using DMA will get rather complicated (if possible at all).
I would try using a connection as shown below.
Setting the timer period accordingly will give you an interrupt when the 500µs expire, otherwise the capture interrupt will get you the signal width with 0.5 µs resolution.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A TCPWM setup as a Timer is the right answer.
A 1MHz input clock will give you 1us resolution.
You can use a falling edge capture.
A falling edge interrupt ... and an ISR to reset the time and read the capture.
The next question will be what/how you will do with the different pulses... and how fast they come.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The question is how to handle the 2 asyncronous data streams in an efficient way. The signal consists of a sequence of 4 to 10 pulses and than there is a pause of approximately 500µs.
Should I use differtent timer for each one or a single 8Bit timer? Is it better to have a "free running" timer or to reset it after every catch? Can I use the DMA Peripheral?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Because resetting the timer after pulse measure is a required action using DMA will get rather complicated (if possible at all).
I would try using a connection as shown below.
Setting the timer period accordingly will give you an interrupt when the 500µs expire, otherwise the capture interrupt will get you the signal width with 0.5 µs resolution.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is almost like you have programmed a PSoC before.
Though Im not sure why you clock it at 2mhz instead of 1 given that he only needed 1.5us accuracy?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Though Im not sure why you clock it at 2mhz instead of 1 given that he only needed 1.5us accuracy?
Because I can 😉
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hmmm....
power ~= ~C*V^2*F
🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Power = kg * m² / s³ for all that are metric. Must be quite difficult to express using ounces, miles and am/pm times...
BOB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link with related clock power analysis thread: electric circuits - How does power consumption vary with the processor frequency in a typical comput...
Power: the ability to do something or act in a particular way, especially as a faculty or quality
😜