Shop OBEX P1 Docs P2 Docs Learn Events
ADC0831 and Prop — Parallax Forums

ADC0831 and Prop

CenlasoftCenlasoft Posts: 265
edited 2009-07-30 19:36 in Propeller 1
Hello,
I have finally finished my Eddy Current Analyzer. The LC circuit senses a metal and then I rectify the voltage to DC and then using a high impedance voltage divider, the voltage goes into a buffer (741 op amp) to stop loading of the resonance circuit. The ADC0831 takes this voltage and creates a digital value. I want to thank Beau Schwabe and all of you for all your help. I am working now o the software (spin). I am using the Squarewave object (PE Kit) to excite the LC circuit. This works fine alone. I am using the ADC0831_demo object (OBEX) to read the output. This object sends the data to hyperterminal. This works alone. I am new to spin and I have been using existing code to try to combine the two objects and:
1. Send out a continous squarewave using the squarewave object.
2. Read the ADC0831 and send the data to a terminal program.
3. My ultimate goal is to use Viewport (already bought it) to graph the data.

Do I have to use separate cogs for each (steps 1 and 2)? The squarewave object seems to be a one shot process and I have to use repeat to continue the square wave output. This repeat doesn't let the ADC object to get started. Any suggestion are appreciated. I will post the entire project once I get the sotware done. I have scanned some metal archaelogical specimens and have gotten great images manually.

Cenlasoft (Curtis)


·

Comments

  • HannoHanno Posts: 1,130
    edited 2009-07-27 20:25
    Hi Curtis,
    I'm glad using the opamp solved your problem. I would love to see samples of your scanned images- sounds like an interesting application for the Propeller!

    The "ADC0831" object uses a repeat loop to acquire data which it then displays using the fullduplexserial object.

    ViewPort let's you "share" variables with the pc- at a much higher rate than "displaying" them over serial and also in both directions.

    To start sharing a single variable, just call:
    vp.share(@data,@data)
    If you wanted to share multiple variables that you've declared like this:
    long a,b,c,d
    you would use:
    vp.share(@a,@d)
    The funny "@" characters tell spin that you want to share the memory for variables "a" through "d" with ViewPort.
    Once you've shared data, you can use the graphical instruments and wizards within ViewPort to graph your data- for example, you would use the "dso" view which simulates an "oscilloscope". It will graph your variable's value over time with autoscaling, various timescales, cursors...

    To get back to your problem:
    - I would start with the "ADC0831_DEMO" file.
    - Replace the SER : "FullDuplexSerial"" with vp:"conduit", this tells the Propeller that you'll be using the conduit object.
    - Instead of "ser.start", call "vp.share(@data,@data)", this will share the data variable with ViewPort
    - Remove the "DisplayValue" call and method- you don't need them with ViewPort!

    Doing this will let you see the ADC's value inside of ViewPort.
    Now, you'll need to generate your square waves.
    I would do this in a separate cog. After the "initialize" call in your file, you should use the "cognew" instruction to start your square wave code. Good luck!
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Download a free trial of ViewPort- the premier visual debugger for the Propeller
    Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!
  • CenlasoftCenlasoft Posts: 265
    edited 2009-07-27 21:09
    Thanks Hanno,

    It worked beautifully. I didn't try sending the squarewave yet with another cog, but I used a light sensor and the adc with viewport and it was great. Awsome product.

    Curtis
  • HannoHanno Posts: 1,130
    edited 2009-07-28 19:46
    Hi Curtis,
    Great! With ViewPort you can remove the waitcnt instruction in the sampling loop- so instead of sampling once per second, you'll sample many thousands of times. Since ViewPort efficiently shares the "data" variable with the PC, you'll get very high resolution measurements- up to 200,000 samples/second when sharing a single 32bit value. Perfect for imaging things... Please share some images when you have them!
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Download a free trial of ViewPort- the premier visual debugger for the Propeller
    Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!
  • CenlasoftCenlasoft Posts: 265
    edited 2009-07-29 02:27
    Thanks Hanno,

    It worked great. This leads me to another couple of questions. I read the ViewPort manual and saw that I can output to a file (csv, etc.) I could not find any thing about how to do this. Right now, I am creating my images from data (voltages) using VB 6.0. Its hard and not in real time. How can ViewPort help me? I be glad to post my project. Anything I can do for such a great product. Because of my preliminary success and the Prop and ViewPort, I have just recieved a $20,000 grant for using these products for Archaeology. I have ordered some Prop products and will be looking at my budget for more projects.

    Thanks again,

    Cenlasoft (Curtis)
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2009-07-29 02:39
    @ Cenlasoft

    Very interesting project you are working on. cool.gif

    Try this post from Hanno :

    Connect Excel to the Propeller

    http://forums.parallax.com/showthread.php?p=825987

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Aka: CosmicBob
  • CenlasoftCenlasoft Posts: 265
    edited 2009-07-29 13:01
    Thanks Bob,

    Great link. I will post the entire project soon.

    Cenlasoft (Curtis)
  • HannoHanno Posts: 1,130
    edited 2009-07-30 19:36
    Hi Curtis!
    Congratulations on getting your grant- that's wonderful! Thanks for the praise for ViewPort- it's been a work of love. To export data from ViewPort, just use the "File/Export" menu. This let's you save data in text, csv, jpg, png, and matlab file formats. ViewPort also includes a "stream" mode where it continuously saves your data to a file and streams it to another application or an ftp server- you can use this mode to do real-time work- it's available from the "File/Stream" menu. The DDE server/client that Bob referred to is almost ready for beta- it'll make it trivial to share Propeller variables with most Windows applications in both directions in real time. For example, to continuously get an update of the "temperature" variable in a spin program running on the Propeller, you just have to enter this formula into your Excel spreadsheet: "=vp|get|temperature". Lots of cool stuff coming to ViewPort soon!
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Download a free trial of ViewPort- the premier visual debugger for the Propeller
    Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!
Sign In or Register to comment.