Mode %10101, how does it work, what does it do?
JonTitus
Posts: 193
in Propeller 2
I hope someone can clarify and expand on the vague instructions for this mode and explain how it works. What does the "X[31:0] establishes a minimum number of clock cycles to track periods for." mean in terms of the three modes %10101, %10110, and, %10111? Does it mean the Smart Pin will sample for at least that long before it can trigger the IN flag and I can get "time-from last IN flag = 1" data?
I have set the X register for $0500_0000, or about 3.4 seconds. In mode %10101 the first sampling period takes 5.19 seconds and the second sample period takes 3.47 sec. If the time intervals vary and I don't know how many events occurred during each period, how is the result useful? An example would help me understand how to describe this mode's operation and what someone might use it for. Thank you. --Jon
I have set the X register for $0500_0000, or about 3.4 seconds. In mode %10101 the first sampling period takes 5.19 seconds and the second sample period takes 3.47 sec. If the time intervals vary and I don't know how many events occurred during each period, how is the result useful? An example would help me understand how to describe this mode's operation and what someone might use it for. Thank you. --Jon
Comments
Yes, that defines a minimum 'gate time' but that time will stretch-as-needed, to apply to whole periods
Good question
On its own, yes, the reported time is only half an answer, so this mode is used paired with at least another smart pin, which collects the whole period count (usually mapped to the same physical pin).
The two pins collect N whole periods, and dT time for those whole periods, and so Frequency = N/dT in cycles per second.
Another critical element of this, is that the group of used pins, must be all started on the same SysCLK, so in the link below Chip has this
The modes for Time and Periods _10101_ _10111_ are corner stones of Reciprocal Counter design.
The States mode _10110_ uses the pin as a CountEnable and comes for free, and can be used to report duty cycle when divided by the measurement time from a pin in mode _10101_
Chip's example using these modes :
https://forums.parallax.com/discussion/170882/reciprocal-counter-demo/p1
Yes, you've noted the key difference from earlier similar modes that don't have the minimum duration.