Help needed for SPI

Status
Not open for further replies.

Rajaneesh

Member
Dear techies,

I need help in getting the data from MCP3550 - 22bit Delta sigma ADC chip using SPI. Iam unable to get the data out through SDO.

I have tried as per the data sheet, but it doesn't work.
 
What are you driving the SPI with?

Have you got an oscilloscope to see what the lines are doing?

I think we need more information in order to help you.
 
You can't just send data out with SPI, you have to receive it as well, after you send a byte you have to wait until a byte is received (BF=1) and then read SSPBUFF. Microchip have a good document explaining it.

Mike.
 
First let me say that I have just started working with SPI and only with the MCP41XXX.

You can't just send data out with SPI, you have to receive it as well, after you send a byte you have to wait until a byte is received (BF=1) and then read SSPBUFF. Microchip have a good document explaining it.
Mike.

I understand why you are saying the above. But some of the Microchip SPI enabled chips do not conform. For example the MCP41XXX digital pot does not have an SO pin. It is a send and pray transfer. The dual version MCP42XXX has an SO pin but it is used to dasiy chain these devices and does not connect to the master SI pin.

The MCP3550 has no SI pin. It is a read only device execpt that the CS line is used to start a conversion.

 

Hi 3V0,

I have tried to get the data by making CS low, but i couldnt get any data through SDO... Can u help me in this regard....?
 
First you did not provide a schematic as I asked. I know it is simple but simple mistakes will prevent it from working. We could write pages of text about the software and it would not help if you have not wired it correctly.

A quick look at you code shows that you are using the hardware SPI. The hardware expects the slave to play nice as in the document Mike pointed out. It may be easier (at least to start with) to bit-bang the code (not use the hardware SPI). Read the serial communication section of the data sheet to see what you need to do. The nice thing about this is that you can easily debug the data transfer one bit at a time using a logic probe of even a volt meter.

I have never used the hardware SPI. If you want to go that route you need help from someone who has. You need to study and understand the processor datasheet, the compiler doc for the SPI routines, and the data sheet for the slave MCP3550.

Hi 3V0,

I have tried to get the data by making CS low, but i couldnt get any data through SDO... Can u help me in this regard....?

Again post the code you used. The schematic would be nice too, does not have to be fancy just readable. At least tell us what MCP3550 pins are connected to what processor pins.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…