Shop OBEX P1 Docs P2 Docs Learn Events
prop and mcp3208 combo for testing analog experiments — Parallax Forums

prop and mcp3208 combo for testing analog experiments

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2012-09-04 10:08 in Propeller 1
So i cant afford a scope just a fact of life.. i pmed beau about his prop base io scope told him what i was up to and he said that his scope isnt sufficent for my purposes.

anyways i got a few microchip mcp3208 adc's on the way. i was reading they should be able to sample up to 100khz. that seems pretty decent.. now i cant write a scope have no where near that kind of skill yet but i was thinking i could use one of these to connect to a prop and load the obex object for it. My problem is im learning about analog stuff like rc time, transforming waves, inductors all that basic stuff and my meters just suck for example rc charge times monitpred with a meter are never what the math should be. im using a 10 dollar wal mart special and a decent 35 dollar meter with a cap meter and frequency timer, but they both seem to suck lol. im wondering if these adcs and a prop could be more accurate trying to test and debug analog m. just plan on feeding the data through the props serial terminal.

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2012-09-01 00:02
    Hi,

    with what values didi you do the experiments. If the RC-Time-constant is 60 seconds you should be able to measure values close to the math.

    With an MCP3208 you should be able to measure faster than with a DMM. There are several MCP3208-objects in the obex. Try them and when you encounter a problem come back
    posting your code and a detailed desciption of what you try to achive.

    best regards
    Stefan
  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-09-01 00:08
    If the following is old news..... Otherwise, my take on your question...........

    Yes, the MCP32xx will do a 100kHz sample rate, but (anyone correct me if offbase) that is 10uS conversion time PER CHANNEL. So if you are using the MCP3208, and if you are coded to sample and convert all 8 channels, that will become 80uS conversion time for all channels. The prop overhead to handle this may not alter this time to much in PASM. That drops the max sample rate for all channels to about 12ksps. Another consideration would be the fact that none of the MCP32xx family has a sample and hold stage, and whatever is present at the time the conversion starts, that is what is digitized and can give rather misleading results. If you are not sample rate bound, a multiple input device may be sufficient, however, if you want to capture multiple inputs simultaneously, you will either have to design a sample and hold for each of the multiple inputs (with supporting control structures) or the same sample and hold with single channel MCP3201s if you need to have all the data captured on a 100ksps sample rate. By the way, this translates to a max of 50kHz frequency component allowed in to the input of the sample stage. If you exceed this, you will get some very squirlley results due to aliasing. Further while you can recreate the frequency having only two samples per cycle, for acuracy you may want many more samples. The more samples, the more accurate the impression of the input waveform. I have posted an object for multiple parallel capture in the OBEX for the MCP3201, a bit basic (version 0. release) and some improvements to make still, but it does work up to 100ksps.

    As to why your bottom feeder meters do not seem to give you the results you expect, their own circuits can possibly alter the actual circuit by their presence. Consider saving and spending 1-2 hundred on a good amprobe meter. Or mid-grade Fluke. Check ebay for scopes, or even ebay or sparkfun for usb scopes that dump to your PC. There are also little projects out there that will show you how to use your sound card as a scope as well. Of course these are severly bandwidth limited, but if your just learning, they would be the cheapest way to get a scope tool for the bench until you are ready for the more expensive toys.

    Finally if you are just learning (rest of ya please just hold your noses if you disagree), you can use one of the various simulators out there. There is a bit of a learning curve for these, but they will show you whay you have done, or at least close enough. Most manufactureres have free cut-downs of their commercial offerings. TI had tina, Linear Tech also offers another simulator. TI now also has taken over the virtual bench that national semi had up as well. Linux comes with a couple depending on the distro. So, no reason to buy a fortune in tools and test equipment just to learn.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-01 16:32
    thanks guys very helpfull info! basically i used electrodroid on 1s tc circuit and my bookk says it should take 5s and electrodroid great android electronics app says 4 seconds. when i used my meter i counted 8s i just now realized i used the meter with auto ranging that could be the issue..

    @kwinn i just cant afford decent equitment at the moment i cant even afford parts. i mostly just get samples or build equitment. basically my arsenal is a propalyzer 112mhz la some dmms and a bus pirate i get by. are u telling me that the mcp3201 is a more accurate choice i can get a few of those. is there neway to tie these chips togather for more bandwith? id love to maybe build a 1mhz scope at some point
  • StefanL38StefanL38 Posts: 2,292
    edited 2012-09-02 01:04
    Hi,

    I guess tying together several MCP3201-chips would mean you would need e cog for each MCP3201 to get the speed of 100 kHz on each channel.
    But again: just for learning take other values that result in a higher RC-constant and you can do it all with the MCP3208.

    As you have an internetconnection there are several simulation-sofware like PPSICE, NI Multisim etc.
    and a lot of things you can learn just by reading. http://openbookproject.net//electricCircuits/DC/index.html
    Did you ever take a look into interactive java simulations like this? http://phet.colorado.edu/en/simulations/category/physics/electricity-magnets-and-circuits

    So why does it have to be 1 MHz Scope?

    best regards
    Stefan
  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-09-02 21:16
    Actually Stefan, I have not gone back to see if more than one MCP3201 on a single cog for 100 ksps can be done. I originally created my MCP3201 parallel object in the OBEX for a method of capturing multiple channels in parallel with no time skew between the channel sample times. The cog allocation is one master for control and interface etc, one for master timing generator for sample timing, one additional cog for each MCP3201. It is (when I quit playing with A/D,D/A chips) intended for capturing the values from an instrumented 1970s BJT/FET curve tracer project.

    Thinking about sampling more than one MCP3201 per cog may be possible, but w/o sample and hold amps on the input, there will be a T(skew) time introduced between the first MCP on the cog and the next and so on. So it really comes down to skew for my purposes, but if that is acceptable, you could probably run more. But then you might as well go with an MCP32x2/4/8 devices.

    But it has been fun when time permits me to play!!!!

    MfG

    Frank

  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-03 00:26
    Hmmm no i guess 1mhz just sounds round it covers audio, most i2c, alot of other stuff too. Like I said im not gonna go out and build a scope when these come id be fool if i said that im just wondering down the line how hard it that would be or if itd even be very possible with a prop.

    Basically im really just hoping these are fast enough and accurate enough and easy enough that I can hook them up to a prop load an obex object and the serial object and test stuff then spit the data back out to the serial terminal. Can an ADC measure current also or just voltage? I really want to get into electronics and someday make a living out of lower level stuff, but im one of those people who strive to learn things and be as good as I can, and I feel like knowing how to code and knowing enough to hook a few chips together just isnt enough i need a good analog foundation too if i wanna be well rounded, id love to build a VFO to clock the propeller with but hell thats wayyy over my head!! I mean im struggling learning how to use a transistor as an amplifier right now :). Since i cant afford a scope I figured id hopefully slap togather an adc with a quickstart and a serial port and make do... maybe learn a simulator.
  • StefanL38StefanL38 Posts: 2,292
    edited 2012-09-03 08:14
    surely you can measure currents with ADCs the same way as (almost) every (low) current is measured: Through a voltage-drop across a shunt-resistor.
    Your electronic-knowledge has great improvement-potential. I recommend that you read things like http://openbookproject.net//electricCircuits/DC/index.html
    Before trying to understand how a transistor works you should have a basic understanding of Ohm's Law.

    f.e. here is a transistor simulation http://www.falstad.com/circuit/e-npn.html
    As far as I have tested simulations none of them covers all aspects and the quality of the explanations is mostly only medium-level.
    So I recommend whenever you encounter problems in understanding something its not your "thumbness" in 99% of all cases its the low quality of the explanation.
    So just google for another simulation/explanation to get additional information that is easy to understand.
    best regards
    Stefan
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-03 09:43
    ' i do understand ohms law acually but that about it. At one time i was an electrician and i had to go to school the forst year was all a bunch of dc theory. all we do was solve a bunch voltage and current drop problems.

    the difference between that and the real world is quite a big gap though. in a book they always just give u the nubers in the real world u have to hope u can find them in a data sheet (this is not always as easy as i thought it may be) or figure it out with tools. I understand you can use a resistor to calculate the current i guess i just woondered if an adc would just read current like a dmm does. This was few years back im not saying im not a little rusty but i have the fundamentals.unfourtantelly i picked up Make: Electronics and i dont think it was the best book choice, i mean its very hands on and practical but it doesnt spend to much time on theory.

    I have seen the poor mans scope. once again i dont really know its usefulness do to speed since. Im not claming i need a fast scope... i dont really know what i need i have no idea how bandwith really relates to analog dc circuits. i understand digital and that the bandwith is how many off and ons a second your circut is doing, but i have no idea how frequency and speed relate to for example an rc circiut i was hoping a scope would help me understand that.
  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-09-03 10:21
    Actually you should go to your nearest community college or used bookstore (or half price if there is one near you, best one I've seen was in Dallas) and look at the used text books. Or scan the books at Goodwill. You may find a gem like "Introductory Devices and Circuits" from about 1989/91. Highly usefull to learn fundamentals and actually be able to apply the material with real experimentation and calculation. You should go this route before going far with the prop or you may end up too deep in the woods to appreciate the forest surrounding the prop. Digital is on or off, true/false etc. All the world is analog, digital can do nothing without the ability to see and interact with the world.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-03 14:20
    Wow you would say knowing the analog side of things is that important? From all the podcasts I listen too the amp hour, prototypers etc .. it seems to me like most people either know alot about analog, or digital, and only an exceptional hand full of people are just very well rounded and totally capable of designing ggreat analog and digital stuff. People on here like Phil just amaze me, i mean when i see someone stack 8 srams and write a parrallel driver i think dang thats cool i cant wait till i get that good with hardware, but when I see phils projects like modems, or FM transmitters using the propeller in crazy ways using alot of analog stuff it just blows me away!!

    Ill keep an eye out for the book you listed above, what about the art of electronics or even better the free http://www.allaboutcircuits.com/ do you think those would help get me a better footing in the analog realm? Im not to worried about digital I know it will just come come, I already understand quite a bit of it and have been programming for long enough. I mean if you can use sockets in C on a pc, Im sure figuring out spi and i2c isnt to much different!
  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-09-03 20:47
    Wow you would say knowing the analog side of things is that important? From all the podcasts I listen too the amp hour, prototypers etc .. it seems to me like most people either know alot about analog, or digital, and only an exceptional hand full of people are just very well rounded and totally capable of designing ggreat analog and digital stuff. People on here like Phil just amaze me, i mean when i see someone stack 8 srams and write a parrallel driver i think dang thats cool i cant wait till i get that good with hardware, but when I see phils projects like modems, or FM transmitters using the propeller in crazy ways using alot of analog stuff it just blows me away!!

    Ill keep an eye out for the book you listed above, what about the art of electronics or even better the free http://www.allaboutcircuits.com/ do you think those would help get me a better footing in the analog realm? Im not to worried about digital I know it will just come come, I already understand quite a bit of it and have been programming for long enough. I mean if you can use sockets in C on a pc, Im sure figuring out spi and i2c isnt to much different!

    That book listed above was a lucky find. Far more depth than more contemporary intro books. But yes absolutely to Art of Electronics, the allabout circuits.com link and a flood of other resources. I have personally played around and experimented with so much of both worlds simply because every medical imaging device is a complex combination of analog and digital systems all performing in a specific and critical function to produce a diagnostically usefull image that is acceptable to a radiologist. You can not be a digital or analog only type to service and support these systems.

    But absolutely go back to the basics from AC/DC including network theory, so that you can not only gain an understanding of gain, offset, bias, noise sources and mediation, because once you have a handle on these things you can use various resources to design your own on the fly for what you want, not merely adapting what someone else has done for a "loose fit maybe". Also you will be able to use simulation more reasonably. Just like a calculator, if you don't have an idea of what you should get, then whatever you get must be correct, right? You will be able to ask more specific questions since you will already have handled the obvious......
  • jmgjmg Posts: 15,173
    edited 2012-09-03 21:15
    .. im using a 10 dollar wal mart special and a decent 35 dollar meter with a cap meter and frequency timer, but they both seem to suck lol. im wondering if these adcs and a prop could be more accurate trying to test and debug analog m. just plan on feeding the data through the props serial terminal.

    If you want a better Volt Meter, I just posted an update on the NAU7802 in another thread.
    2 Channel, 24 bits, 5V, for under $2 So16 or Dip16

    http://forums.parallax.com/showthread.php?141965-High-Precision-Propeller-Sigma-Delta-ADC&p=1123481&viewfull=1#post1123481

    For time-interval measurements, use the Prop.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-03 22:51
    @jmg Wow thats a nice find! That chip is pretty feature rich too besides the ADC. My only issue is that i am just begining to learn about all this stuff i couldnt write a driver for this yet. I mean youve been involved in some of my other threads I would have to learn i2c which is on my short list but more importantly id have to know more about ADCs in genral to utilze something like this. I mean right now im working on a 7 segment driver then to a spi ds1302 driver.. i think something lime this is outa my league. if someone writes a driver though i would definately use this thing.

    What would u guys suggest for a simulator i used a little spice app on my phone it seemed like itd be a whole lot more usefull on a big screen :) something free and realtively easy to learn, the thing on my phone was so ez u jusr drag and drop meters and scopes and what not it was basically a schematic editor with test tools u droped where u wanted then u hit run off it goes.
  • jmgjmg Posts: 15,173
    edited 2012-09-03 23:17
    @jmg Wow thats a nice find! That chip is pretty feature rich too besides the ADC. My only issue is that i am just begining to learn about all this stuff i couldnt write a driver for this yet.

    It is std i2c, so someone might roll a register example.
    They even have DIP16, for hobbyist users.
    What would u guys suggest for a simulator i used a little spice app on my phone it seemed like itd be a whole lot more usefull on a big screen :) something free and realtively easy to learn..

    try this :
    http://www.linear.com/designtools/software/#LTspice
  • kwinnkwinn Posts: 8,697
    edited 2012-09-03 23:42
    thanks guys .......@kwinn i just cant afford decent equitment at the moment i cant even afford parts. i mostly just get samples or build equitment. basically my arsenal is a propalyzer 112mhz la some dmms and a bus pirate i get by. are u telling me that the mcp3201 is a more accurate choice i can get a few of those. is there neway to tie these chips togather for more bandwith? id love to maybe build a 1mhz scope at some point

    I am not sure if you are mixing me up with someone else who responded to this question or referring to a response I made on another thread, but this is my first post on this thread. I have replied to so many of your questions (not a complaint) that I cannot recall all of them.

    I would not suggest using one or multiple mcp3201's in place of the mcp3208. Both have a 100K sample/sec. limit, but the mcp3208 is much more flexible and the pinout simplifies laying out a board.

    For a 1 MHz scope you would need an adc capable of at least 2Ms/sec, and for decent waveform reproduction at 1 MHz at least 5 times that. A propeller alone could not handle that high a speed of data acquisition. For audio frequencies, as a low speed logic analyzer, or low speed serial protocol analyzer the prop is a great choice
  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-09-04 06:13
    This 3201 or 3208? This one of those things that you need to figure out when you start to decide how your device will do something. The 3208 makes for a nice layout solution for multiple ADC channels, but you are trading sample rate per channel to get that. Only you can make the decision to trade one or the other. Basically cost vs. performance. That was why the play/learn suggestion. Anyone on this and other forums can toss out ideas, but we don't have the big picture. Only you generally will have the big picture and enough details for the design trade-offs. Just as in imaging, there is no free lunch. Every decision/adjustment brings a benefit at a cost elsewhere. Experience is NOT overrated......

    As to samples, no harm there. TI/National Semi are really great on sample parts (mostly smt these days though). And there is nothing wrong with the salvage route either. Used to scrounge parts in late 70s behind some of Silicon Valley's finest. SMT does make this route a bit harder as well...
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-04 10:08
    As far as salvaging goes its almost pointless these days! But i have found vcrs are an excellent source of passives and older audio equitment. I guess pre 486 pcs are also a decent source of parts many dip chips. For me salvaging isnt so much about savings. Its nice to have a pile of boards around when u need something in a pinch. it doesnt always work out but its nice when it does. nothing sucks more than needing some random sized cap for a project and waiting 3 days and paying 3 dollars for shipping on 2 dollars.
Sign In or Register to comment.