EmbeddedRelated.com
Forums
Memfault Beyond the Launch

RCM3700 to MCP3204

Started by OmarP July 10, 2010
Hello,
I need get analog measure with my RCM3700, and see that I can use mcp3204 (analog to digital converter).
I have clear the hardware connection: I need set a serial port to spi mode, TXC,RXC and Clock C for example to SPI_SER_C

But I cannot found a sample code for use it.

Can you orient to me for do this ?

Thank you in advance

On the design I did with an MCP3208, I simply wrote my own code. The A/D does not mind bit-banging (ie, it does not care that the bits come in at a constant bits/second rate). I did not bother with a serial port, I just grabbed 3 i/o bits and set the input/output directions appropriately. The code was rather simple, as the IC is rather simple--send the command, read the result.

The code itself can be as complicated as you want. You could write a function per channel, in which case the code could be just a string of set data bit, set clock bit, clear clock bit, repeat for all the bits of the command. IIRC, the MCP requires one or two extra clocks, then data comes out. So, set clock, clear clock, read data out, and push that into the return result. Pulse clock, left shift result, add in new bit of data.

Shawn Upton, KB1CKT

--- On Sat, 7/10/10, OmarP wrote:
From: OmarP
Subject: [rabbit-semi] RCM3700 to MCP3204
To: r...
Date: Saturday, July 10, 2010, 12:59 PM


Hello,
I need get analog measure with my RCM3700, and see that I can use mcp3204 (analog to digital converter).
I have clear the hardware connection: I need set a serial port to spi mode, TXC,RXC and Clock C for example to SPI_SER_C

But I cannot found a sample code for use it.

Can you orient to me for do this ?

Thank you in advance
On 7/10/2010 12:59 PM, OmarP wrote:
> Hello,
> I need get analog measure with my RCM3700, and see that I can use mcp3204 (analog to digital converter).
> I have clear the hardware connection: I need set a serial port to spi mode, TXC,RXC and Clock C for example to SPI_SER_C
>
> But I cannot found a sample code for use it.
>
> Can you orient to me for do this ?
>

I just uploaded atod.zip to the groups files area. It has a driver for
the 3208 (8-channel version of the same chip.) Uses SPI. The board uses
port A for chip selects. you can change it to use a different port for
chip selects.

--
------
Scott G. Henion, Consultant
Web site: http://SHDesigns.org
Rabbit libs: http://shdesigns.org/rabbit/
------

Thank Scott !
The library works very whell !

--- In r..., Scott Henion wrote:
>
> On 7/10/2010 12:59 PM, OmarP wrote:
> > Hello,
> > I need get analog measure with my RCM3700, and see that I can use mcp3204 (analog to digital converter).
> > I have clear the hardware connection: I need set a serial port to spi mode, TXC,RXC and Clock C for example to SPI_SER_C
> >
> > But I cannot found a sample code for use it.
> >
> > Can you orient to me for do this ?
> >
>
> I just uploaded atod.zip to the groups files area. It has a driver for
> the 3208 (8-channel version of the same chip.) Uses SPI. The board uses
> port A for chip selects. you can change it to use a different port for
> chip selects.
>
> --
> ------
> Scott G. Henion, Consultant
> Web site: http://SHDesigns.org
> Rabbit libs: http://shdesigns.org/rabbit/
> ------
>


Memfault Beyond the Launch