Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
Thread Tools Display Modes
Old 7th June 2008, 10:57 AM   (permalink)
Default Help needed for SPI

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.
__________________
Sqn R.K. Chakravarthy
----------------------
Sky is not the limit for Air Warriors
Rajaneesh is offline   Reply With Quote
Old 7th June 2008, 11:10 AM   (permalink)
Default

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.
Diver300 is offline   Reply With Quote
Old 7th June 2008, 11:11 AM   (permalink)
3v0
Default

You need to post your code and schematic.
3v0 is offline   Reply With Quote
Old 7th June 2008, 12:47 PM   (permalink)
Default

Quote:
Originally Posted by 3v0 View Post
You need to post your code and schematic.
Thanks 3v0 / Diver.....

Here is the code for the reg conf.....

Please go through and guide me...
Attached Files
File Type: c spi test.c (746 Bytes, 11 views)
__________________
Sqn R.K. Chakravarthy
----------------------
Sky is not the limit for Air Warriors
Rajaneesh is offline   Reply With Quote
Old 7th June 2008, 01:39 PM   (permalink)
Default

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.
Pommie is offline   Reply With Quote
Old 8th June 2008, 02:05 AM   (permalink)
3v0
Default

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

Quote:
Originally Posted by Pommie View Post
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.

Quote:
Originally Posted by datasheet
The status of the internal conversion
is the SDO/RDY pin and is available with CS low.
A High state on SDO/RDY means the device is busy
converting, while a Low state means the conversion is
finished and data is ready for transfer using SCK.
SDO/RDY remains in a high-impedance state when
CS is held high. CS must be low when clocking out the
data using SCK and SDO/RDY.
3v0 is offline   Reply With Quote
Old 9th June 2008, 04:34 AM   (permalink)
Default

Quote:
Originally Posted by 3v0 View Post
First let me say that I have just started working with SPI and only with the MCP41XXX.



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....?
__________________
Sqn R.K. Chakravarthy
----------------------
Sky is not the limit for Air Warriors
Rajaneesh is offline   Reply With Quote
Old 9th June 2008, 10:21 AM   (permalink)
3v0
Default

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.

Quote:
Originally Posted by Rajaneesh View Post
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.
3v0 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Major Help Needed Please: Peltier and 2 channel fan controller needed :S MR Spade General Electronics Chat 16 23rd November 2007 03:10 PM
Help Needed black2sic Electronic Projects Design/Ideas/Reviews 2 10th January 2007 05:19 AM
i2c help needed jaspreet Micro Controllers 2 12th June 2006 07:23 AM
Your help is needed, please tronicsdoc General Electronics Chat 1 14th November 2004 04:10 AM
help needed sai_kiran Electronic Projects Design/Ideas/Reviews 1 24th September 2003 04:14 PM



All times are GMT. The time now is 12:46 PM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.