# Problem with SPI in portB

**URL:** <https://forums.digi.com/t/problem-with-spi-in-portb/9573>\
**Category:** Rabbit\
**Created:** [March 5, 2009, 2:20pm UTC](https://forums.digi.com/t/problem-with-spi-in-portb/9573 "2009-03-05T14:20:15Z")\
**Posts on this page:** 3\
**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:20pm UTC](https://forums.digi.com/t/problem-with-spi-in-portb/9573/1 "2009-03-05T14:20:15Z")

</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:** ![jking](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jking](https://forums.digi.com/u/jking)\
**Post date:** [August 25, 2010, 8:42pm UTC](https://forums.digi.com/t/problem-with-spi-in-portb/9573/2 "2010-08-25T20:42:28Z")

</div>

Has anyone seen worse documentation? Sample programs that don’t run. Each sample seems to have a different piece of the puzzle.

After spending days to get I2C to work. I’ve spent more days trying to get a simple SPI app to work.

Is there an spi.lib for the 5000 series and known good sample code?

---

<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:50am UTC](https://forums.digi.com/t/problem-with-spi-in-portb/9573/3 "2011-03-07T08:50:50Z")

</div>

Here I send you, the SPI library that works for me.

Best regards

Carmen
