kanflo / opendps

Give your DPS5005 the upgrade it deserves
MIT License
895 stars 124 forks source link

CLI mode HOW TO documentation #209

Open yashmulgaonkar opened 4 years ago

yashmulgaonkar commented 4 years ago

In the file dps-model.h you mention: you can see real ADC value in CLI mode's stat:

Is the documentation on how to use it available anywhere specifically for this firmware?

yashmulgaonkar commented 4 years ago

@kanflo I am happy to tune the parameters for the DPS8005 and send in a PR once I know how to do the above...

Xenoamor commented 4 years ago

I assume this is referring to the dpsctrl -cr command. Or maybe dpsctrl --screen settings and then dpsctrl -q

yashmulgaonkar commented 4 years ago

The line I'm referring to is this one: https://github.com/kanflo/opendps/blob/c1a8ab69d97ee3a329a2283ec88c49150537978c/opendps/dps-model.h#L18

Does the command you shared show the raw ADC values? I'm trying to tune the constants for a DPS8005.

Xenoamor commented 4 years ago

Yes, the calibration screen does. I'm away at the moment but I believe you press both the up and down arrow at the same time to get there (it's intentionally awkward)

yashmulgaonkar commented 4 years ago

Oh that was easier than I thought! Is there any documentation for this? If not, I'm happy to contribute to a github.io page

kanflo commented 4 years ago

Weeeell, the documentation has somewhat fallen behind. Some of the information from my old blog posts are stil valid and some is obsolete. Recompiling them into a GitHub.io page has been on the todo list for quite some time. As always, contributions are welcome ;)

yashmulgaonkar commented 4 years ago

Can you share how you execute the following? over openocd console: mww 0x40007408 77

as mentioned here: https://github.com/kanflo/opendps/blob/c1a8ab69d97ee3a329a2283ec88c49150537978c/opendps/dps-model.h#L34

Do we need the FTDI connected for this? Or just open an openocd console in one window and in another terminal type the above command?

Does the DPS need to be in any particular state for this to work?

I tried the following:

  1. Run openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg in one terminal
  2. in new terminal, open telnet connection with telnet localhost 4444
  3. In telnet session, type mww 0x40007408 77

But the output never changes - its always = Vin. So I'm clearly missing something.

Next, I also tried:

  1. manually changing the values of Vout adc on the DPS calibration menu
  2. running ocd-client.py dac
  3. The value of DHR12R1 and DHR12L1 change accordingly, but Vout remains = Vin
kanflo commented 4 years ago

It seems you found the correct way to execute the openpcd commands. It is strange you don't see any difference when changing 0x40007408. Can you try changing output value in the UI and see what happens to that, and other registers?