Thank you for your detailed explanation! The major issue that I am having is that it is extremely difficult to obtain an EasyPDK programmer. STM32F072C8T6(and some other parts) becomes out of stock on LCSC for a long time(it means no jlcpcb SMT assembly). Also I found that assemble this programmer is really hard for people that lacks SMT soldering experience.
Hi,
did anybody investigate how the LVR (low voltage reset) fuses for the PFS154 work?
I tried to manually set the fuse for example to 0x36E1, which should set the LVR to 4V. At least according to https://github.com/free-pdk/fppa-pdk-documentation/blob/master/Reserved_Area_Last_8_Words_Of_Codemem.txt.
But the PFS154 powers on right at about 2V and powers off again if I go below 2V. I do not disable the LVR in the MISC register, so I think it should not switch on fully before Vdd reaches about 4V.
I read back the fuse value with the read command and it was indeed set to 0x36E1 as expected.
Or do I misunderstand how the LVR function works?
Thanks.
the LVR value is not a fixed place in code memory on PFS154, you have to program a SFR instead. Original PDK initialization code uses a fixed position to get a value and sets the SFR based on this.
I defined the SFR register names and settings for PFS154 in pfs154.h (see dev branch: https://github.com/free-pdk/easy-pdk-programmer-software/blob/development/Examples/src/easypdk/pfs154.h )
Special Function Register (SFR) name is:
MISCLVR
1) Maybe the programmer could be designed in a way to piggybag on a bluepill? This would remove the need to source the controller and solder the USB port.
Alternatively one could switch to a more available, but slightly more expensive MCU, like the STM32F103. Does it have DFU mode? Another option: Switch to a low-cost 8051 based USB micro (WCH...). But porting the firmware will be painful...
2) There is a charge pump that generates -2.4V for the OPAMPs that control the programming voltages. This is needed to allow full voltage swing down to GND to be actually able to turn the supply voltages off. I have checked the AR358 (LM358 clone) datasheet and the output voltage swing goes down to 30mV. While this is not super-clean, pulling VPP and VDD to 30mV should be sufficient to disable the device to be programmed. SO maybe this part could be skipped and the OPAMP be connected to ground? JS, did you try this and it failed?
3) The step up converter comes with dual mosfet to disable power supply. The Step-up-converter itself has an enable pin that is tied tied to always active. Turning off the step-up converter using the enabled input would result in 5V on the 15V supply. However, the 15V supply is only used to feed the opamps. If using the opamps to pull VPP and VDD to ground, it would be acceptable for them to be supplied from 5V when the boost converter is inactive. I have to admit that this is not super robust, but it shold likely be fine as long as the MCU is controlling everything while the device to be programmed is connected. Thus, Q1, Q1, R7,C11,C19 could be removed? One may want to put in a filter to protect the rest of the circuit from noise, though.
I think the current solution is much cleaner, because it prevents any small power glitches and similar during turnon when the STM32 is still starting up. The way it is now, the Padauk only gets powered when the STM32 is fully controlling things.
I like the design of the programmer as it is now, as it does what it should without unnecessary bells and whistles. The footprints and lack of silkscreen sometimes make it harder to build than necessary though. There is some work being done porting the layout to Kicad right now, see github pull requests. I think this is a good starting point for optimizations in these areas.
Actually the reference voltage inputs of the OPAMP are pulled to GND by R4 and R9, so that the voltage at VDD and VPP of the device will always be GND, unless the STM32 is fully in control. I don't think power gating the boost-converter is necessary.
Btw, I noticed that JS has optimized the BOM of the EASYPDKprog for lowerst cost at LCSC.
JLPCB has a slightly different catalogue for part they allow to use for their assembly service. All parts in the "Basic" category do not require any addional set up cost. So, if it was possible to build the easypdkprog only from parts in the basic category, it could be ordered fully assembled at reasonable cost.
- remove negative opamp feed (diodes) - this might cause trouble during programing, but with all observations of already supported ICs an offset voltage on VDD to GND might be compensated with a higher programing voltage
(-2 diodes, -2 capacitors)
It would be more helpful to support adoption of new ICs and to create better introductions / walk throughs for beginners.
You saw Dave struggling when he tried his own "Hello World" (even that there are fully working and pre compiled examples including make files coming with the EasyPDK programmer software... He just overlooked this).
You can find the schematics below. I had to change quite a few parts. I simplified the supply a bit, as discussed above. The functionality should be exactly identical, including the not-yet-used ADC sense lines.
You can find the schematics below. I had to change quite a few parts. I simplified the supply a bit, as discussed above. The functionality should be exactly identical, including the not-yet-used ADC sense lines.You can get rid of another 4 resistors if you connect PB0 & PB1 to the opamp pin 2 & 6
But on the other hand I wonder what you would measure then?
This is basically dependent on opamp gain. So it would vary depending on temperature and part-to-part variation. It would only be a very indirect indicator of supply current.
But on the other hand I wonder what you would measure then?You measure exactly what you're measuring with the resistor dividers R14/15/16/17, just scaled differently.This is basically dependent on opamp gain. So it would vary depending on temperature and part-to-part variation. It would only be a very indirect indicator of supply current.Resistor dividers don't really suffer from temperature dependence. I'm not sure what this has to do with supply current.
In a real circuit you will measure a small delta, because the gain of the OPAMP is finite. The OPAMP gain however, depends on part-to-part variation, ambient temperature, and supply voltage in a non-predictable way. In addition we will also observe an influence of the opamp output impedance.
The thought experiment of simplifying the schematics just shows that the information to be gained from the sense input is to be treated with caution. You can surely detect a short condition, but any attempt of measuring more nuanced information needs to be scrutinized in respect to the deviation introduced by the opamp.
The opamp gain is so large w.r.t. the closed-loop gain that its variance doesn't matter. The input offset voltage would have more of an effect.
If you want to measure the VDD/VPP current consumption, keep R14/15/16/17 on the output of the opamp, but add a series resistor (10R should be OK) between there and the header pins; this resistor should be inside the feedback loop. I agree that the sense configuration as currently drawn is not very informative.
Ok, I had the audacity to create a preliminary "lite"-Version of the easypdkprogrammer, based on "Basic" components from the JLCPCB catalogues.
(Attachment Link)
You can find the schematics below. I had to change quite a few parts. I simplified the supply a bit, as discussed above. The functionality should be exactly identical, including the not-yet-used ADC sense lines.
The inductor, USB-port and headers have to be soldered manually. The XTAL is optional, but can still be populated. The switch is also optional. Two pins can be used instead to invoke the bootloader.
The MCU can be either populated by JLCPCB or manually.
Cost for populated PCBs without MCU is $16.95 for five, so $3.39 each. That includes the PCB, but no shipping. Cost with CPU is $26.8 for five, $5.36 a piece.
Let me know if you have additional input. I will most likely test this the next time I order at JLCPC, which could still be a while. If anybody else wants to try, i can share the design files.
p.s.: It seems that EasyEDA has updated all their libraries with slightly increased solder pad sizes. If you update the footprints, a lot of designrules in the easypdkprogrammer pcb are violated.