Propeller activity board embedded adc
Jkane
Posts: 113
Hello,
I am trying to use the lm34 and the embedded adc of the propeller activity board, but I was wondering if there is a adc obex for the board, I see that the adc is attached to pins 18-21 (A0-A3), and also noticed that there was an issue about the embedded adc having some issues (Jessica wrote a voltage and noise test), I thought I could use the propBOE adc, but I think is mapped to different pins, anyway, before I start chasing other possible issues, I would like to start with the correct embedded obex adc for the activity board,
I would like to use the embedded rather than an ic, (at least for now)
thanks in advance.
Jeff
I am trying to use the lm34 and the embedded adc of the propeller activity board, but I was wondering if there is a adc obex for the board, I see that the adc is attached to pins 18-21 (A0-A3), and also noticed that there was an issue about the embedded adc having some issues (Jessica wrote a voltage and noise test), I thought I could use the propBOE adc, but I think is mapped to different pins, anyway, before I start chasing other possible issues, I would like to start with the correct embedded obex adc for the activity board,
I would like to use the embedded rather than an ic, (at least for now)
thanks in advance.
Jeff
Comments
I don't think you've got your terminology straight. It's kind of hard to understand what you're asking. The OBEX is the acronym for the Object Exchange. I assume you want to use the ADC IC on the Activity board. IIRC, the ADC chip is a MCP3204 and yes there are objects for this chip in the object exchange. (Edit: I didn't remember correctly.)
Do you want to use C or Spin?
In case it's not clear, the I/O pins P18 - P21 are used to interface with the ADC chip. The connections A0-A3 connect to the ADC chip's input channels. A0-A3 do not directly connect with the Propeller chip.
The Activity Board's ADC uses the SPI protocol however the PropBOE's chip uses the I2C protocol, so besides using different I/O pins, the protocols used by the chips are different.
You've lost me here. I don't know what an "embedded obex adc" is. Do you want to make sure you're using the right object for the ADC chip used on the AB? Or are you looking for a library to use the ADC chip with C?
Again, I don't know what "embedded" means as you're using it here. The AB has an IC which is used for analog to digital conversions. I've guessing you'd like to use the IC included on the AB instead of adding an additional IC. I don't see why there would be a problem using the AB's MCP3204 chip but then I don't understand how you plan to use it with the LM34.
Edit: I just looked up what the LM34 is. I see it outputs a voltage based on the temperature. I think the AB's ADC should be able to work just fine. I don't recall if the MCP3204 is powered by 5V or 3.3V. If the ADC is powered by 3.3V, I think you'll want to use a voltage divider between the LM34 and the ADC's inputs. I'll check on this and edit this post again.
Edit again: I was wrong about the ADC chip. Apparently it's not a MCP3204 so I'm not so sure there's a object for it in the OBEX. It does look like the chip uses 5V so you won't need a voltage divider with your LM34. If you're using C, you can just use the library for the ADC chip but if you're using Spin, you'll need to find or write an object to interface with the chip (ACD124S021).
I apologize for the confusion, but you gave me the answer " If you're using C, you can just use the library for the ADC chip but if you're using Spin, you'll need to find or write an object to interface with the chip (ACD124S021)."
when I was referring to "embedded" I was referring to the adc chip on the propeller activity board, (ACD124S021), and my overall question was if there was spin/asm code to interface to the onboard ACD124S021 chip.
so C or Spin, I guess C, I haven't used C on propeller yet, but was going to do it eventually, but on an side note, C is a very close representative of assembler, as far as performance is the C version for the Propeller equal to asm.
option B would be to use MCP3204 ,MCP3208 or ADC8031
regards
Jeff
I think the "ADC124S021" ID I found on the schematic is some sort of internal part number. A search for this ID didn't turn up anything useful.
I take it you want to read the voltage from the LM34 sensor. How often?
I'll see if I can find some example code to use with the AB's ADC in Spin. I plan to post something within an hour.
From the Bill of Materials:
ADC124S021CIMM/NOPBCT-ND (Digikey Part Number)
Data Sheet:
http://www.ti.com/lit/ds/symlink/adc124s021.pdf
It looks to be an SPI device.
The first couple of ADC objects I examined won't work with the AB as they are currently written. I'll either need to modify one of find a different version. I'm still working on this, it's just taking a little longer than I expected.
http://learn.parallax.com/propeller-c-simple-circuits/measure-volts
Thanks but I was trying to find a Spin example.
JonnyMac's object in the OBEX share the data in and data out lines.
It was pretty easy to modify it to separate the lines.
I've attached the modified code.
Here's the example output from running the code on the AB:
There is something strange going on though. The channel numbers don't match the number on the AB. Channel zero is displaying the value read from input #4. All the channels appear to be shifted one position.
I don't understand why this is the case. This certainly would be an easy thing to compensate for but it's kind of puzzling.
I missed this post. Thanks. This is probably why the output is different than expected.
Yes, and I just updated my object for project that involves the PAB.
-- http://obex.parallax.com/object/694
Jon,
Thanks, I currently went the route of the MCP3208, which is working but overkill, I will convert it back today and retest it.
but on a side note: regarding the MCP3208 connected to a LM34 temp sensor. I used the OBEX for the MCP3208, which works but had to place a 100K OHM resister between the output of the LM34 and the ADC channel one, then I recalibrated back, Using spin code to the correct temp, but I believe this is not correct. (or not the right way to do it)
This is the connections for the MCP3208
Input from sensor Ch(0) | | Vdd - 3.3 volts
| V ref - 3.3 volts
| Agnd - Ground
| Clk - to propeller Pin 5
| D out - to propleller Pin 6
| D in (tied to D out
| CS to propeller Pin 7
LM34 TO-92 package (looking from the bottom up, flat side on the top)
Pin 1 - 5.0 volt
Pin 2 - signal to propeller => thru 100K ohm resister => Ch(0) of the ADC chip
Pin 3 - ground
Here is the spin code
anyway, I think I'm going to go back to the onboard ADC chip of the activity board to recheck.
regards
Jeff
If you use a 3.3v reference (e.g., with the MCP3208) you could change millivolts resolution with:
Erlend