OLED Arduino
GND GND
VCC VCC
D0 15
D1 16
RES RESET
DC 9
CS 10
Did I hook it up correctly?
Can I effectively make this a 6-pin SPI? I've read that I may be able to tie one of the pins to ground. I'm out of pins and getting one back would be helpful.
Most of the time when it starts up, I get white snow/noise. I read something about a reset procedure? If I move the RES pin from RESET to VCC, it starts up successfully more often, but still not 100%. What might I be doing wrong?
The 32U4 runs at 16MHz. What is the fastest SPI I can use? By default, the SSD1306AsciiSpi.h runs at 8MHz. Can I use 16MHz successfully?
Anyone used the OPTIMIZE_AVR_SPI flag? It looks like it runs at 8MHz, but I don't know if it's better or not.
Instead of DC at pin 9, can I use the MISO pin of 14? (It'd make PCB layout a bit easier.)
Long story short: I had used the I2C variants of this display, and it introduced hella noise into my audio. When I hooked up the SPI variant this weekend, the noise was greatly reduced, but it still existed. A friend said running the SPI higher could help even further.
I have no idea. What do your pin numbers mean? What Port Pins do they use?
Can I effectively make this a 6-pin SPI? I've read that I may be able to tie one of the pins to ground. I'm out of pins and getting one back would be helpful.
SPI uses 4 pins. DC and RES are extra.
These controllers are generally write-only. If you do want to read registers or GRAM, the SDA (DI) pin is bi-directional.
The AVR SPI peripheral can not use bi-directional.
Most of the time when it starts up, I get white snow/noise. I read something about a reset procedure? If I move the RES pin from RESET to VCC, it starts up successfully more often, but still not 100%. What might I be doing wrong?
I have not looked at your library or constructor.
Constructors often have an optional RES argument. Examples often omit it. Ignore it at your peril.
The 32U4 runs at 16MHz. What is the fastest SPI I can use? By default, the SSD1306AsciiSpi.h runs at 8MHz. Can I use 16MHz successfully?
The maximum SCK frequency is 8MHz. The SPI peripheral has gaps. The USART_MSPI can do gapless transmission. Your library probably does not support USART_MSPI. (and a Mega2560 has been carefully designed to have 4 USARTs and no XCK pins)
Anyone used the OPTIMIZE_AVR_SPI flag? It looks like it runs at 8MHz, but I don't know if it's better or not.
No idea. Read your docs.
Instead of DC at pin 9, can I use the MISO pin of 14? (It'd make PCB layout a bit easier.)
It would stop every other device on the SPI bus. If your OLED is the only SPI device, this does not matter.
I think I set it up correctly. I mean, I get it to work.
I was able to successfully test to see that tying CS to LOW seems to work.
Regarding the reset pin, I read somewhere about using a cap to help? Do you know anything about that? (Obviously using a real RESET pin helps tremendously, but I am almost out of pins.)
Kind of a bummer about 8MHz being the max, but I can live with that. I think using something like ferrite beads or something may help get the remaining noise out of my audio.
I'm going to scrap this question for now. It's not a big deal.
I don't have any other SPI devices. Everything else is I2C (FRAM, expander, LED driver).
A note on #6, I was unable to use the hardware SPI with this pin. I think I found extra reading about the way the SPI.h library takes control of the MISO pin. However, using the Software SPI variant of this library, it was able to work.
Follow up question: If I don't plan on doing super fast screen updates, is there a downside to using the software SPI?