free-pdk / easy-pdk-programmer-software

Easy PDK programmer for PADAUK microcontroller
https://free-pdk.github.io/
GNU General Public License v3.0
111 stars 37 forks source link

stm32f072 vs stm32f103 #49

Closed GnuReligion closed 3 years ago

GnuReligion commented 4 years ago

Apologies, as this may not be the form to discuss such things ... but I want to build one of these programmers.

Can see the stm32f072 is the target MCU.

I already have an ample supply of stm32f103c8t6 MCUs on hand.

Would it be too much trouble to try to compile the firmware to target the f103?

cnlohr commented 4 years ago

Ooorrrr the stm32f042! I've been toying with porting to that for a while now, along with some other quality-of-life design simplifications :-p. But, I would be curious if the project ever gets abstracted a little more.

cpldcpu commented 4 years ago

Does the stm32f042 have DACs? That has usually been the limiting factor.

freepdk commented 4 years ago

Hi,

I used only HAL functions, so porting the solution should be a very straight forward task. Have a look at the STM32 CUBE (.ioc) project in firmware folder.

Your target processor needs to have 2 DACs, USB and at least 16 kB RAM.

STM32F10x does not have DACs

STM32F042 does not have enough RAM (so a simple port will not work, you would have to create a different solution without buffering the data to write/read inside of IC)

STM32F071 is possible (should work without modifications, and is almost same price as STM32F042 !) STM32F078 is possible STM32F091 is possible STM32F098 is possible STM32G071 is possible STM32G081 is possible STM32F3 is possible STM32L4 is possible STM32L4+ is possible STM32F4 is possible STM32G4 is possible STM32L5 is possible STM32F7 is possible

cnlohr commented 4 years ago

I've done a few software-defined switchmode power supplies, two on the STM32F042, and it's really good at it. So, my thought with the 042 would be you just have it control the power supply for the VDD/VPP rails, and nix all the other hardware on the board to support the supply rail control with the opamp. I am actually in the process of making a dingus which has the guts to create the signals for the Padauk parts, but haven't thought about software yet.

cpldcpu commented 4 years ago

It should be possible to adapt the programmer to use a PWM output instead of the DAC. In that case, the opamps could be used to low-pass filter the signal as well, for example with a sallen-key topology. Calibration would be needed as well, but there is already a voltage feedback to the ADC.

cnlohr commented 4 years ago

I was thinking of something along these lines:

image

Without precision components, calibration would be needed, but, 1% resistors, and using a decent LDO on the '042 and it's likely to be well within the "good enough" range.

P.S. I really wanted to also monitor power consumption on the Padauk parts.

EDIT: Full disclosure: I've never done a software-defined Zeta converter. I look forward to it :).

cpldcpu commented 4 years ago

eh.. ok :) You certainly have a specific goal here. Also doesn't look like low cost components with the instrumentation amp. Some of the Padauks are a bit picky regarding programming voltages, so you may have to tweak a lot if you have no voltage buffer.

cnlohr commented 4 years ago

I mean it's a $0.25 INA, and it's only on the VDD line. All the other components add to about $0.13.

This is really good information to know that they are picky -- do you have any handle on how picky? Is +/- 0.1v acceptable? Or unacceptable?

EDIT: I would be willing to consider a hybrid design - but - I was also hoping to have the variable voltage/current PSU available for other testing.

cpldcpu commented 4 years ago

I wasn't too serious about this the cost. The programmer is based on lots of parts from lesser known companies, though.

Regarding the voltages, I can't find the specific discussion right now, but there was a bit of voltage parameter tweaking during the lastest firmware update. It's nothing that can't be done, though. +-0.1V should be acceptable.

cnlohr commented 4 years ago

Neat. I'm so glad for all the work you guys do. It definitely makes the other more esoteric applications easier. If this works out I'll definitely be posting about it.

freepdk commented 3 years ago

Closing this one. In case you want to continue discussion, please consider to open new issue in "easy-pdk-programmer-hardware" project.

kimstik commented 1 year ago

Hi,

I used only HAL functions, so porting the solution should be a very straight forward task. Have a look at the STM32 CUBE (.ioc) project in firmware folder.

Your target processor needs to have 2 DACs, USB and at least 16 kB RAM.

STM32F10x does not have DACs

STM32F042 does not have enough RAM (so a simple port will not work, you would have to create a different solution without buffering the data to write/read inside of IC)

STM32F071 is possible (should work without modifications, and is almost same price as STM32F042 !) STM32F078 is possible STM32F091 is possible STM32F098 is possible STM32G071 is possible STM32G081 is possible STM32F3 is possible STM32L4 is possible STM32L4+ is possible STM32F4 is possible STM32G4 is possible STM32L5 is possible STM32F7 is possible

accidentally noticed that fresh BL808 has 2 dacs: https://github.com/bouffalolab/bl_docs/blob/main/BL808_RM/en/BL808_RM_en_1.2.pdf

don't take it seriously (pwm, PDM modulator or just modulated stream via I2S/SPI/UART will do the job better)