Getting started with Analog

I'm starting to learn how the Propeller handles A/D. The information I can find feels limited, in C, or dated with broken links.

Is there a resource I should be using to learn this? I would like to remain with the Propeller family using Spin. I would like to ignore the C language as much as possible. (I invited that clown to a birthday party once and scared the kids!)

I get the impression a naked Propeller can handle A/D from devices like accelerometers, but many people use an external ADC chip. Which direction should I go?

I don't have an application yet as I'm simply learning.


  • Cluso99Cluso99 Posts: 16,676
    edited 2020-10-09 - 20:40:05
    ADC - depends...

    Accelerometers and the likes do the ADC in the addon chip presenting the info usually on an I2C bus and is easy with a software driver on the prop.

    Other interfaces depends on what you are trying to do. If you are trying to just read a voltage then you can do it inside the prop. More complex stuff or better accuracy might require an external ADC chip.

    There is an ADC app note for the prop - should be on the main parallax website. Might come with proptool ??? The P1 prop doesn’t have inbuilt ADC but you can use sigma delta as described in the app note. Sorry I don’t have a link.
  • I suggest the MCP3208 ADC. Plenty spin files out there for it.
  • I have pretty much stuck with MCP3201 for ADC, but after Peters pot discussion, I have been playing with pwm DAC with pretty good results. Thinking of using it on a dedicated cog for Vref for something I'm playing with.
  • Over on the P2 forum pbj talks about the uPORT, a product he will soon have available. Prop plug and adc on one tiny board.
  • The P1 doesn't have built-in ADCs, but if you're analog input is, say, reading a potentiometer, you can do it by adding a capacitor and a bit of code. You can create a sigma-delta ADC in a cog, but it takes two pins for one analog input. I'm working on a client project that has five analog channel requirements, so we're using the MCP3208 as has been suggested in this thread. It's quite easy to use. There are others in that family that work with similar code.

    If you want to learn about RC charge-discharge timing for reading a pot, go to the Help menu in Propeller Tool and open the PEK documentation; it's covered in there.
  • Many thanks! Of course I have already placed a DigiKey order for an unrelated project. Kinda hard to eat another $10 shipping bill for a $3 item. I'll get a 3208 on the next order. I wish I found the Propeller sooner. It's the first platform I've used that actually solves problems rather than introducing them, ie, I don't have to find ways to get around it's limitations. Plus the Python-esque nature of Spin is perfect for my interests! I just need the IDE to run on Linux and it sounds like the new stuff will.
  • Parallax is very Windows-centric -- someday, I hope they'll brace cross-platform internally. I know that Propeller Tools runs fine on an emulator in the Mac OS, so I suspect will with Linux, too.

    I've attached my MCP3208 object to help yo get started.

    Since you're new to the Propeller, you *might* find this presentation helpful.
    It's a bit long, but many said they found it very helpful. Your mileage may vary. :)
  • For running on linux, BST still rules! Even now using Fedora 32. Actually Fedora 32 has been one of the easiest setup I have done in a while. You may have to load up some 32 bit libs, but otherwise, pull BST (three parts from the fnarfbargle site and try it out.
Sign In or Register to comment.