# SPI Problem

**URL:** <https://forums.digi.com/t/spi-problem/10932>\
**Category:** Rabbit\
**Created:** [March 5, 2009, 2:23pm UTC](https://forums.digi.com/t/spi-problem/10932 "2009-03-05T14:23:57Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![carmenc](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@carmenc](https://forums.digi.com/u/carmenc)\
**Post date:** [March 5, 2009, 2:23pm UTC](https://forums.digi.com/t/spi-problem/10932/1 "2009-03-05T14:23:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![LucaV](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@LucaV](https://forums.digi.com/u/LucaV)\
**Post date:** [March 26, 2009, 10:38am UTC](https://forums.digi.com/t/spi-problem/10932/2 "2009-03-26T10:38:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kobuseng](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@kobuseng](https://forums.digi.com/u/kobuseng)\
**Post date:** [March 5, 2009, 3:15pm UTC](https://forums.digi.com/t/spi-problem/10932/3 "2009-03-05T15:15:58Z")

</div>

Please dont post in multiple topics.

---

<div class="post-metadata">

**Author:** ![carmenc](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@carmenc](https://forums.digi.com/u/carmenc)\
**Post date:** [March 6, 2009, 9:47am UTC](https://forums.digi.com/t/spi-problem/10932/4 "2009-03-06T09:47:48Z")

</div>

Sorry, I won’t do any more.

Excuse me

Carmen

---

<div class="post-metadata">

**Author:** ![carmenc](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@carmenc](https://forums.digi.com/u/carmenc)\
**Post date:** [March 26, 2009, 11:13am UTC](https://forums.digi.com/t/spi-problem/10932/5 "2009-03-26T11:13:45Z")

</div>

[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

---

<div class="post-metadata">

**Author:** ![LucaV](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@LucaV](https://forums.digi.com/u/LucaV)\
**Post date:** [March 26, 2009, 11:43am UTC](https://forums.digi.com/t/spi-problem/10932/6 "2009-03-26T11:43:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![carmenc](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@carmenc](https://forums.digi.com/u/carmenc)\
**Post date:** [March 26, 2009, 11:52am UTC](https://forums.digi.com/t/spi-problem/10932/7 "2009-03-26T11:52:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![addankianandbabu](https://avatars.discourse-cdn.com/v4/letter/a/94ad74/32.png) [@addankianandbabu](https://forums.digi.com/u/addankianandbabu)\
**Post date:** [May 3, 2010, 2:33pm UTC](https://forums.digi.com/t/spi-problem/10932/8 "2010-05-03T14:33:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lclark](https://avatars.discourse-cdn.com/v4/letter/l/96bed5/32.png) [@lclark](https://forums.digi.com/u/lclark)\
**Post date:** [June 25, 2010, 9:08pm UTC](https://forums.digi.com/t/spi-problem/10932/9 "2010-06-25T21:08:29Z")

</div>

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();

…  
}

---

<div class="post-metadata">

**Author:** ![pccho3](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pccho3](https://forums.digi.com/u/pccho3)\
**Post date:** [September 13, 2010, 8:48am UTC](https://forums.digi.com/t/spi-problem/10932/10 "2010-09-13T08:48:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![carmenc](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@carmenc](https://forums.digi.com/u/carmenc)\
**Post date:** [March 7, 2011, 8:53am UTC](https://forums.digi.com/t/spi-problem/10932/11 "2011-03-07T08:53:06Z")

</div>

Here you have it

---

<div class="post-metadata">

**Author:** ![carmenc](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@carmenc](https://forums.digi.com/u/carmenc)\
**Post date:** [March 7, 2011, 8:53am UTC](https://forums.digi.com/t/spi-problem/10932/12 "2011-03-07T08:53:57Z")

</div>

Here you have it

---

<div class="post-metadata">

**Author:** ![ykfdf](https://avatars.discourse-cdn.com/v4/letter/y/8491ac/32.png) [@ykfdf](https://forums.digi.com/u/ykfdf)\
**Post date:** [December 24, 2012, 11:11am UTC](https://forums.digi.com/t/spi-problem/10932/13 "2012-12-24T11:11:41Z")

</div>

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](http://www.mmoggg.de/)|[Diablo 3 Gold](http://www.mmoggg.de/Diablo-3-gold/)|[kaufen Guild Wars 2 gold](http://www.mmoggg.de/Guild-Wars-2/index.html)
