Let's Make Robots!

Shaving off a couple volts...

I am in the process of wiring Walter. I have my RC receiver outputs going into a 28x but I have run out of input pins! I need to use 2 of the ADC inputs instead but the ADC's won't accept a pulsin command. Problem solved, I am using a spare 14m to do a little translating for me. The 14m will accept the last two pulsin commands and send them off to the ADC's on the 28x. Here's the deal, the two remaining channels (from the RC unit) are "bang-bang" channels --they are still servo commands but not variable, they are only centered (150), full left (225) or full right (75).

Question: I need the output of the 14m to spit out a total of 6 voltages, 3 each going into 2 of the ADC's of the 28x. This way, the adc can simply read hi, med, low. Any thoughts on how to get the 14m to spit out 3 different voltages?I am soldering my own board for this one so I have tons of room for extra componants.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Its maker is warped enough!

This is similar to Robologist design except that the outputs stay as outputs. When both outputs are high, the analog output is 5V. When both are low, the output is 0V. When one output is high and one is low then the output should be roughly 2.5V

DAC_Schematic.jpg

Cool, I shoulda thought this further, good simple design.
All I really need is the 14m to spit out 3 different voltage values for an ADC channel (on another chip) to read. I guess, really just 2 as low could be considered the third. I do have 5 outputs available so could it be a simple as some sorta resistor bridge on each pin? --First output high = x voltage (read by the ADC) while first and second output high = x votage + y voltage into the ADC. I think I might be trying to make a digital pot but with only 2 or 3 positions.

1k resistor from one IO on 14m to another IO on 14m. Another 1k resistor from that second IO to ground. Output from the connection to the second IO to ADC on 28x. If top IO pin is on, and second IO is set as an input (hi-Z) output appears as a resistor divider 2.5 volts. If second IO is high (top IO doesn't matter) output is high. If neither IO is high, output is zero.

Try it unconnected with a meter first, then if it checks out, try the ADC connection.

Do you have a diagram? Even a block diagram?  Way out of my league here, and not exactly sure of what you are asking for, but I'm guessing you want a code snippet of how to block the ADC input into 3 levels and digitally send those out?

What are the range of values you can get from the ADC? - glanced at the a spec and it said 10 bit resolution.  So, you want code that  will translated into 2 bit resolution?

e.g.

00 = off

01 = low

10 = med

11 = high

I guess I'd divide by ~340....

Or am I completely off what you want to do?  

OK, saw robologist's entry...

You could also make a DAC by putting a resistor bridge together off of some digital outputs.  I made one to mimick a POT in a PWM circuit here.

See wikipedia DAC. You could fake a couple DACs with PWM outputs from 14m, going into a resistor-capcitor filter of sorts, PWM duty charges the cap to differing levels that the resistor bleeds off to change the levels.

Or seems like some sort of transistor grouping could get 3 voltage levels switched to add into the 28x ADC, but would need an out per transistor from the 14m

Or you could get a chip DAC like this and just use a few of the inputs to have differnt levels sent out toi the 28x ADC.

I was thinking something similar. But given the fact that the 14M is already fed with pwm signals, why not bypass the MCU altogether?

Rik

That could work, getting the timing of the read just right.