Getting All 1's from SPI
Hello,
In SPI/ Normal mode (DMA -> Low / PM0,PM1 -> High), I am getting all 1's from all the registers. I tried it with a couple of different ATM90E36A boards. Please guide me, what may have gone wrong.
Thank You in Advance!
Here is the snap from Serial Monitor for a better understanding of the problem.
S0:0xffff S1:0xffff E0:0xffff E1:0xffff VA:655.35V VB:655.35V VC:655.35V IA:65.54A IB:65.54A IC:65.54A f655.35Hz
How did you solve this problem?
Actually, problem solved, if anybody else experiencing this problem, set correct CS pin in the eic initialization.
Hello, I have the same problem, but I think I have correct CS PIN. Is there any way to verify connection or test SPI communication? Thank you in advance
I've used the nodemcu ESP32 to execute the example code, not sure what hardware you are using, if all the connections are correct, the ASIC should respond with the example program itself, if you have an oscilloscope make sure the clk pin is having pulses.
Hello,
Thank you for the answer. I have find, that I use SPI2 pins of stm32, pins CS - PB12, CLK - PB13, MISO - PB14 & MOSI - PB15 and dont know, how to run it with theese pins, on default PA4,Pa5,PA6,PA7 it works, but I have LAN connector there.
Second thing is, that measured current is always positive, even if I turn CT, is it correct or there is other register to find direction of the current.
Thank you very much for usefull library.
Does these pins support hardware SPI? If yes then try to change it in the SPI initialization, either in code or in the SPI library. Answer to second question, Idk how much aware are you about basic electrical engineering, since CT can only measyre alternating current and alternating current changes it's direction much faster (50 or 60Hz depending on the geographical location), there is no point in really worrying about the direction of current, also there are no known registers in this ASIC (atleast to my knowledge) which provides any such direction information.
Thank you for your advice, I have changed library and now it works. Second question - I know AC changes direction by frequency, but I have photovoltaic system and I would like to know if my house produces energy or consumes energy.