• AVR Freaks

Hot!Voltage divider question

Page: 12 > Showing page 1 of 2
Author
vero
Starting Member
  • Total Posts : 69
  • Reward points : 0
  • Joined: 2018/09/08 15:09:26
  • Location: 0
  • Status: offline
2019/02/12 22:23:17 (permalink)
0

Voltage divider question

I am using the SPI of a PIC16F874A to send data to a SRAM 23K640. The SRAM requires a 3.3V VCC source. I have set up the circuit to deliver 3.3V to the SRAM pins using the voltage divider method. For some reason when I change the value on RB1, used as CS to the SRAM, the 3.3V I am sending to the VCC of the SRAM changes with RB1. I have checked for a short that may be causing this problem and there is not a short. Is there something wrong with how I did the voltage divider? I would appreciate any help or feedback on this problem. Thanks in advance. I attached the schematic below of how I connected the PIC16F874A to the SRAM 23K640.

Attached Image(s)

#1

23 Replies Related Threads

    qhb
    Superb Member
    • Total Posts : 9998
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Voltage divider question 2019/02/12 22:53:48 (permalink)
    +2 (2)
    A voltage divider is a very poor way to generate a supply rail.
    You only get the calculated voltage when you draw ZERO current from the middle node.
    It would work a bit better if you reduced both resistors by a factor of 10.
    i.e. 10k // 20k -> 1k // 2k
    You also MUST have a bypass capacitor between Vdd and Vss on the SRAM chip.
     
    Is the schematic accurate? It appears to show 3v3 connected directly to the SRAM's SI and SO pins.
     

    Nearly there...
    #2
    vero
    Starting Member
    • Total Posts : 69
    • Reward points : 0
    • Joined: 2018/09/08 15:09:26
    • Location: 0
    • Status: offline
    Re: Voltage divider question 2019/02/12 23:06:27 (permalink)
    0
    I used the voltage divider on those lines also, but they are not connected in the same place as the voltage divider from VDD. I think I should have named each 3.3V label differently. I have a voltage divider on all the pins going from the PIC to the SRAM.
    #3
    PStechPaul
    Super Member
    • Total Posts : 2264
    • Reward points : 0
    • Joined: 2006/06/27 16:11:32
    • Location: Cockeysville, MD, USA
    • Status: offline
    Re: Voltage divider question 2019/02/12 23:11:48 (permalink)
    +1 (1)
    I agree with qhb. Perhaps better to use a 3.3V LDO for the low voltage supply, and a level shifter for the control signals. Here is a bidirectional level shifter that should work:
     
    https://www.adafruit.com/product/757
     
    General info:
     
    http://www.ti.com/logic-circuit/voltage-level-translation/overview.html
     
    Microchip LDOs:
     
    https://www.microchip.com...rt.aspx?branchID=90004

     
    #4
    vero
    Starting Member
    • Total Posts : 69
    • Reward points : 0
    • Joined: 2018/09/08 15:09:26
    • Location: 0
    • Status: offline
    Re: Voltage divider question 2019/02/12 23:25:49 (permalink)
    0
    Thank you for your help. I will try one of these options and update you on the results.
    #5
    OscarTheGrouch
    Super Member
    • Total Posts : 299
    • Reward points : 0
    • Joined: 2010/11/29 18:07:28
    • Location: 0
    • Status: offline
    Re: Voltage divider question 2019/02/12 23:27:56 (permalink)
    0
    QHB is correct about a voltage divider being a poor way to supply rail voltage. A the very least you should be using a zener diode to make the 3.3V DC.
     
    The pins sending signals TO the SRAM should be a voltage divider and don't need the 3.3V supply. They should be just a voltage divider with the output pin of the PIC16F874A going first to a 1K then 2K to ground. The junction of the 1K and 2K goes to the SRAM input. Outputs from the SRAM that are 3.3V logic can usually go directly into a 5V logic device input and work correctly.
     
    Example:
    RB1 ---- 1K ---|----> CS
                           2K
                            |
                          GND
    #6
    vero
    Starting Member
    • Total Posts : 69
    • Reward points : 0
    • Joined: 2018/09/08 15:09:26
    • Location: 0
    • Status: offline
    Re: Voltage divider question 2019/02/13 12:37:26 (permalink)
    0
    How should I place the zener diode into the circuit? Would the zener diode replace one of the resistors?
    #7
    qhb
    Superb Member
    • Total Posts : 9998
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Voltage divider question 2019/02/13 12:39:13 (permalink)
    0
    Yes, the bottom resistor, so the zener is connected between Vss and 3V3.
    And don't forget the bypass capacitor!
     

    Nearly there...
    #8
    1and0
    Access is Denied
    • Total Posts : 9252
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: Voltage divider question 2019/02/13 13:05:45 (permalink)
    +1 (1)
    As Qhb said, and with the anode side of the zener to Vss.
    #9
    vero
    Starting Member
    • Total Posts : 69
    • Reward points : 0
    • Joined: 2018/09/08 15:09:26
    • Location: 0
    • Status: offline
    Re: Voltage divider question 2019/02/13 21:41:48 (permalink)
    0
    What is a good value for the bypass capacitor?
    #10
    qhb
    Superb Member
    • Total Posts : 9998
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Voltage divider question 2019/02/13 21:48:22 (permalink)
    +1 (1)
    Traditionally 100nF ceramic or monolithic.
    Can be 1uF if you can get it in the same low ESR package.
     

    Nearly there...
    #11
    OscarTheGrouch
    Super Member
    • Total Posts : 299
    • Reward points : 0
    • Joined: 2010/11/29 18:07:28
    • Location: 0
    • Status: offline
    Re: Voltage divider question 2019/02/13 22:04:46 (permalink)
    0
    Another way would be just to use three signal diodes in series. They would drop about 1.8V and give you 3.2V for your SRAM IC. 1n914s should work because you don't need much current just to power the SRAM IC.
    #12
    OscarTheGrouch
    Super Member
    • Total Posts : 299
    • Reward points : 0
    • Joined: 2010/11/29 18:07:28
    • Location: 0
    • Status: offline
    Re: Voltage divider question 2019/02/14 11:33:21 (permalink)
    0
    This should get you what you need .. I didn't have a symbol for the SRAM, but the one I used should give you the idea.
    post edited by OscarTheGrouch - 2019/02/14 12:58:20

    Attached Image(s)

    #13
    vero
    Starting Member
    • Total Posts : 69
    • Reward points : 0
    • Joined: 2018/09/08 15:09:26
    • Location: 0
    • Status: offline
    Re: Voltage divider question 2019/02/18 19:57:12 (permalink)
    0
    Thank you for all of your help. I used a zener diode for the 3V3 and a capacitor and now the 3V3 is stable. I also changed the resistor values to 1k and 2k.
    #14
    qhb
    Superb Member
    • Total Posts : 9998
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Voltage divider question 2019/02/18 21:11:59 (permalink)
    0
    If you're using the Zener diode, then it should be fitted INSTEAD of R2.
     

    Nearly there...
    #15
    vero
    Starting Member
    • Total Posts : 69
    • Reward points : 0
    • Joined: 2018/09/08 15:09:26
    • Location: 0
    • Status: offline
    Re: Voltage divider question 2019/02/18 21:49:13 (permalink)
    0
    Right. I used the zener diode in place of R2 and changed R1 to 27 ohms. I used the 1k and 2k for R3 and R4, R5 and R6, R7 and R8, R10 and R11.
    #16
    qhb
    Superb Member
    • Total Posts : 9998
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Voltage divider question 2019/02/18 21:55:31 (permalink)
    +1 (1)
    CVer2018
    Right. I used the zener diode in place of R2 and changed R1 to 27 ohms

    27 ohms seems a bit low.
    That means you'd always have at least 63mA flowing through that resistor, consuming 100mW.

    Nearly there...
    #17
    vero
    Starting Member
    • Total Posts : 69
    • Reward points : 0
    • Joined: 2018/09/08 15:09:26
    • Location: 0
    • Status: offline
    Re: Voltage divider question 2019/02/18 22:09:59 (permalink)
    0
    When I tried a higher resistance the voltage was under 3.3V.
    #18
    Mysil
    Super Member
    • Total Posts : 3324
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: Voltage divider question 2019/02/19 00:03:37 (permalink)
    +1 (1)
    Hi,
    A zener diode is not an ideal component, there is leak current and internal resistance,
    that vary with device size and type.
    Leak current may be something less than 10 uA in a small device in glass housing,
    to 300uA for a good quality 5W device, or much more for a low quality device.
     
    There exist voltage reference components with better performance than ordinary zeners,
     
        Mysil
    #19
    PStechPaul
    Super Member
    • Total Posts : 2264
    • Reward points : 0
    • Joined: 2006/06/27 16:11:32
    • Location: Cockeysville, MD, USA
    • Status: offline
    Re: Voltage divider question 2019/02/19 03:08:05 (permalink)
    +1 (1)
    A white LED makes a pretty good shunt voltage regulator, as well as a power-on indicator. But it may vary from 2.5 to 3.3 volts or so. A series silicon diode might give pretty close to 3.2-3.4 volts. But an LDO regulator as shown in the schematic above is probably the best choice.

     
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5