Hi there
On 13/02/17 18:10, William Hermans wrote:
> Probably not. With the onchip ADC, all the software( drivers etc ) are
> already written for you. Using an external SPI ADC you have to deal with
> additional costs, additional circuitry, and additional software, which is
> on you to create.
There is already a SPI interface. Simply hook it up.
Level translating the analog signal is much more complicated. You would
have to buffer the 0 to 5 volt signal. Then feed it to a resistor
divider with a pot to calibrate. And then buffer it again (use fixed font);
Opamp
+ |\
In >-------| \
0 | >---*------+
to +---| / | |
5V | - |/ | +++
| | | |
+----------+ | |
| |
+++
| Opamp
+++
| | + |\
| |<-------| \
| | | >---*----> Out
+++ +---| / | 0
| | - |/ | to
+++ | | 1.8V
| | +----------+
| |
| |
+++
|
|
/ \
GND
The positive supply voltage of the opamps would have to more then five
volt. The negative less then zero. So you need to clamp the output
voltage of the second opamp. Without limiting the full 0 to 1.8 volt
range. -0.1 to 1.9 volt is probably safe, but you need to check the
specs to be shure. Something with two (NPN and PNP) emitter followers
would probably work. Just tie the emiters to the output of the second
opamp. Assuming the the opamp is short cirquit proof of course. And you
may need to calibrate.
And why is getting data from the SPI interface more difficult then
getting it from the buildin ADC? You have to write the software to
process the data anyway.
> Not only that, you will probably still have to level
> convert, in order to make sure the input on the ADC does not swing too
> high. You also need to isolate the pin.
Not at all. Simply power whatever inputs the 0 to 5V to the ADC from the
same sypply.
Of cource, if this not possible, you will have to clamp the voltage.
And if you really need to isolate, this is easier with a digital the an
analogue signal.
> I'd say an I2C ADC would be a better choice, and it would be except. You
> would have to deal with everything i mentioned about an SPI ADC. Except
> writing the "driver" software would be much easier to deal with.
Why is I2C a better choice then SPI?
The BBB has both.
Regards,
Rob