MCP3202-B 2-channel 12-bit A/D object posted
Ken Gracey
Posts: 7,401
Hey there,
Posted tonight at http://obex.parallax.com/objects/515/ is the above object. Based on Chip's code for the 3208 and adapted specifically for the 3202 (thanks Chip!). Needed this for a simple application with my robot and couldn't find a MCP3202 object.
Analog inputs are from the #27800 Parallax Joystick. Data is displayed with Parallax Serial Terminal. Enjoyed using Andy's FullDuplexSerialPlus with the shortened serial command structure, too. Pretty handy to have the details tucked away. Will port it to TV next with a bit of luck and experimentation.
Just getting back into the swing of things so expect to see more of my silly questions posted right here on the Propeller forum.
Any and all input is both welcome and appreciated -- critical, constructive, or just plain funny!
Thanks,
Ken Gracey
Parallax Inc.
Post Edited (Ken Gracey (Parallax)) : 9/20/2009 4:25:52 AM GMT
Posted tonight at http://obex.parallax.com/objects/515/ is the above object. Based on Chip's code for the 3208 and adapted specifically for the 3202 (thanks Chip!). Needed this for a simple application with my robot and couldn't find a MCP3202 object.
Analog inputs are from the #27800 Parallax Joystick. Data is displayed with Parallax Serial Terminal. Enjoyed using Andy's FullDuplexSerialPlus with the shortened serial command structure, too. Pretty handy to have the details tucked away. Will port it to TV next with a bit of luck and experimentation.
Just getting back into the swing of things so expect to see more of my silly questions posted right here on the Propeller forum.
Any and all input is both welcome and appreciated -- critical, constructive, or just plain funny!
Thanks,
Ken Gracey
Parallax Inc.
Post Edited (Ken Gracey (Parallax)) : 9/20/2009 4:25:52 AM GMT
Comments
FullDuplexSerialPlus and not FullDuplexSerial I don't remember seeing the FullDuplexSerialPlus around before. Looks like Andy added some nice features.
if the last line here is changed from #2 to #4 will that then give me 4 channels or is there more to it ?
Greg
I have attached my modifed MCP3202 driver. You and Chip can review and update the object as you think best.
John Abshier
Thanks! We'll take a look today and update as appropriate. I'll also try switching I/Os to duplicate the results you are seeing. Then we'll replace the OBEX post with your code if it addresses the errors.
Sincerely,
Ken Gracey
I am pretty sure (can someone confirm) the 4 channel ADCs work on the same data scheme as the 8 channel ones. So it should work with the MCP3208 drivers on the Obex (like the one in my signature).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X08/4 ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't make strings the bane of the Propeller, bend them to your will!
That's correct. The communication protocol is identical for both, but the D2 bit in the control byte is "don't care" for MCP3204. D2 controls upper/lower quad in channel selection.