Using DACs/ADCs with Pi4J

50 views
Skip to first unread message

NM

unread,
Sep 20, 2016, 2:56:08 AM9/20/16
to Pi4J
Hey Guys,
I have a little question if the following is possible:

I want to communicate with a ADC (http://ww1.microchip.com/downloads/en/DeviceDoc/21034D.pdf) and a DAC (http://ww1.microchip.com/downloads/en/DeviceDoc/21953a.pdf) using SPI. But I just noticed that there are some code samples in the Github directory for MCP chips which seem to be pretty easy to implement.
Would for example a "MCP3204GpioProvider" class work with the MCP3202 or do I have to code it from scratch using SPI?

Greetings

Robert Savage

unread,
Sep 20, 2016, 1:26:30 PM9/20/16
to Pi4J

I would certainly start off with attempting to use the MCP3204GpioProvider as-is just to see if it would work.  
If not, I'm sure you can adapt the MCP3204GpioProvider implementation and create a version of the class for the MCP3202.
Its probably easier to do this than coding the SPI from scratch.  Plus if you do end up implementing a MCP3202GpioProvider and pin class, you can contribute them back to the project :-)

Thanks, Robert

NM

unread,
Sep 21, 2016, 5:05:08 AM9/21/16
to Pi4J

Thank you for this hint, I just edited the MCP3202 classes and I will report to you if it works or not and then of course also contribute to this awesome project :)
Regarding the DAC's, I noticed that there is only one example in Github which uses I2C instead of SPI which is used by the MCP4822. Do you have any ideas on how I could adapt these classes for a use with SPI instead of I2C? Unfortunately, I'm not a professional when it comes to coding, I'm pretty new to programming and still learning :P

Thanks in advance for your support :)
Reply all
Reply to author
Forward
0 new messages