AnsweredAssumed Answered

LPC17XX SPI SPCR register BITEnable for 8 bits

Question asked by Nicholas Lawrenson on Aug 9, 2018
Latest reply on Aug 9, 2018 by jeremyzhou

Hi, new to embedded. I am communicating to various peripherals via SPI with the LPC1758. The first device I had working required a 32 bit word. I got this working by sending 2x16 bit words no problem.

 

I then moved on to the next device which required a 24bit word, which meant that 8-bit SPI transfer was better suited. I then decided to change the previous device implementation to send 4x8bit words instead.

 

I decided to leave the SPCR->BitEnable (SPCR bit 2)  enabled and set SPCR->BITS (SPCR 11:8) to 1000 (8 bits per transfer) and could not get the communication working.

 

After trying everything I disabled SPCR->BitEnable (SPCR bit 2), which set the transfer to default (8 bit transfer) and suddenly sending works fine with no other changes other than removing SPCR->BitEnable (SPCR bit 2) and SPCR->BITS (SPCR 11:8)  from the code.

 

Is anyone able to tell me why this may be? Didn't post any code as I am unsure if that will help.

 

kind regards,

Nick

Outcomes