BS2P40 and MCP3204 ADC, issues?
Piper984
Posts: 74
Hello Forum,
Has anyone used a MicroChip MCP3204 (4) channel A/D with a BS2? Is it possible to use the same syntax as the LTC1298 AppKit example code? I did a search of the forum, and found this question a few times, but no replies of getting it to work.
The whitepaper on the MCP3204 is at:
http://rocky.digikey.com/WebLib/Microchip/Web Data/MCP3204, 3208.pdf
I have not received the MCP3204's yet... I bought them figuring that I would be able to sort out the interfacing... But a note in the whitepaper regarding the need of some MCU's to require extra clock cycles has me wondering if it's as simple as using the code for the LTC1298 (only extended for 2 more channels) or not. I figured that someone on this forum might have used this A/D before and would post his/her experiences?
Regards,
Chris
Has anyone used a MicroChip MCP3204 (4) channel A/D with a BS2? Is it possible to use the same syntax as the LTC1298 AppKit example code? I did a search of the forum, and found this question a few times, but no replies of getting it to work.
The whitepaper on the MCP3204 is at:
http://rocky.digikey.com/WebLib/Microchip/Web Data/MCP3204, 3208.pdf
I have not received the MCP3204's yet... I bought them figuring that I would be able to sort out the interfacing... But a note in the whitepaper regarding the need of some MCU's to require extra clock cycles has me wondering if it's as simple as using the code for the LTC1298 (only extended for 2 more channels) or not. I figured that someone on this forum might have used this A/D before and would post his/her experiences?
Regards,
Chris
Comments
I'll post any learning I have for future surfers.
Regards,
Chris
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
As always, you have really helped point me in the right direction. Thanks!
I used the code you provided as a starting point, and since my A/D is 12 bit, I changed the ADC array to a Word, and then modified the SHIFTIN line to read 12 and not 8 (ie SHIFTIN Dio, Clk, MSBPOST, [noparse][[/noparse]adc(chan)\12]).· And I get data back from the chip!· Which·I hadn't before.· However, I am only sending signal to channel 1 but I am getting data back from the MCP3204 on channels 1 and 2, and some 'noise' on channels 3 and 4... and I suspect that I need to modify 'mux' value to something like:
LOOKUP chan, [noparse][[/noparse]%1100, %1110, %1101, %1111], mux·
Although I admit I am not 100% understanding what my chip needs here.· I will continue to review the paper and try to figure it out, but Jon: Could you reply with a brief description of what this value does?· I assume it's for setting the channel that I want returned.· The only SPI chip I've used is the LTC1298, so I have no background using these yet.
Thanks again!
Chris
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax