ADC 0832 - dificulties with single ended chanel
Hello all
I'm trying to read both channels of an ADC0832 but since this has a MUX for selecting the channels I'm having serious problems on configuring this.
I think the problem starts when it needs an start bit to begin reading the channel selector and the polarity!
the sequence should set ch0 to + single ended ... but it doesn't
LOW CS
· SHIFTOUT DI,CLK,0,[noparse][[/noparse]%10]
· SHIFTIN DDO,CLK,0,[noparse][[/noparse]val]
·HIGH CS
It seems to be always connected to ch1· I'm not finding the reason.
Any help will be gratly apprecited
Amaral
I'm trying to read both channels of an ADC0832 but since this has a MUX for selecting the channels I'm having serious problems on configuring this.
I think the problem starts when it needs an start bit to begin reading the channel selector and the polarity!
the sequence should set ch0 to + single ended ... but it doesn't
LOW CS
· SHIFTOUT DI,CLK,0,[noparse][[/noparse]%10]
· SHIFTIN DDO,CLK,0,[noparse][[/noparse]val]
·HIGH CS
It seems to be always connected to ch1· I'm not finding the reason.
Any help will be gratly apprecited
Amaral
Comments
Does anyone worked with ADC0832 or up , and monitored two channels ?
Thanks for the attention!
RS_Voltage VAR Word
Instrument Var Byte
VoltSelect VAR Nib
PM_BT_CS··· PIN··· 2
PM_V_CS···· PIN··· 3
PM_Din····· PIN··· 4
PM_Dout···· PIN··· 5
PM_Clk····· PIN··· 6
SolarV1·· CON %1100 ' A/D MUX IDs for Ch 0..3
SolarV2·· CON %1110 ' Bit 3 = 1, start bit
SolarV3·· CON %1101 ' Bit 2 = 1, single (1)/diff (0)
BattBus·· CON %1111 ' Bit 1 odd / sign, Bit 0 select
Select Instrument
· CASE "S"
··· VoltSelect = SolarV1
··· GOSUB ReadVoltages
· CASE "U"
··· VoltSelect = SolarV2
··· GOSUB ReadVoltages
· CASE "N"
··· VoltSelect = SolarV3
··· GOSUB ReadVoltages
· CASE "B"
··· VoltSelect = BattBus
··· GOSUB ReadVoltages
EndSelect
ReadVoltages:
· HIGH PM_V_CS· 'Deactivate the ADC0834 Voltage Monitor
· LOW PM_Clk
· LOW PM_Din
· DataValue = 0
· 'A2D_Start_Conversion
· LOW PM_V_CS
· SHIFTOUT PM_Din,PM_Clk,MSBFIRST,[noparse][[/noparse]VoltSelect\4]
· PULSOUT PM_Clk,10·· '20 uSec for data conversion
· SHIFTIN PM_Dout,PM_Clk,MSBPRE,[noparse][[/noparse]DataValue.LOWBYTE]
· HIGH PM_V_CS
RETURN
Post Edited (MSDTech) : 6/26/2008 10:25:00 PM GMT
But I figured it out in the hard way !
now it's working , the whole problem is that the MUX add ignores leading zeros and the setting is not that simple .. but its working perfectly now
Thanks you all for the attention on reading this
Amaral