Skip to main content
Ramalingeswar Rao
Associate
April 19, 2018
Question

How to read Current, Voltage & Power values from STPM32TR by using UART

  • April 19, 2018
  • 12 replies
  • 2485 views
Posted on April 19, 2018 at 08:34

Hi Guys, 

      I am new to this ST32, i want to read  values  of current, voltage & power values by using nrf board. there is any sample codes for sending commands to st32 and read from this st32 i need help.

Thanks in Advance.

    This topic has been closed for replies.

    12 replies

    Andrew Neil
    Super User
    April 19, 2018
    Posted on April 19, 2018 at 09:40

     I am new to this ST32

    What is, 'ST32' ?

    Do you mean ST

    M

    32 (the microcontroller family), or ST

    PM

    32 (power meter) ?

    Have you looked at the documentation & other support resources on the 

    ST

    PM

    32

     product page:

    http://www.st.com/en/data-converters/stpm32.html

      
    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Ramalingeswar Rao
    Associate
    April 19, 2018
    Posted on April 19, 2018 at 10:03

    Thanks for response Andrew.

    Actually it is power meter only, in my project power meter is one of the application. My need is to read all these parameters(current, voltage & power) values by using uart communication & I am using nrf5 series microcontrollers for receiving data. I am asking for there is any samples code for reading data from this power meter (STPM32TR).

    Thanks in Advance.

    Thanks & Regards,

    Ramalingeswar.

    ________________

    Attachments :

    image001.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxgQ&d=%2Fa%2F0X0000000b0u%2Fan1IJDJXMHgp_54PI09NdkNamKG21xYFc.m97bdIbXw&asPdf=false
    Andrew Neil
    Super User
    April 19, 2018
    Posted on April 19, 2018 at 11:11

    Ramalingeswar Rao wrote:

    I am asking for there is  any samples code for reading data from this power meter (STPM32TR).

    Again, did you look on the Product Page?

    That's where it would be!

    There is a document, '

    Getting started with the STPM3x' - have you read it?

    As its name suggests, it would seem to be the obvious starting point ...
    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    henry.dick
    Associate II
    April 19, 2018
    Posted on April 19, 2018 at 12:16

    '

    How to read Current, Voltage & Power values from STPM32TR by using UART'

    very simple: find a current, voltage & power sensor that outputs using UART. then write a piece of code that runs on your STPM32TR that reads from that sensor.

    Andrew Neil
    Super User
    April 19, 2018
    Posted on April 19, 2018 at 12:21

    Errr ... the 

    ST

    PM

    32TR

     is the sensor - so the task is to write some code on a host device (OP has nRF5) that reads values from it.

    Perhaps the OP first needs to learn to use the UART on the nRF5 ... ?

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Ramalingeswar Rao
    Associate
    April 19, 2018
    Posted on April 19, 2018 at 12:38

    Andrew Neil wrote:

    '

    the task is to write some code on a host device (OP has nRF5) that reads values from it'

     yes Andrew, i am trying to write  that code. It needs any particular commands on host? if want i need that commands.

    thanks for'

    Getting started with the STPM3x' 

     i am just put look on it.

    AVI-crak
    Senior
    April 19, 2018
    Posted on April 19, 2018 at 14:46

    The UART communication protocol is described on page 71 and below the official document. 

    http://www.st.com/resource/en/datasheet/stpm32.pdf

      By description: the request is the answer. You need to fill in the actual values with internal registers STPM32TR - for a one-time or a cyclic response.

    The use of such a chip - only for total energy accounting. In other cases, it is easier to apply a software implementation of the algorithm.
    Ramalingeswar Rao
    Associate
    April 27, 2018
    Posted on April 27, 2018 at 07:09

    Hi Avi,

    Sorry for delay, actually i am gone through that pdf i am unable to construct Exact code for that communication, That means i don't get information about registers. can u suggest source code for that. thanks in Advance.

    Andrew Neil
    Super User
    April 27, 2018
    Posted on April 27, 2018 at 11:34

    Have you looked at what's available on the Product Page yet?

    https://community.st.com/0D70X000006SwWiSAK

     
    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.