Mcp3204 adc
Greg LaPolla
Posts: 323
I am trying to convert the mcp3208 object from obex to work on the mcp3204. I don't have a real good understanding of assembly, and I think I am making more difficult because of it.
I have made some changes, but the problem seems to lie in this bit of code:
the
test t2,#4 wc
muxnc command,#$04
seems to be the culprit.
In the mcp3208 they are
test t2,#$80 wc
muxnc command,#$08
I looked at the mcp3202 driver and they are
test t2,#2 wc
muxnc command,#%0100
I am not sure how to proceed. I have already read potatoheads beginning assembly and the assembly book from deSIlva and I still can't figure it out.
Thanks in advance
Greg
I have made some changes, but the problem seems to lie in this bit of code:
cloop shr t2,#1 wc 'if channel disabled, skip if_nc jmp #skip test t2,#4 wc 'channel enabled, get single/diff mode muxnc command,#$04 mov stream,command or outa,smask 'CS high or dira,dmask 'make DIN/DOUT output mov bits,#20 'ready 18 bits (cs+1+diff+ch+1+0+data[noparse][[/noparse]12])
the
test t2,#4 wc
muxnc command,#$04
seems to be the culprit.
In the mcp3208 they are
test t2,#$80 wc
muxnc command,#$08
I looked at the mcp3202 driver and they are
test t2,#2 wc
muxnc command,#%0100
I am not sure how to proceed. I have already read potatoheads beginning assembly and the assembly book from deSIlva and I still can't figure it out.
Thanks in advance
Greg
Comments
you can give the ADC Input Driver object from the obex a quick try if it works for you
I haven't tested this object myself but the author describes that
"Known supported ADCs are:
MCP3208, MCP3204, MCP3202, MCP3201, MCP3008, MCP3004, MCP3002, and MCP3001"
So I assume the author has tested the devices mentioned above as working
best regards
Stefan
Post Edited (StefanL38) : 6/20/2010 10:13:03 AM GMT
I have an ADC driver in the OBX called MCP3208_fast.
I believe it should work with the 3204 without changes. It has the same calling sequence as Chip's routine, but it only accesses one port at a time, the one you ask for.
So if you use it with ports 1,2,3 or 4 it should work fine.
Let me know if you have any questions.
Jim