Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

interfacing 12bit ADC in SPI mode?

Status
Not open for further replies.

Sajjadkhan

Full Member level 5
Joined
Sep 25, 2010
Messages
307
Helped
17
Reputation
34
Reaction score
16
Trophy points
1,298
Location
Rawalpindi,Pakistan
Activity points
4,199
hi, i ordered a 12bit ADC MCP3204 which has an SPI interface. Any good tutorial for SPI interface would be helpful.
One more thing MCP3204 will output 12 bit of serial data but PIC16f887 revieves only 8 bit, how to handle that?
 

hello

you have to use an integer ( 16 bits = 2 bytes !) variable to store the result.
see example in mikroC
**broken link removed**

it's not the same device , but the approach is similar..
test on MCP3304 4x 13bits ADC
value on 12 bits unsigned in single end mode.
ex: 0 à 5V for 0 ..4095 value

if your reference is 4.096V. you get directly input=4095 mv measure =4095 points

if you use differential mode:
value on 13 bits 1 for sign , 12 for value .
 

hi, i ordered a 12bit ADC MCP3204 which has an SPI interface. Any good tutorial for SPI interface would be helpful.
One more thing MCP3204 will output 12 bit of serial data but PIC16f887 revieves only 8 bit, how to handle that?

Why not reference the appnotes of the manufacture:

Microchip AN719 Interfacing Microchip’s MCP3201 Analog-to-Digital Converter to the PICmicro® Microcontroller

Microchip AN703 Using the MCP320X 12-Bit Serial A/D Converter with Microchip PICmicro® Devices

The above appnotes contain sample code in both C and Assembly.

Processing and storing a 12-bit ADC value is scarcely different the dealing with the 10-bit ADC value of the built-in ADC of PIC16F887.

The value will require two bytes of storage and either right or left justification.


BigDog
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top