Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect initialisation of DICOEFF register #64

Open
Trickx opened this issue Sep 12, 2017 · 0 comments
Open

Incorrect initialisation of DICOEFF register #64

Trickx opened this issue Sep 12, 2017 · 0 comments

Comments

@Trickx
Copy link
Contributor

Trickx commented Sep 12, 2017

I don't know whether this relevant for the SmartPi to function,
but the register DICOEFF is not initialised properly:

current code:

// 0x43B5 (DICOEFF-REGISTER)
err = WriteRegister(d, "DICOEFF", 0xFF, 0x80, 0x00)
if err != nil {
	panic(err)
}

Data sheet:
... The DICOEFF 24-bit signed register is used in the digital integrator algorithm. At power-up or after a reset, its value is 0x000000. Before turning on the integrator, this register must be initialized with 0xFFF8000. As stated in the Current Waveform Gain Registers section, the serial ports of the ADE7878 work on 32-, 16-, or 8-bit words. Similar to the registers shown in Figure 35, the DICOEFF 24-bit signed register is accessed as a 32-bit register with four MSBs padded with 0s and sign extended to 28 bits, which practically means it is transmitted equal to 0xFFF8000...

proposed code:

// 0x43B5 (DICOEFF-REGISTER)
err = WriteRegister(d, "DICOEFF", 0x0F, 0xFF, 0x80, 0x00)
if err != nil {
	panic(err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant