TinyScreen uses both Wire and SPI?

mike_ekim1024

  • Full Member
  • ***
    • Posts: 17
    • View Profile
Just curious why both?  SPI is fast and used for data, while it looks like Wire is used for commands?  Wire has multiple 32 byte buffers that are not even used and take precious memory, while SPI hardly uses any.

Any reason for using both protocols?  I can change the buffer sizes if need be, at least :)

Mike


Ben Rose

  • Administrator
  • Hero Member
  • *****
    • Posts: 357
    • View Profile
Missed this Mike. The OLED on TinyScreen uses SPI for data and commands, but the chip select and other control lines(along with the buttons) are attached to an I2C GPIO chip. This trades 7 I/O on the main controller for an I2C address, which allows TinyScreen to be compatible with all our other boards.

The Wire library has unnecessary overhead, but we want to cause as few software conflicts as possible- you can definitely change the buffers to be very small, 2 bytes should work without causing issues in the library logic, but I haven't tested that.


mike_ekim1024

  • Full Member
  • ***
    • Posts: 17
    • View Profile
The Wire library has unnecessary overhead, but we want to cause as few software conflicts as possible

Thanks for the response.  It does make sense to limit the number of pins used, and like you said I can make the I2C buffer very small.  It's always nice to understand the choices made, to have a little deeper knowledge.


 

SMF spam blocked by CleanTalk