9 years, 1 month ago.

Effective SPI bitrate really slow on LPC11U68

I have tested SPI output on 11U68 and I think it is working quite slow. I try to run the SPI at 10Mhz and I get the wanted clock (rounded to 12.5Mhz), but I get delays (about 2us) between the bytes that are longer than it takes to send one byte (about 0.62us). This gives me an effective bitrate of about 2MHz which is low compare to the desired (10Mhz).

I have the following test code for SPI on 11U68

#include "mbed.h"

SPI spi0_device(P0_9, P0_8, P1_29); // mosi, miso, sclk

int main() {
    spi0_device.frequency(10000000);    
 
    while(1) {
        spi0_device.write(0x55);
      }
}

I see the following output on my logic anayzer: /media/uploads/johandevex/spi_12_5mhz_11u68.png

Is the chip output limited or are there some problems in the driver?

Question relating to:

1 Answer

9 years, 1 month ago.

The mbed SPI library has a lot of overhead.

The Burst SPI library ( http://developer.mbed.org/users/Sissors/code/BurstSPI/ ) is a lot faster and was written for this very reason but doesn't list your CPU as one of the supported ones.

However I suspect that all the NXP parts are very similar so it may not be too hard to add, it could be as simple as changing BurstSPI_LPC_X.cpp within that library to include the 11U68 in the list of allowed parts.

If that doesn't work and it's beyond your abilities to make the changes you could always try asking Erik very nicely if he has time to add support ;-)

Accepted Answer

I tested the Burst SPI library (by adding the definition for 11U68) and it is much faster. Now the time between the bytes are shorter(0,16us) than it takes to send one byte (0,62us).

posted by Johan Hedlund 18 Feb 2015