|
|||||||||||
Technical Support Support Resources
Product Information |
C51: Optimum Code for Bit-to-Byte ConversionInformation in this article applies to:
QUESTIONI have a very time-critical routine that accesses an SPI Bus. It needs to shift in 8 bits from one single pin to a register. Usually, this would be done in a loop, but I must optimize it to consume minimum time. The construction below works OK, but still does not give me the performance that I would like to have. Is there a better way to code this?
ANSWERYes. You may use bdata variables (or in this case even misuse the SFR register B to reduce the data overhead. The following code will give you the optimum performance:
MORE INFORMATION
SEE ALSOLast Reviewed: Thursday, February 25, 2021 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.