att7053cu or att7053

Hello everyone, how do we read data over these four pins? Is there any library for this? If there is no library, how to read instantaneous value from sclk, miso, mosi for this? att7053cu or att7053.
IMG-20221228-WA0007

You are supplying absoloutly no relevant information.
What sort of Arduino?
What is the wiring?
What is the code you are running?

but most of all
What are you trying to achieve?

You might want to look at this How to get the best from this from this Forum before you proceed any further.

Let me guess - this is part of the pins of the some popular STM32 board - bluepill(STM32F103) or blackpill (STM32F401).
These pins refer to SPI interface.
The work with SPI bus is described in thousands books and there are a lot of libraries to work with SPI....

Reading the 'instantanous values' from the pins is easy enough in Arduino code, for instance;

value = digitalRead(pinnumber);

But that is not an answer to the question you meant to ask I suspect.

You are supplying absoloutly no relevant information.

What sort of Arduino?

esp32, stm32, rp2040

What is the wiring?
its stm32 based device.

CSS = PA4
SCLK = PA5
MISO = PA6
MOSI = PA7

What is the code you are running?
There is no software code or library, only some examples on Chinese sites:

https://www.baidu.com/s?wd=att7053%20arduino&pn=20&oq=att7053%20arduino&ie=utf-8&fenlei=256&rsv_idx=1&rsv_pq=ce67edfc000c4f89&rsv_t=2099d9lJ%2BEhIB7etNKBNEf0i3OVoWwyU6SwM6IA6GMATtt1fziGkT7dhmyI&rsv_page=1&bs=att7053%20arduino&rsv_jmp=fail

It's not enough for arduino

We also looked on github but there is no source about arduino.

but most of all

What are you trying to achieve?

ATT7053 energy metering IC chips I2C Power Monitor with Calculation and Energy Accumulation

But we do not know how to get the data, can we measure the data passing through the cs or miso pins or how to specify the pin settings in the setup section

we want to get the current value from sensor from at7053

I scanned many sources but I couldn't find any examples. Is there a special spi setting required for these 4 pins and on which pin / or code, we can get the value over the sensor. Thanks.

The device datasheet should have the details on how to use the SPI bus to read that particular sensor.

The file is not allowed to upload but is not in the content.

Please clarify - I2c or SPI? - it are completely different protocols.

There are a few information about this chips, but as far I know, the datasheet is available. If you don't find ready-made arduino code, I think you can hire a programmer to write such a library. You can place an order in the Paid consultancy category.
Since the programmer will need such a chip, it would be useful for you to indicate which country you are in

There may be no need for a library, I just want to pull the instant data via spi to an int or string variable.

The protocol is described in the datasheet, everything is there.
To help you, a helper need to have this chip on hand, so I think you will have to figure it out yourself.

Sorry not good enough, I was expecting a schematic, not a list of connections.

That seems to be three sorts of Arduino, so it don't answer the question "what sort of Arduino"?

Look at the SPI example
SPI operation

Hello again. This is the schema you want.

No.
A schematic shows where the pins go to. In other words how have you connected the att7053cu or the att7053 to those pins you have boxed in blue.

We connected it to the stm32 like the diagram above, but we cannot read data. We need code to read this data. If there is any example I can get it, this will help me.

Did the link in post#12 not help?

You also need to get the data sheets for the att7053cu or att7053 to tell you what to send to the chips and what to read back.
Search for the part number and add data sheet on the end.

I am sharing the file my friend, we want to get data from these pins. With which pin can we read the data? Is there an example?

We just dont know how to get data fromt his chip,

like; which pin will make set OUTPUT for digital read in setup and which pin we will get read from in loop or another code. Thank you.

You connect it to the SPI pins and run some SPI code like you read about in the link.

However it is not as simple as that. Your processor is a 3V3 device, that is it produces digital signals that go from zero to three point three volts. Your data chip is a 5V device, that means it produces digital signals that go from zero to five volts. If you connect this chip directly to your processor you will damage your processor because it will feed voltages into your processor that are above the signal level it can cope with.

So in order for this to work you need to boost the 3V3 signals on the CS, clock, and data pins (MOSI) up to 5V. The best way to do this is through two buffers of a 74HCT14, chip.

The other signal MISO, from the chip needs to be cut down from 5V to 3V3, using a potential divider.

You do not access this system with a digital read, or write. You access purely through the SPI library by sending and receiving messages of three or four bytes, as section 5 of the manual shows you how to do.

Have you searched for a library to simplify the writing of the code? Otherwise you will have to write your own code that sends data to this device, which means you have to know what you want it to do.

I think this project is way beyond your capability at the moment, and you would be better off using a 5V controller like a Uno or Mega, or Nano classic, so you could connect these pins directly. Even so you will have to sort out the software, so what do you want to do with this. Read section 5 of that manual many times so you understand it or at the least are able to ask intelligent questions about what you don't understand.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.