SPI on Port C

Hi, I’m trying to do a combined ethernet and SPI program using an RCM3700 and Chipcon 8051 compatible microcontroller and I ran into problem. I made a simple SPI program that reads in the SPI data and that worked fine on Port B with the #define SERB_USEPORTD as well as Port C and Port D when I tried it. I also wrote a program to handle tcp sockets for the ethernet and that worked fine on its own as well. When I put them together (each in it’s own costate) I had to set it to Port C because of conflicts with the ethernet on the other port. This worked great (and seemed to go Alot faster when doing printf’s of the incoming data) until I got a “bad packet” error while that was running. I assumed it was something in my code and I just clicked ok and double checked my code. Everything seemed fine, but ever since then Port C no long works for SPI. I went back and tried my original program that simply read in the SPI data, and it works fine on all the other ports except port C.

I’m wondering what could cause port C to work and then suddenly die like this? I’ve tried another RCM3700 microcontroller and it too does not work with port C. After reading the archives I think the bad packet error has to do with a communication problem with the rabbit. I’ve tried using normal reading and writing to port C so I think its just limited the SPI. Is there any registers that might be storing something funky that I can clear or erase? From what I can tell it seems to be “hanging” when I call the SPIRead() function. My code for reading from port C is listed below.

#class auto
#define SPI_SER_C
#define SPI_SLAVE
#use “spi.lib”

void main(){
char spi_reading[10];
SPIinit(); // initialize SPI


	SPIRead(spi_reading, 8);
	printf("SPI bytes = 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x

", spi_reading[0], spi_reading[1], spi_reading[2], spi_reading[3], spi_reading[4], spi_reading[5], spi_reading[6]);

Any ideas / help is greatly appreciated.
Thanks in advance!

I managed to track down the problem to the development board. There is an RS232 chip hooked into that port and unless its disabled it can prevent clock signals for the SPI coming in properly. The easiest fix is to remove the Rabbit from the deboard and then everything works.

I am having a heck of a time to get SPI rabbit-to-rabbit working reliably. I find that the master get out of sink and the slave is confused and gets behind in sending data. I find this after anywhere between 20-40 packets of 4 bytes.

Can you tell me which port this chip affects? I am using SPI on serial port B with input/output on port C. Clock is on PB0.

Or if you can point me to the manual in a given page. I have been looking but have not found.

Thanks for any help.