LPC812 SPI1 Master Clock and Chip Select Missing

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

LPC812 SPI1 Master Clock and Chip Select Missing

428 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rorrik on Fri Oct 03 14:24:33 MST 2014
Using the following code to configure my SPI Master, I expect to see a 100 Kbs clock on P0_9, my sent signal on P0_15, and my chip select on P0_8.

        regVal = LPC_SWM->PINASSIGN4 & ~( 0xFFUL<<24 );
        LPC_SWM->PINASSIGN4 = regVal | ( 0x9<<24 );        //9 SCK
regVal = LPC_SWM->PIN  ASSIGN5 & ~( 0xFF<<0 );
LPC_SWM->PINASSIGN5 = regVal | ( 0xF<<0 );//15 MOSI
regVal = LPC_SWM->PINASSIGN5 & ~( 0xFF<<8 );
LPC_SWM->PINASSIGN5 = regVal | ( 0x11<<8 );//17 MISO
regVal = LPC_SWM->PINASSIGN5 & ~( 0xFF<<16 );
LPC_SWM->PINASSIGN5 = regVal | ( 0x8<<16 );//8 SSEL

        SPI_Init(LPC_SPI1, 0x7D, CFG_MASTER, DLY_PREDELAY(0)|DLY_POSTDELAY(0)|DLY_FRAMEDELAY(0)|DLY_INTERDELAY(0));

        message = (uint8_t *) TestSignal;
mSize = 2*sizeof(TestSignal) / sizeof(TestSignal[0]);

        SPI_Send( LPC_SPI1, CS_USED, message, mSize);

Probing each of these three pins, I see my test signal on pin P0_15 as expected, and the bit width is 10 microseconds as expected, corresponding to a clock period of 10 microseconds and a clock rate of 100 Kbs. However, I don't see a clock on P0_9 or the chip select on P0_8.

Any ideas what the problem could be? It should be noted that I am using SPI0 as a Slave and successfully receiving a signal from a master on pins 12, 13, and 14 before sending my master signal here.

Thanks!
Labels (1)
0 Kudos
3 Replies

352 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dnsc4f@mst.edu on Sat Apr 11 05:55:31 MST 2015
If you are using the LPC812 dev kit, you will need to remove the jumpers from SJ2 and SJ3, pins 1-2 (removing the PIO_8/9 connections to the oscillator).  Then solder SJ2 and SJ3 jumper pins 2-3.  This then requires that you use the internal RC oscillator.  Now the dev kit pins will now be connected to PIO_8 and PIO_9.  See LPCExpresso LPC800 Rev B Schematic for details.
0 Kudos

352 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rorrik on Tue Oct 14 06:19:33 MST 2014
Pins 2 and 3 are the pins used to debug, so that is what froze up the board, by tying PIO0_1 (ISP_EN) to ground on power up, I was able to fix the error. Due to a lack of suitable pins, I have removed LED resistors from the board in order to use pins 16 and 17.
0 Kudos

352 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rorrik on Fri Oct 10 13:56:01 MST 2014
It would seem that pins 8 and 9 are not actually suitable for IO, though they claim to be. By switching to pins 2 and 3, I have remedied this problem, though now LPCXpresso says it cannot connect to the target. Documentation of the error does not seem to exist:

LPCXpresso Debug Driver v7.2 (May 13 2014 18:13:18 - crt_emu_cm3_gen build 1263)
Failed on connect: Ep(01). Target marked as not debuggable.
Connected. Was: None. DpID:     EDB6. Info: HID64HS12
0 Kudos