-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HX1230 to use AVR hardware SPI (9-bit messages over 8-bit SPI subsystem) #1041
Comments
Some comments how it works. |
Thanks for the code. |
I think we can fill the incomplete buffer with 0 bytes. This is the set column lo command, which will not harm the functionality. command list: #469 |
The 0 value can also be used for SSD1306 |
ToDo: Update codebuild |
Technically, no need to fill the buffer with zeros. The only issue produced by sending 9-bit words via 8-bit subsystem is that the last sent byte in common case contains a tail of the last 9-bit-word and 1 to 8 bits of trash. But it is ok; we will raise CS and thus abort sending and this trash will be ignored by receiving controller. |
I have tested the new code with a SSD1306 display:
3W HW SPI is probably 20% faster than SW SPI. so... I think it works as expected. Thanks for the issue and the related code :-) |
HX1230 is by default configured to use 3-wire SPI (no d/c pin) and accepts 9-bit messages. AVR microcontrollers cannot do it via their hardware SPI as it is limited to 8-bit messages only. One of possible solutions is send 9-bit messages through 8-bit SPI subsystem.
Attached is an example how to do it for u8x8 and u8g2. It works about 12-14ms faster than software SPI implementation (measured on Atmega32u4, 8mHz).
helloworld.zip
The text was updated successfully, but these errors were encountered: