opendps icon indicating copy to clipboard operation
opendps copied to clipboard

CLI mode HOW TO documentation

Open yashmulgaonkar opened this issue 6 years ago • 8 comments

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 avatar Dec 11 '19 02:12 yashmulgaonkar

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

yashmulgaonkar avatar Dec 11 '19 03:12 yashmulgaonkar

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

Xenoamor avatar Dec 11 '19 10:12 Xenoamor

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.

yashmulgaonkar avatar Dec 11 '19 17:12 yashmulgaonkar

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)

Xenoamor avatar Dec 11 '19 17:12 Xenoamor

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

yashmulgaonkar avatar Dec 11 '19 17:12 yashmulgaonkar

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 ;)

kanflo avatar Dec 11 '19 19:12 kanflo

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

yashmulgaonkar avatar Dec 11 '19 21:12 yashmulgaonkar

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?

kanflo avatar Dec 16 '19 21:12 kanflo