Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Extend "adjust settings" function #75

Closed
4 tasks done
LeilaPiri opened this issue Mar 25, 2020 · 8 comments
Closed
4 tasks done

Extend "adjust settings" function #75

LeilaPiri opened this issue Mar 25, 2020 · 8 comments

Comments

@LeilaPiri
Copy link

LeilaPiri commented Mar 25, 2020

  • The rPi sends a configuration/settings to the SAM
  • js<{„SetSecondary“ : ..,
    „Gain“ : ..,
    „DAC1.raw“ : ..,
    „DAC2.raw“ : ..,
    „DAC3.raw“ : ..,
    „DAC4.raw“ : ..,
    „Voltage“ : ..,
    „Current“ : ..,
    „MaxCurrent“ : ..,
    „DACsw“ : ..
    }
  • Voltage, Current and MaxCurrent option have to be added.

Definition of Done

  • code for mentioned task is complete. examples & documentations are complete.

  • build chains are tested

  • corresponding branch is closed

  • merging is done

@begodev
Copy link
Collaborator

begodev commented Apr 10, 2020

„Voltage“ : ..,
„Current“ : ..,
„MaxCurrent“ : ..,

what should these parameters manage?

@pmalessa
Copy link
Collaborator

Current and MaxCurrent Setting will be added on future boards. This can be just added to the SPI Protocol without function.
Voltage is the Output Voltage, which can be set via QSPI and Chip Select CS1 on the Max5715 chip.

@pmalessa
Copy link
Collaborator

These are changes, which are relevant for production firmware, not only the calibration firmware

@begodev begodev added In progress Checked code works as needed In Review and removed In progress labels Apr 20, 2020
@pmalessa
Copy link
Collaborator

Code checked, looks okay for me

@pmalessa
Copy link
Collaborator

pmalessa commented Apr 27, 2020

Checked the voltage setting with the SPI terminal:
image
The output needs to be rounded to XX.XX, so 2 digits after decimal point. If I set 10.01, I want to receive 10.01 in the response. If I set 10.025, I want to receive 10.03 in the response. If I set 10, response has to be 10.00.

@begodev
Copy link
Collaborator

begodev commented Apr 29, 2020

What I found is an nlohmann/json#677:

Is there a way to control the precision of serialized floating point numbers?

nlohman:

There is no parameter for this, and I doubt that adding one would be beneficial for a lot of users.
What you could do is to edit function dump_float()

It is a recomendation from nlohman.

It seems that some JSON engine fixes are required...

@begodev begodev added enhancement and removed Checked code works as needed labels Apr 30, 2020
@begodev
Copy link
Collaborator

begodev commented Apr 30, 2020

NLOHMAN JSON has been patched with std::sprintf.
It doesn't look really nice, but...
Atm is the fastest solution.
branch Issue_75, firmware flashed @10.0.0.8

@pmalessa
Copy link
Collaborator

pmalessa commented May 7, 2020

review done, works great :)

@pmalessa pmalessa closed this as completed May 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants