P2 as switch mode power supply?

I have a few hundred of these 3.5" LCDs that are really nice, but need a triple power supply to work...
There are chips that can do this, like the MAX1779, but they add to the cost, BOM, and add board space...

It would be very convenient if I could use some P2 pins to do this.
I see this smartpin mode:
01010*  = PWM switch-mode power supply, V and I feedback

But, I have no idea how to use it or what is possible...

Any chance I could use P2 pins to replace MAX1779?

Comments

  • RaymanRayman Posts: 10,077
    edited 2019-12-09 - 15:03:13
    Here's what the circuit looks like (attached) and the datasheet for LCD.

    The circuit also shows the vcom driver on the right side.
    It's more or less just an opamp. Would be nice if P2 could replace that as well...

    LCD needs +5V, +18V and -9V. Also need -5V for VCOM driver...
    1542 x 1085 - 31K
  • samuellsamuell Posts: 530
    edited 2019-12-09 - 15:28:50
    As a buck converter, yes. But implementing regulation would be complicated. And, still dangerous to the supplied components if the P2 freezes, IMHO.

    However, you are requiring boost conversion. You should add the MAX1779, definitely. Boost conversion cannot be done via a simple PWM. Yes, boost uses pulses, but in a completely different fashion than buck (e. g. , to pulse or not to pulse, instead of a continuous pulse with variable PWM).

    Kind regards, Samuel Lourenço
  • Rayman wrote: »
    Here's what the circuit looks like (attached) and the datasheet for LCD.

    The circuit also shows the vcom driver on the right side.
    It's more or less just an opamp. Would be nice if P2 could replace that as well...

    LCD needs +5V, +18V and -9V. Also need -5V for VCOM driver...

    Boy do I get a strange result when I click on the PDF document in this post. Instead of opening a document I end up in one of my P2 folders. Really weird.
    1920 x 1080 - 168K
  • works for me... even on my phone...
  • Shut down Firefox and restarted it. Same result.
    Shut down laptop and restarted it. Same result.
    Checked link and it looks correct. https://forums.parallax.com/discussion/download/128078/LTV350QV.pdf

    Truly strange. Time to run malware scans and diagnostics. After I try another browser.
  • Tried Google Chrome and the PDF downloaded and opened as expected. Tried Firefox on the original link and the one I entered in my previous post. Both ended up in the P2 folder. Tried several other uploads in other posts and they worked just fine. Seems like Firefox just does not like that particular link. Who says there is no such critters as gremlins?
  • Kwinn, this is so off topic, but firefox does not ask where to put the downloaded file like internet explorer, and by default it goes into the downloads folder.

    In your frustration, you probably changed the default download folder to whatever P2 folder.

    Also firefox has settings about what to do with pdf files (and many others) . It can use the internal viewer, download to the default download folder (as it's doing), or send it to a third party plugin like Adobe as long as it was installed correctly.
  • The server hosting the file also has a say in whether the browser will try to open the document or save it to a file. It's really strange.
  • kwinnkwinn Posts: 8,446
    edited 2019-12-09 - 21:49:05
    whicker wrote: »
    Kwinn, this is so off topic, but firefox does not ask where to put the downloaded file like internet explorer, and by default it goes into the downloads folder.

    In your frustration, you probably changed the default download folder to whatever P2 folder.

    Also firefox has settings about what to do with pdf files (and many others) . It can use the internal viewer, download to the default download folder (as it's doing), or send it to a third party plugin like Adobe as long as it was installed correctly.

    I think you are correct in that it is a Firefox thing. Caught me by surprise because up until this morning Firefox always asked if I wanted to open the file or download it. I am running Linux Mint and have not made any changes to settings or updates to my system for at least a couple of weeks. Have to check my settings and updates.

    @whicker, you are partly correct. Firefox preference was changed to download files to "Downoads". That may have been done during my last Firefox update a couple of weeks ago, however that does not explain why it was placing the file in my P2 folder as seen in the screen shot I posted earlier.

    @Rayman, sorry for hijacking your thread, but I thought the problem might be related to something in this particular thread.
  • jmgjmg Posts: 14,184
    Rayman wrote: »
    ..
    I see this smartpin mode:
    01010*  = PWM switch-mode power supply, V and I feedback
    
    Chip does need to expand examples on these modes.

    Rayman wrote: »
    LCD needs +5V, +18V and -9V. Also need -5V for VCOM driver...
    What currents on these ?

    P2 can do the thinking side of PWM, but does not have super-fine granularity.
    eg a 250MHz Sysclk will give 1MHz PWM duty ~ 8 bits and 500kHz PWM duty ~ 9 bits.
    That's ~25mV steps at 80% full scale, which is probably ok for a digital supply ?

    The 3v3 IO is a bit light to drive highest power MOSFETS, but it may be Ok for small boost converters.

    eg DMN3731UFB4-7B specs 560 mΩ at 2.5V VGS
    DMG2301L-7 specs 150mΩ @ VGS = -2.5V, so could do -ve supply flyback

    Getting rapid feedback will need SW in P2, and ADCs are not very fast, so step response may not be very good.
    It may be simplest to include clamp zeners, to give first-response over-voltage protection, then P2 needs to regulate for average loads.

    That discrete approach needs to be compared with the simpler SMPS parts, and a 500mA part like AP3012KTR-G1 is 20c
    - that has protection/regulation and mosfets all included.


  • I am doing both buck and boost with a PIC16LF1779.

    During P2 development I asked Chip to have built-in comparators with DAC presetable levels and comparator's output on output pins for exactly this reason: control and shutdown power electronics (igbt/mosfets) in SMPS and similar environments
  • Chip posted a hand drawn sketch somewhere of how he envisaged the power control mode being hooked up.

    It'd be good to make up this circuit, perhaps it could plug into the P2ES as a demo, and be scaled from there
  • cgraceycgracey Posts: 12,226
    edited 2019-12-10 - 11:23:27
    dMajo wrote: »
    I am doing both buck and boost with a PIC16LF1779.

    During P2 development I asked Chip to have built-in comparators with DAC presetable levels and comparator's output on output pins for exactly this reason: control and shutdown power electronics (igbt/mosfets) in SMPS and similar environments

    Yes, those SMPS smart pin modes are intended to use the internal 8-bit DACs and level comparators as voltage and current feedback mechanisms. Voltage detection may be via a resistor divider tap and current detection through a GND-side shunt resistor.

    For safety, I would capacitively couple the NFET gate drive with a weak gate-side pull-down, in case the music stopped.
  • jmgjmg Posts: 14,184
    dMajo wrote: »
    ...
    During P2 development I asked Chip to have built-in comparators with DAC presetable levels and comparator's output on output pins for exactly this reason: control and shutdown power electronics (igbt/mosfets) in SMPS and similar environments
    Tubular wrote: »
    Chip posted a hand drawn sketch somewhere of how he envisaged the power control mode being hooked up.
    It'd be good to make up this circuit, perhaps it could plug into the P2ES as a demo, and be scaled from there

    Very good idea.
    Has this part of P2 even been tested yet ?
    I think there are both hysteretic and PWM modes possible for P2-SMPS ?

  • I didn't find the hand drawn diagram, but Chip describes it here:-
    https://forums.parallax.com/discussion/comment/1362413/#Comment_1362413
Sign In or Register to comment.