Shop OBEX P1 Docs P2 Docs Learn Events
Parallel ADC — Parallax Forums

Parallel ADC

Jay KickliterJay Kickliter Posts: 446
edited 2009-09-21 17:01 in Propeller 1
I looked and searched in the regular places but couldn't find any info. Does any one have sample PASM code for reading a parallel ADC? I know that's kind of vague, because I'm not entirely sure what I need, other than for the project I'm working needs to sample at ~44 kHz, and I'd like to keep it all in one cog if possible. I don't need many spare pins, and only about 10 bits of resolution., and 2 channels.

thanks,

Jay

Comments

  • LeonLeon Posts: 7,620
    edited 2009-09-20 15:12
    Reading a parallel ADC should be quite straightforward. Which device are you using?

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-09-20 15:13
    Hello Jay,

    do I understand right 2 channels at 10 bit means 20 IO-Pins for reading in
    reading-in-frequency around 44 kHz

    and another question what are you doing with the values ?
    how many of them do you have to store ?

    I haven't read any datasheet of a parallel ADC. But I think the basic principles is to trigger a sampling through switching one PIN
    from low to high or high to low and then readin the bits of the value and store them away.

    in PASM
    First step could be a loop toggling the sample-pin
    Second step reading in a value and store it in a SPIN-variable (pointer to SPIN-var delivered to the PASM-cog via the "par" parameter
    Third step experimenting with self-modifying code to change the RAM-adress to store values

    combining all this to one PASM-program

    So if you start with some PASM-code and come back with a detail question how do I ....
    you will get help here surely

    best regards

    Stefan
  • Jay KickliterJay Kickliter Posts: 446
    edited 2009-09-21 02:20
    I haven't picked a device yet. I was hoping someone had some code already for one. It does seem pretty easy, but all channels use the same data bus, so some interfacing is still necessary.

    I'll just buy one that seems the easiest to interface, and give it a go.

    @Stefan, it is for a dynamic range compressor. It actually isn't my project, since I don't do recording. I'm trying help a buddy who is new to microcontrollers.

    Jay
  • yarisboyyarisboy Posts: 245
    edited 2009-09-21 02:56
    When I Googled these devices some vendors were calling flash converters parallel converters. When I searched with the term parallel output I got the chips with a parallel digital data interface. In short successive approximation converters with a parallel data interface could do 500 Ksps and mux in multiple channels for about $16ea.. The flash converter chips with a parallel data interface could do 1 Msps with ease. I don't need that much speed so I didn't price them. Mr. Green gave me the low-down on what one has to do to bring in the data.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    MOORE'S LAW: The capabilities of electronics shall double every 18 months.
    cloyd's corollary: Hardware is easy, software is hard.
  • TimmooreTimmoore Posts: 1,031
    edited 2009-09-21 04:41
    You should be able to do it with a SPI ADC as well. For example the driver I have for the tlv2553 does ~9000 samples/sec for 14 channels. If you only use 2 channels of the A2D that should be ~63Ksamples/sec.
  • Agent420Agent420 Posts: 439
    edited 2009-09-21 12:23
    Depending on your specific application, you may need to address things like antialiasing filters etc in your analog front end.·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • kwinnkwinn Posts: 8,697
    edited 2009-09-21 16:51
    A parallel ADC should be fairly straight forward to connect to a prop and programming is almost as simple as a parallel port.

    Typical signals would be:

    One input line per bit of resolution ( 10 lines for 10 bit ADC )
    One output bit to start a conversion.
    One input bit to detect completion of a conversion.
    One to three output bits to select the channel to convert.

    For some ADC's each signal may be on a separate pin, but in most cases communication is over a data bus to address internal registers on the ADC chip. You may find a 12 bit ADC is easier to find and less expensive than a 10 bit one and the additional bits can be ignored. Also 12 bit chips at 20 million samples a second are not much more money than many of the slower chips. Never hurts to have some extra speed.
  • Jay KickliterJay Kickliter Posts: 446
    edited 2009-09-21 17:01
    Timmore, I've used SPI ADCs in past projects. I wanted to try a parallel ADC since I frequently wasn't able to fit the ADC sampling code and my code in one cog. We're not going to use floating point for this project, so I may be able to squeeze them both in.

    Agent420, thanks for pointing that out. I've always hear the term "anti aliasing" but never understood why it's important.

    kwinn, that's about what gathered so far. I've seen some that take way more pins though, not sure what they're all for. You're right about 12 bits vs 10 bits. I never thought to just ignore some.
Sign In or Register to comment.