ADC Sampling Breakthrough

1444546474850»

Comments

  • jmgjmg Posts: 13,928
    edited 2019-10-10 - 02:35:58
    evanh wrote: »
    That's more detail than is suitable for a one-liner.

    The most important part of my list is the classification clarification of what the type of measurement is: count, accumulate or interval.
    I agree Counter / Timer (interval) info helps, but the word accumulate needs care.
    Some modes I read as gated-timers, which may appear to accumulate during multi period readings, but some reset-on-capture, so using accumulate can confuse users.
    Better would be Gated Counter/ Counter / Gated Timer / Timer, to use terminology that users of other MCU are used to.

    Addit: maybe Period Timer and Gated Period timer are needed too, as P2 smart pins can do more than most MCU timer-blocks. A period timer includes edge-sync features.
  • jmg wrote: »
    Addit: maybe Period Timer and Gated Period timer are needed too, as P2 smart pins can do more than most MCU timer-blocks. A period timer includes edge-sync features.

    I don't want to give any of them a timer label because they are primarily for external measuring of inputs. Where as a timer is more associated with simple metronomics for internal use.
    "We suspect that ALMA will allow us to observe this rare form of CO in many other discs.
    By doing that, we can more accurately measure their mass, and determine whether
    scientists have systematically been underestimating how much matter they contain."
  • evanh wrote: »
    Lol, I bet Wendy's seen it all before.

    Wendy only takes notice of something if there's a problem compiling it, and even then what it does is meaningless to her.
  • %10000 = Time A-input low states and high states
    %10001 = Time A-input high states
  • cgracey wrote: »
    Wendy only takes notice of something if there's a problem compiling it, and even then what it does is meaningless to her.

    :) I was meaning just the large increase in transistor count, rather than what it's doing.
    "We suspect that ALMA will allow us to observe this rare form of CO in many other discs.
    By doing that, we can more accurately measure their mass, and determine whether
    scientists have systematically been underestimating how much matter they contain."
  • evanhevanh Posts: 7,922
    edited 2019-10-10 - 05:15:51
    Ugh! I've failed to comprehend the last three of those modes. You can ignore the description I've got on them.

    EDIT: Ah, I think there's a buffering effect that's got me all in knots.
    "We suspect that ALMA will allow us to observe this rare form of CO in many other discs.
    By doing that, we can more accurately measure their mass, and determine whether
    scientists have systematically been underestimating how much matter they contain."
  • jmgjmg Posts: 13,928
    cgracey wrote: »
    %10000 = Time A-input low states and high states
    %10001 = Time A-input high states

    See questions above
    Does this mode pair clear-on-capture ? Merely says "... and a new measurement begins"
    Also vague is if this is 'gapless' ?
    My guess is one period is consumed at each boundary, but it may be smart enough to capture & restart on the same edge, making capture X-Whole_Periods Time sums gapless, and equivalent to real time.
    (with just a phase delay on the very first edge, after smart pin config/arming, after that, no lost time)


  • jmg wrote: »
    cgracey wrote: »
    %10000 = Time A-input low states and high states
    %10001 = Time A-input high states

    See questions above
    Does this mode pair clear-on-capture ? Merely says "... and a new measurement begins"
    Also vague is if this is 'gapless' ?
    My guess is one period is consumed at each boundary, but it may be smart enough to capture & restart on the same edge, making capture X-Whole_Periods Time sums gapless, and equivalent to real time.
    (with just a phase delay on the very first edge, after smart pin config/arming, after that, no lost time)


    It's gapless, of course. When the input transitions high, it signals for you to get the low time, and vice-versa. No measurement mode misses anything. Everything is gapless.
  • jmgjmg Posts: 13,928
    cgracey wrote: »
    It's gapless, of course. When the input transitions high, it signals for you to get the low time, and vice-versa. No measurement mode misses anything. Everything is gapless.

    That's good, does that include these modes ?
    %10011 Time captured over X whole A-B periods. (Time to read is X periods)
    %10100 is a gated version of that, A=H=Enable, so it gives a % of H time.

    Gapless here needs the X edge that captures, to also be the edge that starts the next time-whole-X ?

    The Smart Pin DOCs should include this important detailing.

  • Yes, gapless means whatever completes the prior reading is also the start of the following reading. Yes, all modes are gapless where relevant.
    "We suspect that ALMA will allow us to observe this rare form of CO in many other discs.
    By doing that, we can more accurately measure their mass, and determine whether
    scientists have systematically been underestimating how much matter they contain."
  • TonyB_TonyB_ Posts: 1,289
    edited 2019-10-10 - 11:08:07
    evanh wrote: »
    Here's my most recent summary of the smartpin counter modes: <snip>
    Suggest removing leading tab and one of the two before ' and space after ' to avoid/reduce sideways scrolling on smaller displays:
    SPM_CNT_QUAD	= %01011_0	'count: A-B quadrature encoder
    SPM_CNT_UP_ENA	= %01100_0	'count: A clock up, B enable
    SPM_CNT_DIR	= %01101_0	'count: A clock, B direction
    SPM_CNT_UP	= %01110_0	'count: A clock up
    SPM_CNT_UP_DN	= %01110_0	'count: A clock up, B clock down
    SPM_ACC_UP	= %01111_0	'accumulate: A up
    SPM_ACC_UP_DN	= %01111_0	'accumulate: A up, B down
    SPM_TIM_STEP	= %10000_0	'interval: of most recent step duration
    SPM_TIM_PULSE	= %10001_0	'interval: of most recent pulse duration
    SPM_TIM_A	= %10010_0	'interval: of X number of A accum/pulses/steps
    SPM_TIMEOUT	= %10010_0	'interval: since high/step
    SPM_TIM_PULS	= %10011_0	'interval: of X number of A-B pulses/steps
    SPM_ACC_PULS	= %10100_0	'accumulate: A up, of X number of A-B pulses/steps
    
    SPM_TIM_OVER	= %10101_0	'interval: until X time + A-B step
    SPM_ACC_OVER	= %10110_0	'accumulate: A up, until X time + A-B step
    SPM_CNT_OVER	= %10111_0	'count: pulses/steps, until X time + A-B step
    
    Formerly known as TonyB
  • Cripes, you must have a very small display there Tony. My browser is only 1280 wide with no scrolling needed ... and I've even got bulky fonts because it's all on a 4k monitor with those extra small pixels.
    "We suspect that ALMA will allow us to observe this rare form of CO in many other discs.
    By doing that, we can more accurately measure their mass, and determine whether
    scientists have systematically been underestimating how much matter they contain."
  • evanh wrote: »
    Cripes, you must have a very small display there Tony. My browser is only 1280 wide with no scrolling needed ... and I've even got bulky fonts because it's all on a 4k monitor with those extra small pixels.

    1024x768 and your table fits perfectly with whitespace trimmed.
    Formerly known as TonyB
  • I recommend a 43" for your next monitor. :) I wish I'd waited a little longer until they were on the market. I guess I could have gone for a TV back then but I didn't really trust them, finding info like IPS construction is not generally available for TVs.
    "We suspect that ALMA will allow us to observe this rare form of CO in many other discs.
    By doing that, we can more accurately measure their mass, and determine whether
    scientists have systematically been underestimating how much matter they contain."
  • evanh wrote: »
    I recommend a 43" for your next monitor. :) I wish I'd waited a little longer until they were on the market. I guess I could have gone for a TV back then but I didn't really trust them, finding info like IPS construction is not generally available for TVs.

    +1

    Note that the "screen door" effect on TVs can be bad if used as a monitor, so definitely go for 4k. ;)
    James https://github.com/SaucySoliton/

    Invention is the Science of Laziness
  • evanhevanh Posts: 7,922
    edited 2019-10-11 - 15:14:43
    Tony,
    It won't fit now. I've started using the extra space. :D

    EDIT: I think I've got things tidy and correct now - https://forums.parallax.com/discussion/comment/1479535/#Comment_1479535

    EDIT2: Getting a handle on these modes means I'm reasonably sure that SPM_ACC_OVER can provide a synchronised pulse density measurement without any external clock. The tricky part will be in processing it, since the timebase becomes uncertain due to complete pulses determining each sample period.
    "We suspect that ALMA will allow us to observe this rare form of CO in many other discs.
    By doing that, we can more accurately measure their mass, and determine whether
    scientists have systematically been underestimating how much matter they contain."
  • jmgjmg Posts: 13,928
    evanh wrote: »
    EDIT: I think I've got things tidy and correct now - https://forums.parallax.com/discussion/comment/1479535/#Comment_1479535
    I think introduction of new words here (step, pulse then step/pulse ?), that are not used in Chip's docs, will only confuse users.

    Chip uses period in the DOCs, why not keep using that ?

    Chip uses 'state' which is also confusing, when I think he really means gated, or 'enabled when hi' (working back from context)
    Other MCUs talk about Timer/Counters/Capture and Gated (Timers or Counters), so those terms are already in common use, & best to use words that cross language barriers already.

    The change to 'for at least X duration' is good here, as that shows the very important detail of whole periods.

    SPM_TIM_OVER = %10101_0 ' interval: of A-B pulses/steps, for at least X duration
    SPM_ACC_OVER = %10110_0 ' accumulate: A-B pulses/steps, for at least X duration
    SPM_CNT_OVER = %10111_0 ' count: A-B pulses/steps, for at least X duration

    but OVER means over what ? Better may be SPM_CNT_GEX for Greater than or equal to X aka for at least X duration.

    FWIR Chip has designed most (all?) smartpin modes to clear-on-capture, and in a smart way. (if an edge was going to increment, on capture clock instant, clear is to 1 instead of 0, to not lose an edge)
    That feature not showing yet in all pinmode sections docs, but is hinted at by ".. then the result will be placed in Z, while the accumulator will be set to the 0/1/-1 value that would have otherwise been added into it, beginning a new measurement"

    That means 'accumulate' is going to rather confuse users, as nothing actually accumulates across readings. A better top level word than accumulate, is gated, which is what the HW actually does.
    Gated modes will always have some duty related percentage of 100% of possible count, but otherwise acts the same as whole-period modes.

    A merge of Chip's docs
    %10101 = For periods in X+ clock cycles, count time
    %10110 = For periods in X+ clock cycles, count states
    %10111 = For periods in X+ clock cycles, count periods

    and merge of the above, for clarity (removing words pulse/step/state) would give something like this

    SPM_TIM_GEX = %10101_0 ' Time interval of N whole periods, for at least X duration (capture dT)
    SPM_GAT_GEX = %10110_0 ' Gated time interval of N whole periods, for at least X (capture %dT)
    SPM_CNT_GEX = %10111_0 ' Count of N whole periods, for at least X duration (capture dN)


    Some examples:
    Reciprocal Counting:
    Two smart pins, in complementary modes of
    SPM_TIM_GEX = %10101_0 ' Time interval of N whole periods, for at least X duration (capture dT)
    SPM_CNT_GEX = %10111_0 ' Count of N whole periods, for at least X duration (capture dN)
    started in sync, with a nominal/min capture timebase of X, will give precise, no lost edges, continual readouts of Cycles and Time, for a reciprocal calculation of Freq = dN/dT, and a background rolling total of sum(dN)/sum(dT) will give very high precision frequency calculations.

    Precision Duty:
    Two smart pins, in complementary modes of
    SPM_TIM_GEX = %10101_0 ' Time interval of N whole periods, for at least X duration (capture dT)
    SPM_GAT_GEX = %10110_0 ' Gated time interval of N whole periods, for at least X (capture %dT)
    started in sync, with a nominal/min capture timebase of X, will give precise, no lost edges, continual readouts of %dT and dT, for a Duty calculation of Duty= %dT/dT, and a background rolling total of sum(%dT)/sum(dT) will give very high precision Duty.

    Simpler Duty:
    With a good stability Duty source, one smart pin can alternate
    SPM_TIM_GEX = %10101_0 ' Time interval of N whole periods, for at least X duration (capture dT)
    with
    SPM_GAT_GEX = %10110_0 ' Gated time interval of N whole periods, for at least X (capture %dT)
    Alternating readouts of %dT and dT, for an estimated Duty calculation of Duty= %dT/dT
    Poor stability sources, will jitter/wander between these two captures, but they should track slow thermal drifting of RC oscillators in sensors.

  • jmgjmg Posts: 13,928
    edited 2019-10-11 - 20:17:08
    cgracey wrote: »
    It's gapless, of course. .... No measurement mode misses anything. Everything is gapless.
    Expanding the gapless question a little, in my post above of simple duty, using alternate smart pin modes, what happens ?
    I presume the change of mode resets everything, and it will need to pause (typically) one iDuty period to resync, but the captured changes will be valid ?
    For higher rate sensors, that's not going to matter much, but for lower rate ones (capture a single pulse) it may lower user reading rate a little - becomes Fi/4 ?
    Precision Duty avoids this, giving reading rate of Fi, but costs 2 smart pins.
  • Some mode combinations can be alternated but others just die. Many smartpin modes need a DIRL/DIRH surrounding sequence. As for gaplessness, I think all bets are off when changing modes. You might get lucky in special cases of close modes.
    "We suspect that ALMA will allow us to observe this rare form of CO in many other discs.
    By doing that, we can more accurately measure their mass, and determine whether
    scientists have systematically been underestimating how much matter they contain."
Sign In or Register to comment.