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.

Get or make a DAC

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.

Do you have a diagram? Even

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.

RC filtering PWM

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

I guess what I need…
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.

Might be simplest of all
That could work, getting the timing of the read just right.

2 pins 1 output

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.

Get (up to) THREE states from a tri-state MCU pin NOW!

As mentioned in Zanthess’ blog on led arrays, a picaxe multipurpose pin can be programmed to assume any one three distinct states. I never did this before, but I came up with a one pin design for Chris’ communication challenge.

The left pin is the Picaxe talking to the input pin on the Picaxe on the right. All we want the talking axe to do is:

  1. pretend to be an input
  2. go high
  3. go low

Here are the three equivalent circuits:

I chose pulling resistors of 22 kOhm. At 5 V supply, a sinking/sourcing MCU will draw/push 0.23 mA. The voltage divider will use up half as much. I do not know the rated "impedance" of a picaxe input pin, but I imagine it is much higher than 22 kOhm. High enough not to influence the balance in the divider.

I'd like my "esteamed peers" to review this idea and, if possible, verify this pin reduction BY FIFTY PERCENT!!!

8ik

I love smart people!
The geeks should be running this planet, you know?

**(52 days and counting) **

But that would be a whole different thread

 

Hmmmm…

Didn’t somebody say the geek shall inherit the earth?

I shoulda…
…the geeks shall inherit the earth… Shoulda seen that one coming…

It worked! It worked!

It’s the 4 channel 4k7 resistor bridge!! Stay with me here:

 

The 28x accepts (4) of the pulsin signals from my RC unit and sticks them into 4 variables.

The 14m accepts (2) 3-posistion pulsin signals from my RC unit

The 14m, through it’s 4-output resistor bridge, sends one of 3 signals to (2) ADC channels on the 28x

The 28x ADC channels read: 0,146 and 255! --Perfect!

And to add to this, I am even sending these 6 variables onto my 40x using the serout/ serin commands! And it works!

 

Thanks everybody!! --Especially Oddbot --you’re schematic was the prettiest. Gold star for you!

Pretty slick
Looks like a good mod, should do just fine, but always check with a meter first.