SPI Problem

Hello Everybody,

I’m working with a Rabbit minicore RCM5700, and I’m trying to write by SPI
serial bus using the SPI.LIB library. I’m using Dynamic C version 10.44 and
it’s libraries.

I want to use PORT B as SPI port, so I have defined #define SPI_SER_B,
before include SPI.LIB, in other words, my real code is:

#define SPI_SER_B
#define SPI_CLK_DIVISOR 5
#define SPI_MASTER //we are master
#use “spi.lib”

When I write to SPI by SPIWrite function I can’t see any data in PC4 line,
but SCK line (PB0) is working properly.

I have read in SPI.LIB header:
“This library is intended for use only with the Rabbit 4000 processor.”
and I have a Rabbit 5000 processor so I think it could be a little
different, is there a new SPI library for these processors? where can I get
it?

If you had the same error as me in the past, can you help me?

Thanks in advance

Carmen

Hi Carmen, I’m trying to do the same thing with a RCM5700 but I have the same problem.
Did you get any solution about that?

Thanks,
Luca.

Please dont post in multiple topics.

Sorry, I won’t do any more.

Excuse me

Carmen

[QUOTE=LucaV;3108]Hi Carmen, I’m trying to do the same thing with a RCM5700 but I have the same problem.
Did you get any solution about that?

Thanks,
Luca.[/quote]

Hi Luca,

I resolved the problem using a new library instead SPI.LIB supply by Rabbit Enviroment (DC_RABBIT_10.44). This new library is SPITecnalia, and I attach you below.

This library has a few changes with the old one. One of them is to set up SPI clock mode. Another change is in order to set up PC4 as a serial port output by setting bit 4 in the PCFR register. The SPI driver was written before Rabbit 5000 was in existence and port C was fixed.

I hope you have success with this library

Best Regards

Carmen

Hi Carmen,
thank you very much, this library works fine with what I need to do, and by now it’s just perfect.

On the other hand, looking at it (correct me if I’m wrong), it seems that it sets the clock mode and the TX pin fixed for every choice of serial port and mode I could have done in the defines. So it seems to use always port B and Clock mode 0, is it right?
If you know, is there any official Rabbit library that works with RCM5700? It seems very disappointing to me that they didn’t release one yet…

Thanks a lot again,
Regards,
Luca.

Hi Luca,

You are rigth, this library is hardcoded for using PortB and clock mode 0, fixed. It�s a solution I have done for my product with help from forum members and technical support from Rabbit. As yoy say Rabbit hasn’t build any official library for the RCM5700 yet.

Have a nice day

Carmen

HI Carman i am unable to doenload SPITecnalia.Zip can please tell where exactly i can get that code , as i am facing similar problem with RCM 5700 SPI please suggets me i am in need of that code

Thanks
A.Anandbabu

I also had the same problem with RCM5700 and the SPI lib. PC4 needs to be intiialized, probably should be part of the sample…

#define SPI_MASTER
#define SPI_SER_B
#define SPI_CLK_DIVISOR 100

#use “spi.lib”

main()
{
// Initialize PC4 (SPI TX) to output
BitWrPortI(PCDDR, &PCDDRShadow, 1, 4);
// Initialize PC4 to use alternate function
BitWrPortI(PCFR, &PCFRShadow, 1, 4);

SPIinit();


}

i am using RCM5600W, i would like to download the SPITecnalia.zip, anyone can post this file again. Urgent! Thanks!!

Here you have it

Here you have it

I resolved the problem using a new library instead SPI.LIB supply by Rabbit Enviroment (DC_RABBIT_10.44). This new library is SPITecnalia, and I attach you below.


WoW gold|Diablo 3 Gold|kaufen Guild Wars 2 gold