CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Mma7455l can't read SDO

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Grégoo



Joined: 02 May 2011
Posts: 2
Location: Paris France

View user's profile Send private message

Mma7455l can't read SDO
PostPosted: Mon May 02, 2011 11:35 am     Reply with quote

Hello everybody, i need your help for a problem that I can't resolve by myself.
I have a sensor accelerometer(slave) mma7455L linked in SPI to a pic16f877(master).

http://www.freescale.com/files/sensors/doc/data_sheet/MMA7455L.pdf

I have configured my pic in SPI as well. I see on the scope that i have the right signals:





I didn't represent on the scope the SDO signal because I ve got nothing, the sensor doesn't respond to the pic and here is the problem: why don't I have something on the SDO?
As the diagram of the SPI is pretty correct, I deduce that the problem comes from the configuration of the sensor.
Tell me if my steps are correct:

I send the address 0x16 in write mode
Then I send and chose my option of the "Mode Control Register" which i put in "write" too.
I send the address that i will need to read from the sensor. For example $06 which is the address register of value X, in mode write
I then send something to the sensor just to activate the clock and the transfer, in mode read.

The Pic is powered to 5v and delivers 5V on his I/O pins.
The sensor mma7455l can support 3.6V max. I made a mistake at the start of my project and I powered it on 5V, do you think it had burned the sensor or destroy something?

Now, i powered the sensor on 3.3 V but it still has data ( SDI ), clock (SPC ) and CS on 5V, does it fit?

Please, i really need help.
_________________
Life is a dream which death finish
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon May 02, 2011 1:39 pm     Reply with quote

Quote:

The sensor mma7455l can support 3.6V max. I made a mistake at the
start of my project and I powered it on 5V, do you think it had burned the
sensor or destroy something?

It's possible that you destroyed the chip.


It would be much easier if you would get the "LF" version of the PIC.
Then you could run the PIC at +3.3v and also run the MMA7455L at +3.3v.
Then you wouldn't have any problems with level translation. Though,
for a 16F877, the maximum frequency at +3.3v is only 10 MHz.
Ttelmah



Joined: 11 Mar 2010
Posts: 19326

View user's profile Send private message

PostPosted: Mon May 02, 2011 4:01 pm     Reply with quote

You are swapping SDI, and SDO on the devices?.
SDO on the PIC, needs to go to SPI on your other device, and vice versa.
Also, you need resistive dividers on the PIC SDO, ahd clock to feed the chip or you will risk damaging it (the signals you are showing are too large to feed to a 3.3v device, unless it specifically says it is '5v tolerant'. Then the return from the device _will_ need to be amplified to feed the PIC. The PIC SDI input, requires 4v, when the chip is running off a 5v supply, which a 3.3v device is not going to generate....
As PCM programmer says, much easier to use a PIC at 3.3v.

Best Wishes
Grégoo



Joined: 02 May 2011
Posts: 2
Location: Paris France

View user's profile Send private message

PostPosted: Wed May 04, 2011 5:59 am     Reply with quote

Hi,
first, thank you for you responses.

I've put the SDO of the PIC to the SDI of the sensor mm7455l and vice versa, then i think there is no problem with the wiring.


I've test with resistances in series between the pic and the sensor but none of the value of resistance fits. The resistances modify the signals from square to triangle and it doesn't decrease enough the value of the signal with goes from 5V to 4V.
Do you have a simple method to go 3V from 5V please?
Thank you
_________________
Life is a dream which death finish
Geps



Joined: 05 Jul 2010
Posts: 129

View user's profile Send private message

PostPosted: Wed May 04, 2011 7:44 am     Reply with quote

Voltage divider made up of 1k8 and 3k3.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group