I have a 5v arduino that connects to a 3v3 lcd display (st7565r controller). To communicate over SPI, i need to use a voltage divider to lower the volts for both VDD and signal lines (A0, SI, CLK and RST). I need a 1:2 scale for resistors to get 3v3
What resistor range do i need to use?
100ohm and 200ohm
1k / 2k
-100k / 200k
If somebody could explain why sometimes i see high abd sometimes low, that would be cool.
For the divider:
Vout = Vin * R2/(R1 + R2) R1 connects to Vin, R2 connects to Gnd, their junction is Vout
Vin = 5V, Vout = 3.3, R2 = 5000, solve for R1 -> 2500
Could go lower; keep 5V/(R1 +R2) < 0.01A (10mA)
So 1K/2K, 500/1000 at the lowest
Don't go to high, current available for the display becomes too low.
For converting 5 V to 3.3 V on signal lines that have high impedance (like Arduino inputs) you can use resistors in the range of 100K to 330K. That results in lower power consumption of the overall circuit. Resistors that large will slow the response time for very fast signals (100 KHz or higher) but for lower frequencies, like signals to a display, you should be OK.
jremington:
For converting 5 V to 3.3 V on signal lines that have high impedance (like Arduino inputs) you can use resistors in the range of 100K to 330K. That results in lower power consumption of the overall circuit. Resistors that large will slow the response time for very fast signals (100 KHz or higher) but for lower frequencies, like signals to a display, you should be OK.
SPI from an Arduino can run at 8MHz, use 1k and 2k2, nothing larger or you'll compromise
the edges. 8MHz is slow enough for an SPI graphics display BTW!
[logic signals have to have fast edges or the next gate can malfunction, particularly important
for clock signals like SCLK - otherwise a schmitt-trigger may be needed]