# SPI on lpcH2129

**URL:** <https://community.sparkfun.com/t/spi-on-lpch2129/2357>\
**Category:** MicroMod\
**Tags:** arm-lpc\
**Created:** [August 4, 2006, 9:07am UTC](https://community.sparkfun.com/t/spi-on-lpch2129/2357 "2006-08-04T09:07:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lpcH2129](https://avatars.discourse-cdn.com/v4/letter/l/48db29/32.png) [@lpcH2129](https://community.sparkfun.com/u/lpcH2129)\
**Post date:** [August 4, 2006, 9:07am UTC](https://community.sparkfun.com/t/spi-on-lpch2129/2357/1 "2006-08-04T09:07:57Z")

</div>

hello

I have a problem with the spi0 on a board lpcH2129, I work with ÂµVISION,

the code seems to me correct, but does not work, I sees anything (noise) on the pines spi with the oscillo.

I you joint the code if somebody can help me

thank you

* * *

#include \<LPC21xx.H\> // LPC21xx definitions

static void Write(unsigned char val)

{

IOSET0 = 0x00000080; //

S0SPDR = val; // sent first byte

while(!(S0SPSR & 0x80)); // wait for end of transfer

IOCLR0 = 0x00000080; //

}

static void SPI\_Init(void)

{

IODIR0 |= 0x00000080; // for SSEL

IOCLR0 = 0x00000080; //

PINSEL0 |= 0x00001500; // pin config, whithout SSEl

S0SPCCR = 12; // SCK = 1 MHz,

S0SPCR = 0x28; // master mode, MSB first, no interrupt

}

int main (void)

{

SPI\_Init();

while(1)

{

Write(0x02);

}

}

---

<div class="post-metadata">

**Author:** ![Lajon](https://avatars.discourse-cdn.com/v4/letter/l/ea666f/32.png) [@Lajon](https://community.sparkfun.com/u/Lajon)\
**Post date:** [August 4, 2006, 4:32pm UTC](https://community.sparkfun.com/t/spi-on-lpch2129/2357/2 "2006-08-04T16:32:42Z")

</div>

From user manual:

> Note: LPC2119/2129/2194/2292/2294 configured to operate as SPI master MUST select
> 
> SSEL functionality on an apropriate pin and have HIGH level on this pin in order to act
> 
> as a master.

Maybe this is your problem?

/Lars

---

<div class="post-metadata">

**Author:** ![lpcH2129](https://avatars.discourse-cdn.com/v4/letter/l/48db29/32.png) [@lpcH2129](https://community.sparkfun.com/u/lpcH2129)\
**Post date:** [August 7, 2006, 5:40pm UTC](https://community.sparkfun.com/t/spi-on-lpch2129/2357/3 "2006-08-07T17:40:41Z")

</div>

I read that in the lpch2129 datacheet but, it is necessary to put pine SSEL in the high state by software or by puttingin it directly 5v

?

---

<div class="post-metadata">

**Author:** ![lpcH2129](https://avatars.discourse-cdn.com/v4/letter/l/48db29/32.png) [@lpcH2129](https://community.sparkfun.com/u/lpcH2129)\
**Post date:** [August 8, 2006, 4:14pm UTC](https://community.sparkfun.com/t/spi-on-lpch2129/2357/4 "2006-08-08T16:14:48Z")

</div>

thank you for the assistance

it was necessary to put pine SSEL has 3.3V on the hardware and not by the software.
