ADC Test
garylake
Posts: 41
I am not having much luck with ADC and The Prop.
I am trying to read voltage from a Piezo transducer so I can tell how hard it was tapped.
I am using jm_adc0834_ez.spin and jm_adc0832_ez_demo.spin code from the Object Exchange.
I wire up the circuit as per the circuit in the code.
I hooked up an oscilloscope to check the output from the ADC. I included a snapshot of the oscilloscope reading. Is this what I should see on the oscilloscope without any input to the ADC? When I tap the Piezo element I do get a blip on that channel.
I also included the schematic.
Gary
I am trying to read voltage from a Piezo transducer so I can tell how hard it was tapped.
I am using jm_adc0834_ez.spin and jm_adc0832_ez_demo.spin code from the Object Exchange.
I wire up the circuit as per the circuit in the code.
I hooked up an oscilloscope to check the output from the ADC. I included a snapshot of the oscilloscope reading. Is this what I should see on the oscilloscope without any input to the ADC? When I tap the Piezo element I do get a blip on that channel.
I also included the schematic.
Gary
pdf
20K
Comments
You may need to feed the transducer into an opamp and charge a cap with that (not sure the direct connection is enough), then read the voltage from the cap. You could use a FET to discharge the cap (needs another io pin) when you're done with the reading.
I have a Digital circuit and an analog circuit I was working on.
Will these circuits work as is or will I need to add some protection somewhere?
These are for a 16 channel electronic drum controller.
Gary
Just to let you know, I do not play the drums or any other instrument. But I do want make a Propeller base drum kit.
I see this done with the Arduino and MicoChip and wanted to give the Prop a try.
PASM? Any good books on that?
The attached code won't work as is (for you) but will give you something to start with. I use this in a camera pan/tilt controller than I designed/coded for a friend. You could write an object that reads all 16 channels in order.
http://forums.parallax.com/showthread.php?96594-Machine-Language-Tutorial!&p=668563&viewfull=1#post668563
DeSilva and I started this project. He did a great job with his general, intermediate to advanced tutorial, and my document introduces that, and other references around the forum. It's really basic, but I've gotten a lot of great "thanks" feedback, indicating that it can get somebody over the initial hump! Maybe it's enough right now to get you started!
That parent thread contains DeSilva's intermediate to advanced tutorial, and the parent topic thread contains some other references.
PASM is a beautiful, and in my mind, not difficult assembly language to learn. I strongly encourage you to give it a go. Propeller Assembly Language is a lot of fun, and it's powerful. One thing I really like is you don't need to really get all that deep before you can start making sense of some pretty powerful programs.
The attached code is off the top of my head (from code that works), so it's not tested. If I had the hardware I'd feel confident in trying it. As PotatoHead points out, PASM is not difficult. Now... in some regards this code is inelegant and heavy handed -- it's not really intended for general re-use, it's intended to be straightforward. That said, you can still change up your IO mapping very easily which you may need to do when you layout your PCB.
PotatoHead, thanks for the link to learning PASM.
As far programming goes I have programmed in Visual Basic, some C and some other languages, but never assembly. But I will learn it.
Gary