Shop OBEX P1 Docs P2 Docs Learn Events
BS2P40 and MCP3204 ADC, issues? — Parallax Forums

BS2P40 and MCP3204 ADC, issues?

Piper984Piper984 Posts: 74
edited 2005-08-29 12:47 in BASIC Stamp
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

Comments

  • Piper984Piper984 Posts: 74
    edited 2005-08-27 01:48
    Just a quick follow up, my A/D chips arrived tonight and the AppKit syntax does not work.· I am now comparing the LTC198 white paper w/ the MCP3204...· But since the LTC1298 is the one and only A/D chip I've ever used, I am still hoping someone has already used a MCP3204 and can shed some light on this for me.

    I'll post any learning I have for future surfers.

    Regards,

    Chris
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-08-28 11:44
    I just had a very quick look, and it seems to behave very much like an ADC0832 or ADC00834 -- there's no reason you can't work with this device.· I'm attaching an ADC0834 program for you to look at -- I think with just a little work you can convert it to the MCP3204.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Piper984Piper984 Posts: 74
    edited 2005-08-28 14:01
    Hi Jon,

    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 WilliamsJon Williams Posts: 6,491
    edited 2005-08-29 12:47
    Yes, it's for selecting the channel and mode -- compare the code to the ADC0834 docs and it will all make sense; that said the MCP3204 timing charts reminded me so much of the ADC0834 docs that I thought the MCP might actually be intended as a replacement.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.