Interfacing of ACS71020 using SPI
Posted: Sun Aug 23, 2020 2:28 pm
Hi Team,
I am interfacing [ACS71020][https://www.allegromicro.com/~/media/Fi ... sheet.ashx] with ESP32. I code ESP32 using Arduino IDE. I want to interface this IC with ESP32 using SPI communication. Its SPI frame like below. I need to send 7 bits of address 1 bit of read/write which makes 1 byte. But after that, I need to read 32 bytes of data from this IC or I need to write 32 bytes of data to this IC.
If I want to read 32-bits of data, I need to send dummy 4 bytes on the MOSI line so that I will get data on the MISO line. I don't know, which register to read in this case. Can you guide me on this, please? Or do you have better suggestion to interface this IC?
Till now I have been successful in writing SPI data to other devices ex. Arduino UNO as a slave. I have attached my code below for such SPI data write. But I need assistance to read from ACS71020 ic. Can somebody guide me on how to read 32-bit data using SPI communication.
Thanks in advance,
Akshay Godase
I am interfacing [ACS71020][https://www.allegromicro.com/~/media/Fi ... sheet.ashx] with ESP32. I code ESP32 using Arduino IDE. I want to interface this IC with ESP32 using SPI communication. Its SPI frame like below. I need to send 7 bits of address 1 bit of read/write which makes 1 byte. But after that, I need to read 32 bytes of data from this IC or I need to write 32 bytes of data to this IC.
If I want to read 32-bits of data, I need to send dummy 4 bytes on the MOSI line so that I will get data on the MISO line. I don't know, which register to read in this case. Can you guide me on this, please? Or do you have better suggestion to interface this IC?
Till now I have been successful in writing SPI data to other devices ex. Arduino UNO as a slave. I have attached my code below for such SPI data write. But I need assistance to read from ACS71020 ic. Can somebody guide me on how to read 32-bit data using SPI communication.
Thanks in advance,
Akshay Godase