Sample code for MCP3204 ADC?
Can someone post some sample code to read the MCP3204 using the MCP3208 driver by Chip in the installed propeller tool?
I think we are using it right, but getting 0 out.
Thanks!
Martin
I think we are using it right, but getting 0 out.
Thanks!
Martin

Comments
·http://obex.parallax.com/
Jim
OK..maybe one:
http://obex.parallax.com/objects/488/
Post Edited (hover1) : 4/23/2010 1:44:19 PM GMT
TASK ReadADC ' Reads CH0 of ADC. Puts value in HUB long "EFCVal". Value VAR LONG HIGH ADC_Cs LOW ADC_Clk PAUSE 5 DO LOW ADC_Cs ' Enable MCP3204 PAUSEUS 100 SHIFTOUT ADC_Din, ADC_Clk, MSBFIRST, %11000\5 ' Select CH0, Single-Ended SHIFTIN ADC_Dout, ADC_Clk, MSBPOST, Value\13 ' Read ADC HIGH ADC_Cs ' Disable ADC LOW ADC_Clk WRLONG EFCVal, value PAUSE 1 LOOP ENDTASKBean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There are two rules in life:
· 1) Never divulge all information
-Martin