voelkerb/STPM3X

readCurrent not working

Closed this issue · 6 comments

Hi, I'm use Arduino pro mini 3.3V with STPM34.
I can read voltage but current not working. why? Please help me. (I apply Current 2A and 230V )
And I try to read via UART From STPM3x Evaluation Software ,It worked.
111

What hardware setup are you using? You can set the gain of your analog Frontend in the library here or use the gain correction to adjust the value if it simply has a linear relationship as out-commented in the basic example.

image
image
image

Hi, I am attempting to read data from an IC using your Arduino code. In the provided configuration, you connect the IC enable pin to digital pin 12 on your controller. However, in my case, I have not connected this pin (pin 12) to the controller; instead, I have directly connected it to VCC for operation. When I want to reset, I simply press the push button. Now, the question is, in your code, you have used pin 12 for the reset purpose. Can I ignore this, or is it essential to connect the enable pin to the controller as you did?

It is just used for a defined initial reset. CS is pulled during the reset operation. You may need to check in the datasheet if a certain reset condition is required (e.g if the chip goes to a certain mode if CS is not pulled during reset). If you have a demo board, you could simply test your approach.

Actually, I have two STM34 ICs on the hardware that I designed earlier. For both ICs' enable pins, I have created different enable circuits, taking reference from the datasheet of STPM34. I connected both of them directly to the VCC 3.3V power source at all times. If a reset is required, the user can press the push button on the hardware, and the IC will reset accordingly.

Now, in programming, I believe a reset is required for initialization or register configuration purposes. For that, I need to connect the enable circuitry to a digital pin on the microcontroller like you did in your code and define reset_pin as 12 so that I can reset it during programming or initialization. I have also shared pictures for your reference in the above message for better clarification. Now, I am planning to connect both ICs' enable pins to one microcontroller digital pin and disconnect the previously connected VCC 3.3V directly so that I can reset the ICs through the microcontroller when configuration or a reset is required.

STPM34 Datasheet: schematic, page 14/89
datasheet link: https://www.st.com/resource/en/datasheet/stpm32.pdf
image

did you manage to solve the reset issue eventually? If so, what was needed?

Closing due to inactivity