SPI speed regression from rev. 31 to 32

16 Jan 2012

Hi, I noticed there's a speed regression in the SPI library. This happened between revisions 31 and 32. A small testbench program is here: http://mbed.org/users/allanw/programs/speedregression/m3xdeo

The loop frequency, tested on the LPC1768:

At SPI freq 24 MHz:
r31: 635.8 kHz
r32: 581.4 kHz

At SPI freq 16 MHz:
r31: 536 kHz
r32: 500 kHz
r35: 500 kHz

At SPI freq 4 MHz:
r31: 300.9 kHz
r32: 294.1 kHz

At SPI freq 1 MHz:
r31: 107.5kHz
r32: 107.8kHz
24 Jan 2012

Hi Allan, thank you for reporting this problem.

There was a rounding error in the code setting the SPI clock divider. Fixed in [Rev 36].

Cheers, Emilio