# Calculation of the resistors values in a voltage divider

I'm working on a circuit where a 3.3v flash memory, which comunicate with SPI protocol, has to be interfaced to an 8-bit PIC microcontroller working at 5v. For the MISO signal there should not be any problem, but for MOSI, SCK and CS there are. So the solution i came across is a voltage divider. I've done this calculations but don't know if they are ok. _ First of all, i've calculated r1 in this way: (5-3.3)/0.001=1700 ohm _ Then i've resolved the equation Vout = Vin * (r2 / (r1+r2)) 3.3 = 5 * (r2/(1700+r2)) ...resolving the equation in order to find r2...

r2=3300 ohm. Is that correct? i have not any tester and i have just one flash memory. i don't want to fry it... Is the method i've used proper (first determinate r1 with the current and then find r2)? Thank you very very much. Greetings from Italy.

• Who knows what R1 is and what R2 is - you didn't show a circuit. This may seem trivial but it isn't. You should also link the data sheet for the flash memory and state what speed you hope to achieve. Commented Jun 13, 2020 at 12:40
• Which PIC model? Have you checked 3.3V is above logic 1 threshold? At what speeds you plan to communicate? Any capacitance (stray, pin) after the divider will round down the edges, and there is a limit how round edges the SPI flash works with. Basically, resistor divider can be used for low speed stuff, but it may have issues with high speed stuff. Commented Jun 13, 2020 at 12:47
• The microcontroller is a PIC18F46Q10. Commented Jun 13, 2020 at 13:25
• The flash is the SST25VF080B, the clock of sck is at 2 Mhz Commented Jun 13, 2020 at 13:26
• For the circuit take the CS line like an example: from the pin of the microcontroller, first there is R1, after that there is: _R2 which goes to 0v _and the CS of the flash Commented Jun 13, 2020 at 13:32