LPC1769(LPCXpresso) SPI problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1769(LPCXpresso) SPI problem

3,782 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by haber on Sat Feb 06 03:00:34 MST 2016
Hi.

I'm trying to execute SPI mode with LPCOpen example(periph_spi).

I succeed in concurrent example(no revise the example code)

but, when I tried to SPI connect with other device(arduino uno), it isn't work well(same code).

When I disconnect SSP pin(J5 - J8) and connect with Arduino board, MISO port(SPI) transmit only 0xFF

So, I try debuging, As a result, pSPI->DR = SPI_DR_DATA(data) (in the function Chip_SPI_SendFrame  spi_17xx_40xx.h)

not work well.

In the function Chip_SPI_SendFrame(LPC_SPI_T *pSPI, uint16_t data), 'data' variable have correct

value.

But, pSPI->DR = SPI_DR_DATA(data) result, pSPI->DR variable have 0xFF.

When SPI pin connect with SSP pin concurrently, pSPI->DR = SPI_DR_DATA(data) work well.

But, if I disconnect SPI pin with SSP pin, pSPI->DR variable have only 0xFF regardless of value SPI_DR_DATA(data).

What's the wrong?

Thank you.
Labels (1)
0 Kudos
Reply
6 Replies

3,190 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by haber on Sat Feb 06 14:54:56 MST 2016
Oh, Thanks for your replying.

I solved the problem!

Initial SPI bitrate setting in LPCXpresso example is 400Khz.

But, Arduino don't support 400Khz SPI bitrate.

As a result, SPI communication between LPCXpresso and Arduino no work well.

When I configurate LPCXpresso SPI as1Mhz bitrate, it works well!

Thank you again for your support.
0 Kudos
Reply

3,190 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Sat Feb 06 12:47:46 MST 2016

Quote: haber
So, connection of Arduino and Arduino source code is no problem.



:quest:

Any hint about hardware signals (Scope) or voltages ?
0 Kudos
Reply

3,190 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by haber on Sat Feb 06 07:11:24 MST 2016
First of all, thanks for replying.

In the both case(connecting concurrently and with other device), LPCXpresso SPI is master.

LPCXPresso SSP(J6.5 - J6.8) is slave in the example and Arduino is slave in the connecting other device.

And I connect with the device like below :

-NXP LPC1769 LPCXpresso board
* SPI connection with Master :
  - P0.15:  SPI_SCK (J6.13)
  - P0.16 : SPI_SSEL (J6.14)
  - P0.17:  SPI_MISO (J6.12)
  - P0.18:  SPI_MOSI (J6.11)

* SSP1 connection with Slave :
  - P0.7:  SSP1_SCK  (J6.7)
  - P0.6:  SSP1_SSEL (J6.8)
  - P0.8:  SSP1_MISO (J6.6)
  - P0.9:  SSP1_MOSI (J6.5)
The SCK pin of SPI is connected to SCK of SSP1.
The SSEL pin of SPI is connected to SSEL of SSP1.
The MISO pin of SPI is connected to MISO of SSP1.
The MOSI pin of SPI is connected to MOSI of SSP1.

-----> this connection is in the concurrent example. It is works well.




LPCXpresso SPI connection with Master :
  - P0.15:  SPI_SCK (J6.13)
  - P0.16 : SPI_SSEL (J6.14)
  - P0.17:  SPI_MISO (J6.12)
  - P0.18:  SPI_MOSI (J6.11)

Arduino SPI connection with slave :
                 - D13 : SPI_SCK
                 - D12 : SPI_MISO
                 - D11 : SPI_MOSI
                 - D10 : SPI_SSEL
The SCK pin of SPI is connected to SCK of Arduino SPI(D13).
The SSEL pin of SPI is connected to SSEL of Arduino SSEL(D10).
The MISO pin of SPI is connected to MISO of Arduino MOSI(D11).
The MOSI pin of SPI is connected to MOSI of Arduino MOSO(D10).

-----> this connection is in the connecting other device case. It is works not well.
         But, when Arduino connect with other Arduino in SPI Mode, it works well.
         So, connection of Arduino and Arduino source code is no problem.

Thank you.
0 Kudos
Reply

3,190 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by haber on Sat Feb 06 07:03:38 MST 2016
.
0 Kudos
Reply

3,190 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by haber on Sat Feb 06 07:03:10 MST 2016
.
0 Kudos
Reply

3,190 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mysepp on Sat Feb 06 04:33:39 MST 2016
Who is master, who is slave?
What have you connected from one side to what on the other side?
0 Kudos
Reply