View Single Post
  #3   Spotlight this post!  
Unread 02-07-2010, 09:58
artdutra04's Avatar
artdutra04 artdutra04 is offline
VEX Robotics Engineer
AKA: Arthur Dutra IV; NERD #18
FRC #0148 (Robowranglers)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2002
Location: Greenville, TX
Posts: 3,078
artdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond repute
Re: spi interface with accelerometer and pic 18f448 problem

There are so many weird quirks with SPI that it will be almost impossible to find a perfect solution on the Internet.

I suggest that you get four things to solve your problem: an oscilloscope (preferably a digital one, as you can "pause" these), the accelerometer datasheet (especially the SPI timing diagrams), the microcontroller datasheet, and patience.

Try sending a sample data packet over the SPI bus. Hook up the SEL, CLK, MISO and MOSI lines to the oscilloscope. Watch the data packet being sent on the scope, and see if it looks like the timing diagrams. It could be something as simple as the SEL line goes active a half CLK cycle after the MOSI line starts sending data, throwing everything off. Or it could be much more complicated.

Debugging is a critical engineering skill, and it's one that can only be learned through lots of experience.
__________________
Art Dutra IV
Robotics Engineer, VEX Robotics, Inc., a subsidiary of Innovation First International (IFI)
Robowranglers Team 148 | GUS Robotics Team 228 (Alumni) | Rho Beta Epsilon (Alumni) | @arthurdutra

世上无难事,只怕有心人.
Reply With Quote