0
\$\begingroup\$

Hi I'm trying to read from the registers of the ACS71020 over SPI, but I can't seem to get any values other than 0. The only time I am able to get anything other than 0 on the MISO line, is on the address: 0x0C and the response has to do with some error code called "No meaning". I'm defaulting the CS line to high then setting it to 0 during the transaction (I think this is the correct way to do it because I haven't even gotten an error message using the opposite way where the default is "0" and then during transaction we set to "1". It literally feels like the chip does nothing in this scenario).

I've attached two images. The pink color is the sclk in both images. The blue color is MISO and the yellow color is MOSI. I am sending 7-bit address 0x20 with read bit (high) after. You can see that the blue (MISO) line gives me only 0 as response.

enter image description here

enter image description here

What could I be doing wrong here?

\$\endgroup\$
4
  • \$\begingroup\$ Judging by the timing diagrams on page 17 & 18 of the datasheet, it looks like it's expecting the LSB 1st. So in your example you're asking to read register address 0x02, not 0x20 - and there is no register 0x02 in the memory map on page 20. Similarly, your attempt to read 0x0C is probably being interpreted as 0x18 (which also doesn't exist). \$\endgroup\$
    – brhans
    Jul 24, 2020 at 0:37
  • \$\begingroup\$ Thanks for the response that's definitely resulting in values showing up now. Can you tell if the miso response is MSB first or LSB first? the timing diagram specifies MOSI but not MISO. \$\endgroup\$
    – John
    Jul 24, 2020 at 7:10
  • \$\begingroup\$ As SPI is usually implemented with a simple shift register, usually the first bit you send in will be the first to come out, so the assumption is that when LSB is sent first in, the data out will come out LSB first. Usually in MCUs the MOSI and MISO only have one setting for both, so different settings can't be selected. \$\endgroup\$
    – Justme
    Jul 24, 2020 at 7:31
  • \$\begingroup\$ I have Rsense = 4.7kOhms. I've set all offsets in the 0x0B register and the 0x0D register to 0 (I made sure I was in customer mode when I did this). When I check the register at 0x20 (the one that gives Vrms and Irms), I am seeing a raw value of Vrms = 450 (as uint16) and irms = 565 (uint16). When I hook up my load (120VAC and total power = 71W confirmed), I get Vrms = 670 and irms = 630. The values for V and i do increase, but they are clearly not increasing enough. I have literally no load hooked up and it's almost the same value as when I have a load hooked up. What could be the problem? \$\endgroup\$
    – John
    Jul 25, 2020 at 2:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.