AnsweredAssumed Answered

Cortex peripheral register access slow?

Question asked by CL on Nov 2, 2011
Latest reply on Nov 2, 2011 by Clive One

I am new to cortex, upgrading a 8051 project to cortex for improved performance. One of the things I'm testing now is SPI. Not via DMA, but simple writing to SPI->DR, wait until byte out and then sending next byte. It works but is very slow. On the oscilloscope I see that writing to the SPI DR takes about 380ns, CPU is F100RB at 24MHZ, prepheral clocks max (I hope). This is very slow, knowing that clocking out the byte itself only takes about 630ns.
Checking if the SPI is not busy and then writing the next byte to SPI DR takes 900ns!!! So far this cortex is much slower than my 8051, very frustrating. Is it not possible to access the peripheral registers in a faster way? I know there are faster techniques (like using DMA), but many projects have a simple function like spi_write(), and in that case it's so slow. This topic is not particular about SPI, but why the peripheral accesss is so slow and if there are trics to make it fast? Cortex being fast, is a hoax so far... hopefully I'm doing something wrong here...