Go to Post We like playing with power tools, stripping wire, or just stripping for alliance partners... - Amanda Morrison [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 05-02-2004, 20:03
Greg's Avatar
Greg Greg is offline
Registered User
FRC #1075 (Sinclair Sprockets)
Team Role: College Student
 
Join Date: Nov 2002
Rookie Year: 2003
Location: Whitby, Ontario, Canada
Posts: 108
Greg is on a distinguished road
Send a message via ICQ to Greg Send a message via MSN to Greg
Software SPI Interface

I have been trying to interface a sensor that uses an SPI interface to the RC. I know the actual SPI bus on the PICs is used by IFI - this is how the two PICs communicate. However, C18 has a set of "Software SPI" functions that use digital input pins to emulate SPI (C18 Library Manual, p.121).

I looked at the default values for the SPI pins in the manual. They appear to correspond to digital inputs 1, 2, 5, and 6 on the RC. I connected the sensor to these pins, included the sw_spi.h header in the project, and tried to talk to the sensor.

For some reason I cannot get the data out of the sensor. I either get all 1, or all 0 in a byte No real data.

I am suspecting a conflict with the default FIRST code. The function that initializes the SPI, OpenSWSPI, is supposed to set up the pins correctly. Could it be that the FIRST library is conflicting with this? I tried to remove all lines that referenced the pins I am using from the default code. Didnt help.

Also for some reason if I change the pin assignment in sw_spi.h in the mcc18 folder the program does not build properly. Do I have to recompile something or include any other files in my project?

Did anyone use the software SPI functions? Or the software I2C which should be close to what I am doing?
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to create custom interface _GP_ Technical Discussion 1 18-01-2004 21:24
which software Ryan Foley 3D Animation and Competition 5 01-03-2003 23:39
Looking for operator interface... Where is it? mike325 General Forum 2 07-01-2003 15:28
Gyro interface to software archiver 2001 1 24-06-2002 02:51
software software software archiver 2001 5 24-06-2002 00:21


All times are GMT -5. The time now is 10:34.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi