You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having experimented with SPI and being grateful for help on a previous issue in this respect, I would like to suggest:
Please consider implementing a native SPI buffer transfer function for Microbit avoiding some of the overheads of the existing spiTransfer() method which simply repeatedly calls spiWrite() byte per byte. My assumption is that many of the overheads involve repeated checks of the configuration of the SPI pins and other house-keeping functions which, for a continuous transfer of bytes from a buffer, could be avoided.
For unidirectional transfer from a Microbit - let's say to an LCD or OLED screen other device which requires the transfer of a data buffer of considerable size - a call to spiTransfer() can result in an overall data transfer rate equivalent to less than 1Mbit/second even with an SPI clock frequency of 4MHz.
I experimented with an assembler routine to deliver a buffer by a software implementation using a clock pin and a data out pin and this was able to deliver an average continuous bit-rate of upto 1.3Mbit/s: for a byte buffer of 504 bytes I found it taking only 65% of the time taken by the current spiTransfer() method with the SPI clock speed set to 4MHz, which indicates a considerable dead-time between each byte transfer.
For SPI transfers which do not need to monitor return data at the input buffer, a faster native buffer method would be most welcome.
The text was updated successfully, but these errors were encountered:
Having experimented with SPI and being grateful for help on a previous issue in this respect, I would like to suggest:
Please consider implementing a native SPI buffer transfer function for Microbit avoiding some of the overheads of the existing spiTransfer() method which simply repeatedly calls spiWrite() byte per byte. My assumption is that many of the overheads involve repeated checks of the configuration of the SPI pins and other house-keeping functions which, for a continuous transfer of bytes from a buffer, could be avoided.
For unidirectional transfer from a Microbit - let's say to an LCD or OLED screen other device which requires the transfer of a data buffer of considerable size - a call to spiTransfer() can result in an overall data transfer rate equivalent to less than 1Mbit/second even with an SPI clock frequency of 4MHz.
I experimented with an assembler routine to deliver a buffer by a software implementation using a clock pin and a data out pin and this was able to deliver an average continuous bit-rate of upto 1.3Mbit/s: for a byte buffer of 504 bytes I found it taking only 65% of the time taken by the current spiTransfer() method with the SPI clock speed set to 4MHz, which indicates a considerable dead-time between each byte transfer.
For SPI transfers which do not need to monitor return data at the input buffer, a faster native buffer method would be most welcome.
The text was updated successfully, but these errors were encountered: