Shop OBEX P1 Docs P2 Docs Learn Events
P2 smart pins just DAC but no ADC? — Parallax Forums

P2 smart pins just DAC but no ADC?

Going thru the Google docs documentation I find no reference to ADC.

64 analog pins implied to me that not just DAC (as in analog output) is possible but also ADC (as in analog input).

Am I completely wrong here or did ADC got cancelled? I think that analog input (and streaming to HUB/LUT) would be very useful.

confused,

Mike

Comments

  • evanhevanh Posts: 15,915
    edited 2016-03-28 02:55
    The DACs are fast "flash" DACs I think. They are complete all-in-one 8-bit DACs with add-on, via the counters, dithering and the likes for extended resolution. The ADC ability comes from the counters, they are internally bit-streamed 1-bit ADCs, so are not complete without the counters. The ADCs are more limited in speed terms.
  • Seconded. I seem to remember input modes too.

  • cgraceycgracey Posts: 14,152
    It's there. It's the mode which counts highs for a programmable period. The DAC modes also do the same type of highs accumulation, but that won't be workable until we get the custom-silicon smart pin.

    My older two kids and I passed through Clear Lake at 1am on Saturday morning, after a funeral we attended in Fort Bragg. I almost pm'd you to ask if we could sleep on your floor, since we were so tired from driving all day. We wound up making it all the way Williams before I pulled into a rest stop and fell asleep for two hours. We finally got home at 6am.
  • evanhevanh Posts: 15,915
    So, the Smartpin mode to use to gather the ADC's bitstream is 01100 - Increment on A-high.
  • evanhevanh Posts: 15,915
    cgracey wrote: »
    ... but that won't be workable until we get the custom-silicon smart pin.

    Good point. No use trying to test this in the FPGA.
  • evanhevanh Posts: 15,915
    edited 2016-03-28 03:19
    cgracey wrote: »
    The DAC modes also do the same type of highs accumulation ...

    The final DACs are to be solely bitstreamed? That makes sense but your use of flash DACs on the Prop123 had muddied my thinking.
  • cgraceycgracey Posts: 14,152
    evanh wrote: »
    cgracey wrote: »
    The DAC modes also do the same type of highs accumulation ...

    The final DACs are to be solely bitstreamed? That makes sense but your use of flash DACs on the Prop123 had muddied my thinking.

    The DACs are "flash", while the ADC is bitstreamed.
  • evanhevanh Posts: 15,915
    Nice, real nice with that random dithering you demoed a while back! Part of me wonders how real-estate costly that is compared to pure bitstreaming. I guess the 8-bit DAC always fitted okay or you wouldn't have been putting one on every pin.
  • cgracey wrote: »
    It's there. It's the mode which counts highs for a programmable period. The DAC modes also do the same type of highs accumulation, but that won't be workable until we get the custom-silicon smart pin.

    My older two kids and I passed through Clear Lake at 1am on Saturday morning, after a funeral we attended in Fort Bragg. I almost pm'd you to ask if we could sleep on your floor, since we were so tired from driving all day. We wound up making it all the way Williams before I pulled into a rest stop and fell asleep for two hours. We finally got home at 6am.

    Good to know, that ADC is still in there. After the hills the way from Clearlake to Williams is quite boring. Good call to take a nap before entering HW5.

    Don't hesitate next time, I always have space for some guests.

    Enjoy!

    Mike

  • cgracey wrote: »
    evanh wrote: »
    cgracey wrote: »
    The DAC modes also do the same type of highs accumulation ...

    The final DACs are to be solely bitstreamed? That makes sense but your use of flash DACs on the Prop123 had muddied my thinking.

    The DACs are "flash", while the ADC is bitstreamed.

    the DACs settle quickly correct? It could be interesting to look at adding a high speed comparitor on P3, together with some Successive Approximation sequencing logic, could make for much faster ADCs
  • cgraceycgracey Posts: 14,152
    Tubular wrote: »
    cgracey wrote: »
    evanh wrote: »
    cgracey wrote: »
    The DAC modes also do the same type of highs accumulation ...

    The final DACs are to be solely bitstreamed? That makes sense but your use of flash DACs on the Prop123 had muddied my thinking.

    The DACs are "flash", while the ADC is bitstreamed.

    the DACs settle quickly correct? It could be interesting to look at adding a high speed comparitor on P3, together with some Successive Approximation sequencing logic, could make for much faster ADCs

    The DACs settle in under 3ns. I never thought about SAR, since we don't have a sample-and-hold circuit, but it could be done in software. The precision comparator takes about 30ns to react to 100mV, but much longer for 10mV. We'll see.
  • Yeah it'd be fun to try in software. Is there an easy mode for reading the comparator output via the IN signal already?

    The other question chip is say I want to talk to a 2.5v or 1.8v system but the VIO is 3v3. Is there a mode where we can preset the DAC "high" voltage, then OUT just works like a usual digital output from software point of view? This could also be useful for a kind of emulated LVDS

  • cgraceycgracey Posts: 14,152
    Tubular wrote: »
    Yeah it'd be fun to try in software. Is there an easy mode for reading the comparator output via the IN signal already?

    The other question chip is say I want to talk to a 2.5v or 1.8v system but the VIO is 3v3. Is there a mode where we can preset the DAC "high" voltage, then OUT just works like a usual digital output from software point of view? This could also be useful for a kind of emulated LVDS

    You would just configure the low-level pin as a comparator input and it would return the comparator output on IN. The companion pin is always the odd/even neighbor.

    We could make a digital mode like you describe, but the problem is that the DACs take static current. Running 8 of them would be maybe okay in 1k-ohm mode, but it would take a lot current in 75-ohm mode (8 * 13mA = 104mA). To go along with digital DAC output, there is an internal DAC in each pin which can drive the other side of the comparator. Whatever value DAC level high is could be shifted right by one bit and used to drive the DAC for internal comparison. That would give DAC-level digital input and output. That would be a simple and useful thing to make a mode of.
  • cgraceycgracey Posts: 14,152
    edited 2016-04-01 09:11
    Tubular wrote: »
    Yeah it'd be fun to try in software. Is there an easy mode for reading the comparator output via the IN signal already?

    The other question chip is say I want to talk to a 2.5v or 1.8v system but the VIO is 3v3. Is there a mode where we can preset the DAC "high" voltage, then OUT just works like a usual digital output from software point of view? This could also be useful for a kind of emulated LVDS


    I had to think about this for most of the day, but found a nice way to implement it using what were the PINSETM %T and %D bits. They are combined to make %TT now, which is mode-dependent. I think we've got it all covered.

    I also added A-edge to B-edge timer modes into those four blank slots. I just extended the measuring block to cover it. Very little logic was required.

    If you go to the main documentation link (not the intermediate doc), I've added to the end a new smart pin description, in preparation for a new whole release.

    PINSETM now uses #1, not #0 for D to signal PINACK. This means that pins can be reset with #0 now, instead of #1.

    The smart pins are now done, barring any bug fixes.
  • jmgjmg Posts: 15,173
    cgracey wrote: »
    I also added A-edge to B-edge timer modes into those four blank slots. I just extended the measuring block to cover it. Very little logic was required.

    Sounds good,
    Is there Atomic control of such paired counters ?
    ie can they reset / arm on the same SysCLK edge ?
  • cgraceycgracey Posts: 14,152
    jmg wrote: »
    cgracey wrote: »
    I also added A-edge to B-edge timer modes into those four blank slots. I just extended the measuring block to cover it. Very little logic was required.

    Sounds good,
    Is there Atomic control of such paired counters ?
    ie can they reset / arm on the same SysCLK edge ?

    I know you've explained this 10 times, but I'm not sure if they can in the way you mean. They can brought out of reset at the same time.
  • cgracey wrote: »
    I had to think about this for most of the day, but found a nice way to implement it using what were the PINSETM %T and %D bits. They are combined to make %TT now, which is mode-dependent. I think we've got it all covered.

    I also added A-edge to B-edge timer modes into those four blank slots. I just extended the measuring block to cover it. Very little logic was required.

    If you go to the main documentation link (not the intermediate doc), I've added to the end a new smart pin description, in preparation for a new whole release.

    PINSETM now uses #1, not #0 for D to signal PINACK. This means that pins can be reset with #0 now, instead of #1.

    The smart pins are now done, barring any bug fixes.

    Sounds really good, Chip.

    I have a request relating to the streamer, although perhaps there is already a way to do this. The streamer data can operate in NCO mode right up to full sysclock (80 MHz currently), but (I think) the maximum clock rate that can be generated is half sysclock, 40 MHz (accumulating $80000000 on each cycle for 1:1 toggling output)

    If the above is correct, would it be possible to have a mode where, if the accumulation is > $80000000 and results in a MSB '1' , then it ORs with the system clock to generate a pulse (6.25ns high, then 6.25ns low) ? That'd let us work with high speed dacs like the video one you used on the a9, as well as perhaps getting above 148 MHz hdmi in the final silicon.

    The existing CIO inversion at pin level could be used to change the phase if required.
  • cgraceycgracey Posts: 14,152
    Tubular wrote: »
    cgracey wrote: »
    I had to think about this for most of the day, but found a nice way to implement it using what were the PINSETM %T and %D bits. They are combined to make %TT now, which is mode-dependent. I think we've got it all covered.

    I also added A-edge to B-edge timer modes into those four blank slots. I just extended the measuring block to cover it. Very little logic was required.

    If you go to the main documentation link (not the intermediate doc), I've added to the end a new smart pin description, in preparation for a new whole release.

    PINSETM now uses #1, not #0 for D to signal PINACK. This means that pins can be reset with #0 now, instead of #1.

    The smart pins are now done, barring any bug fixes.

    Sounds really good, Chip.

    I have a request relating to the streamer, although perhaps there is already a way to do this. The streamer data can operate in NCO mode right up to full sysclock (80 MHz currently), but (I think) the maximum clock rate that can be generated is half sysclock, 40 MHz (accumulating $80000000 on each cycle for 1:1 toggling output)

    If the above is correct, would it be possible to have a mode where, if the accumulation is > $80000000 and results in a MSB '1' , then it ORs with the system clock to generate a pulse (6.25ns high, then 6.25ns low) ? That'd let us work with high speed dacs like the video one you used on the a9, as well as perhaps getting above 148 MHz hdmi in the final silicon.

    The existing CIO inversion at pin level could be used to change the phase if required.

    That is tough to do because it violates synchronous timing rules. I know it's possible, but I really shied away from things like that with synthesis. Maybe this could be revisited before the chip is done.
  • Ah yes, fair enough. Doing it last would make sense then
  • jmgjmg Posts: 15,173
    edited 2016-04-01 20:24
    cgracey wrote: »
    jmg wrote: »
    cgracey wrote: »
    I also added A-edge to B-edge timer modes into those four blank slots. I just extended the measuring block to cover it. Very little logic was required.

    Sounds good,
    Is there Atomic control of such paired counters ?
    ie can they reset / arm on the same SysCLK edge ?

    .... I'm not sure if they can in the way you mean. They can brought out of reset at the same time.

    If the mechanism is there to bring multiple counters out of reset on the same SysCLK edge, that sounds very close.

    Can that same mechanism not be used for Capture Enable/Disable/Arm, across more than one counter ?


  • jmgjmg Posts: 15,173
    cgracey wrote: »
    That is tough to do because it violates synchronous timing rules. I know it's possible, but I really shied away from things like that with synthesis. Maybe this could be revisited before the chip is done.

    What you could do, as an interim solution, to allow some testing, would be to allow output the SysCLK to a pin ?
    Many MCUs have that ability.

    If that could also have a count number, that would be more flexible.

    High MHz is always going to push the pin slew/slew abilities, but this may allow a lower overall SysCLK in designs too.
Sign In or Register to comment.