Soliciting sample and hold ideas

gengis

New Member
Anyone ever done anything like that with a picaxe? Sample a voltage then output the same voltage?

Looking for different ways to do it. External analog parts are OK. The idea is to find a few ways . . .

12 bit accuracy, speed is unimportant, simplicity counts for something.
 

womai

Senior Member
What's the sample rate requirement? If it's low (maybe 1000 samples/sec or less), just hook up a 12 bit ADC and a 12 bit DAC to the Picaxe. Read the voltage with the ADC, and send the same code to the DAC. Microchip has some suitable chips for that (connect through SPI).
 

BeanieBots

Moderator
A few more clues as to the application would prompt a few more responses.
Sample time frame?
Sample dV/dT?

The type of A2D used will also affect and determine if S/H is even required.
Dual/single ramp, successive approx?

Many often have the feature built in. eg PICmicro! (& hence, PICAXE)
What's the trigger to take a sample?
 

leftyretro

New Member
A simple way I experimented with was to use the 10 bit A/D input and then output to the PWM function. I had a simple R/C low pass on the output pin of the PWM function. The PWM has to be scaled right and the analog output voltage to be useful would most likely have to have a op amp buffer for driving real world loads.

Here is a fragment of the loop back routine I experimented with. Worked very well tracking the A/D input well measuring the filtered PWM output with a DVM.

looper:
' loop back 10 bit analog input to PWM output

Readadc10 0,W4
button 0,0,0,0,b2,0,cont

pwmout 2,249,w4 ' update pwm2 if switch = 0
serout 1,T2400,("?g") 'test out new beeper on display
pause 100
goto looper

cont: pwmout 1,249,w4 ' update pwm1 if switch = 1

goto looper


Lefty

 

gengis

New Member
What's the sample rate requirement? If it's low (maybe 1000 samples/sec or less), just hook up a 12 bit ADC and a 12 bit DAC to the Picaxe. Read the voltage with the ADC, and send the same code to the DAC. Microchip has some suitable chips for that (connect through SPI).
The sample rate is not critical. One typical digital sample and hold circuit uses A/D-D/A with no other parts except for maybe an inverter. That's two relatively expensive and/or hard to find parts. The other common way is to send a free running clock into a counter ramping a D/A up/down until it satisfies an analog comparitor then stopping the clock.

I was thinking more in terms of ramping a pwm to integrator for analog out, up to a value that matched the input then holding that pwm setting. Or count output or serial out to a digital pot. Something that more or less is done with a picaxe
 

gengis

New Member
BeanieBots: There's some industrial servo displays - basically a pot with gear motor attached the motor turns a very large pointer (based on a 0-1V signal into an analog amp) that can be seen across 200 feet or more. We are looking for a way to return the displays to the starting points (or other significant step in the process) for each or all displays (while the actual monitored signals are still doing their thing - a visual aid so the op doesn't have to copy down numbers and try to keep a picture in his head of were everything was when the reaction began - or walk back to the control room to see the graphs)

So the sample acquire time isn't critical at all - lots of time to capture the reading, and it wouldn't change often.

retrolefty: What is button 0,0,0,0,b2,0,cont for?
 

gengis

New Member
BeanieBots: There's some industrial servo displays - basically a pot with gear motor attached the motor turns a very large pointer (based on a 0-1V signal into an analog amp) that can be seen across 200 feet or more. We are looking for a way to return the displays to the starting points (or other significant step in the process) for each or all displays (while the actual monitored signals are still doing their thing - a visual aid so the op doesn't have to copy down numbers and try to keep a picture in his head of were everything was when the reaction began - or walk back to the control room to see the graphs)

So the sample acquire time isn't critical at all - lots of time to capture the reading, and it wouldn't change often.

retrolefty: Thanks

What is button 0,0,0,0,b2,0,cont for?
 

leftyretro

New Member
BeanieBots: There's some industrial servo displays - basically a pot with gear motor attached the motor turns a very large pointer (based on a 0-1V signal into an analog amp) that can be seen across 200 feet or more. We are looking for a way to return the displays to the starting points (or other significant step in the process) for each or all displays (while the actual monitored signals are still doing their thing - a visual aid so the op doesn't have to copy down numbers and try to keep a picture in his head of were everything was when the reaction began - or walk back to the control room to see the graphs)

So the sample acquire time isn't critical at all - lots of time to capture the reading, and it wouldn't change often.

retrolefty: What is button 0,0,0,0,b2,0,cont for?
I forget :p Looks like I wanted to output to one of two different PWM pins depending on state of a digital input. These are just left over testing routines just to learn about A/D and PWM resolution and accuracy when I first obtained my PicAxe 28X. I was and still very impressed with the capabilities and ease of use of the Picaxe system.
The real power of the Pixace (and underlining Pic) is it's real world analog and digital interfaces rather then it's basic computer capabilities, in my opinion. I think of the Picaxe as a building block component that can replace lots of discrete components that would otherwise be required to interface with sensors and other digital components.
 
Top