On my application, there are 4 SPI ports on the MCU. To support 5 metering channels with ADE7953 on each channel, the 4th and 5th ADE7953 chip share one SPI port. I use the chip select pins to select the ADE7953 chips to communicate. Also these two metering IC share one MCU's external IRQ pin.
With this hardware design, I have the problem to communicate to these ADE7953 chips via SPI port. I can successfully read / write the first, second, and third ADE7953 metering IC without any issue since those have its own SPI port. But when reading any registers on 4th, or 5th ADE7953, always get 0xFF (8-bit) or 0xFFFF(16-bit) values.
I want to know:
1. Is it the good practice to have multiple ADE7953 chips to share one SPI port as long as making sure to have only one chip select line polling low.
2. If multiple metering ICs can share one SPI port, is there anythings should I pay attention to?
3. Since these two ADE7953 chips share one MCU external IRQ, I need to fully disable all interrupts on one of them. I noticed that on register IRQENA, the default value is 0x100000, bit 20 (Reset) is always enabled, can't be disabled. Will this be the issue? Under what condition will this Reset interrupt be triggered?
Thank you very much in advance for the help.
Can you share your schematic for the 4th and 5th part?
please measure the analog ldo ,digital ldo, reset pin and reference.
Can you capture the spi pins during a communication?
Thanks for your reply.
Sorry I can't send you the schematic since it was designed by a contractor. I am the software engineer. Basically the 4th and 5th part are the same as the 1st, 2nd, and 3rd part including reset pin and reference pin on ADE7953 IC. I am not sure what are "analog ido, digital ido" you meant. The difference includes:
1. 4th and 5th meter IC share one MCU external IRQ, 4th ADE7953's IRQ is directly connected to MCU external IRQ pin, 5th ADE7953's IRQ is wired to MCU external IRQ through 22 ohms resistor. I think as long as keeping IRQENA and IRQENB to the default values on one meter, this meter shouldn't generate any IRQ flags. So when MCU receives external IRQ trigger, it should come from only one meter with one or more bits are set on register IRQENA or / and IRQENB, is it right?
2. 4th and 5th meter IC share one MCU SPI port. Both meters' SPI SCLK and SPI MOSI pin are directly connected to MCU SPI SCLK and SPI MOSI pin respectively. 4th ADE7953's SPI MISO is directly connected to MCU SPI MISO pin, 5th ADE7953 SPI MISO pin is wired to MCU SPI MISO pin through 22 ohms resistor. When communicating to 4th ADE7953, pull down 4th meter 's CS pin, 5th meter CS stays high. In this way only 4th meter is available to communicate to the MCU, is it right?
3. Right now, the 1st, 2nd, and 3rd part. are working properly. All power data measurement are correct.
4. This new design is based on an legacy product, in which, one ADE7953 has its own MCU SPI port and IRQ on MCU, total 4 SPI ports and 4 IRQ on MUC support 4 ADE7953. The product runs very well. The only difference on this new design is adding the 5th meter.
I wonder if it is the good practice to have two ADE7953 metering IC share one SPI port and one external IRQ on MCU. Is it common to do this way using ADE7953?
Thank you very much for the help.
Forgot to mention, each ADE7953 has its own CS line. I did one experiment, just simply read meter 4's non-zero default register. e.g read register CONFIG (address 0x102), its default value should be 0x8004. But I read back 0xFFFF. Using the same function to read meter 5's register CONFIG, I got the same result. If I use the same function to read back the same register from meter 1, 2, or 3, the value received is correct default value.