Any DAC examples for the propeller using SPIN?
automaton
Posts: 12
I just recently acquired a propeller chip for a project that I need to do complete (I chose it for the multiple cogs so I can do something else in the chip while I have a DAC running on another cog). Anywyas, I have to create a DAC and I am trying write in the SPIN language. I see lots of assembly examples for this, but seeing as how I am just learning the ins and outs of the chip...
I was wondering if there are any SPIN code examples for this or if someone can point me in the direction of an object to use?
Thanks.
I was wondering if there are any SPIN code examples for this or if someone can point me in the direction of an object to use?
Thanks.
Comments
I am aware of the the old 8-bit DAC parallel port hack... but that port is being used for something else and I need more functionality than a parallel port can provide. I need to accept analog input on several of the pins and do some low frequency digital out on several of the pins.
So I can't use too many of the pins. I was thinking of using the a single resitor, and a capacitor in the following fashion....
PIN 0 ---/\/\/\/\
>Analog output between 0 and 3.3 V
Where there is a capacitor branching to the ground between the resistor and the analog terminal (tried to show it but forum code here doesn't display spaces at the front of a line)
But I was seeing if there were SPIN code examples (not the assembly version) showing this...
Post Edited (automaton) : 11/12/2006 12:18:04 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
ADC_start initializes the ADC to output on pin and sets the inital value to 0V, ADC changes the output voltage to 3.3x(value/2^32).
·
10kOhms and .1uF are suitable values for the resistor and capacitor, though other values will work.·You must be careful about what kind of load you place on the circuit, if it's·low resistance or high capacitance, it will affect the voltage output.·For these types of loads you should run the voltage through an op-amp configured as a voltage follower as MK Borri has shown in the link he provided.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Post Edited (Paul Baker (Parallax)) : 11/12/2006 6:32:53 AM GMT
Thanks