How to Setup Two (2) MCP3208 Analog to Digital Converters connected to One (1) Propeller
jmmb392
Posts: 22
in Propeller 1
Dear forum,
I want to create a sensor device that has 16 A2D inputs. I am using 2 MCP3208 converters each with 8 inputs. I know how to setup 1 MCP3208 using the regular MCP3208.spin object, by connecting the Din and Dout pins of the MCP to the same pin in the propeller, CLK of the MCP to another pin in the propeller, and CS/SHDN to another pin in the propeller. Should I use another 3 propeller inputs for the second MCP, and call a second object MCP3208-2.spin (copy of MCP3208.spin), or since it is SPI, there is another way.
Please help me.
Thank you!!
I want to create a sensor device that has 16 A2D inputs. I am using 2 MCP3208 converters each with 8 inputs. I know how to setup 1 MCP3208 using the regular MCP3208.spin object, by connecting the Din and Dout pins of the MCP to the same pin in the propeller, CLK of the MCP to another pin in the propeller, and CS/SHDN to another pin in the propeller. Should I use another 3 propeller inputs for the second MCP, and call a second object MCP3208-2.spin (copy of MCP3208.spin), or since it is SPI, there is another way.
Please help me.
Thank you!!
Comments
For two ADCs you'll need five pins using a standard SPI bus setup.
I made made a version of my simple MCP3208 object that will let you have multiple MCP3208s on a shared bus.
The Assembly program makes use of a Sync pin used with the resolver to sample the ADC at 90 deg and 270 deg so you might need to modify or remark those lines of code in the PASM.
It's been over 3 years since I really programmed the Propeller and I sold off all of my Parallax/Propeller gear.
You-Tube video of Resolver program in action:
It was really helpful and saved me some pins!