How to read data from external ADC MAX144 using STM32 microcontroller - stm32

I am facing a problem for last week in reading data from external ADC MAX144 using SPI and STM32L452. The confusion is how to receive data in buffer as there is no memory address or control register address is mentioned in the datasheet of ADC. The datasheet ADC is given below.
https://datasheets.maximintegrated.com/en/ds/MAX144-MAX145.pdf
What I tried is:
I made a buffer of 2 bytes. (static unit_8 readBuffer[2])
Then used receive command of HAL SPI ( HAL_SPI_Receive(&hspi3, readBuffer,
2, 5000)
And transmit through USART to PC
The confusion is I am not giving any memory address or control register address for reading data as nothing about registers is mentioned in the datasheet of ADC and it is continuously sending data.
Please guide me someone has any idea about it. I stuck in this problem but don't understand it. Any leads will be highly appreciated.
Regards,

I think the ADC stream the ADC output directly on the SPI data line, so there is no register to store data on the ADC

Related

Register Value and Memory Address for Read and Write for MAX144 ADC

I am using MAX144 ADC and in the Datasheet there is no information given about the control register to read the ADC values. I am using STM32L452RE micro-controller and using SPI to get data from ADC. Datasheet of the ADC is:
https://datasheets.maximintegrated.com/en/ds/MAX144-MAX145.pdf
anyone who encountered the same problem please guide.
my idea is to create a buffer of 2 bytes for SPI RX and store values in it. but i don't know what control register address should be assigned to it.
The conversion data is not stored internally in a register set. When you pull CS low the state of SCLK will determine wither it holds the conversion product(after a high to low transition to start it) or start streaming it on the falling edge of the second clock pulse.
This is all noted on page 9 of the data sheet. Pages 10 & 11 detail how to interface them to standard SPI.

SPI DMA CIRCULAR Mode - stm32f4

Does anyone have a sample code of transfering data with SPI in DMA CIRCULAR mode for stm32?(16 bit)
With my code, master sends 16 bit data and in the next cycle receives the answer. But this transaction done with one cycle delay.
SPI is supposed to work that way.
When the SPI data register is written the first time, it starts sending the data, and immediately signals the DMA controller that it's ready for the next data word. Now there are two data words down in the transmitter, when it has barely started receiving the first one. When the first outgoing word is completely transmitted, and the first incoming word is completely received (these happen almost simultaneously), SPI starts sending the second word already in the data register, signals the transmit DMA channel that it's ready for the third data word, about the same time it also signals the receiving channel that the first incoming data word is ready.

IC2 SLAVE NOT RESPONDING XC8

Hey guys i've been working on this like 72 hours straight and i can't find the error, i'm working on a PIC16F1719 i'm trying to set 3 peripherials an ADC a I2C Protocol and a USART for comunicating to a BT however the ADC was easy, but i'm having a rough time with the I2C despite the fact i've check the code several times, for some reason when i get the ACK's everything seems OK, but when i go for a lecture on the sensor (MPU6050) nothing shows up but the value i putted last time on the buffer, any ideas why this is happening? It's like the buffer doesn't clear itself and i think i canĀ“t clear it through software, thanks.
i2c slave has the ability to lock the bus if the master does not communicate correctly with it (several possible scenarios...)
This is electirically possible since the 2 wires are wired-and, that means if any slave pulls the clock (for example) down, and keeps it that way, the bus is locked.
Always check first the values on both wires (using scope or dvm), if '0' it means bus locked.
Next test the status register of your i2c controller, it may show arbitration error or something of that sort.
If any of the errors, read the i2c slave part datasheet carefully to check what types of protocol read/write it expects and fix your code.

Not ACK bit in the AT24C512C EEPROM Read operation via I2C connection

As you can see in the below picture of the AT24C512C datasheets from ATMEL,after reading desired data from EEPROM,there is a NOT ACK bit following the data which I don't understand is produced by the EEPROM or MCU(master)?
As you know past ACK bits in the writing data to EEPROM was produced by EEPROM to acknowledging a correct data receiving.Reading section
NOT ACK bit is produced by MCU (master) to generate stop condition here and if there is any error while slave receiving the data then it would be hardware generated by the slave or you can say EEPROM. It is a two-way communication.
If you are using this module I will suggest you to use random read by providing the address on ehich data is written and you read the same address. Then , it would work. It would be similar to codes in the following link. You can choose the language as per the mcu you are using.
https://github.com/ControlEverythingCommunity/AT24HC02C

UDR (UART data register)issues

I can't understand the meaning of the following "The USART Transmit Data buffer register (TXB) and the USART Receive Data buffer register (RXB) share the same I/O address" there is two data register .how they share the same address ?
Now it's clear
From the diagram you see that The transmitter and receiver share the UDR (UART Data Register). Actually they only share the UDR address: The "real" register is divided into the transmitter and receiver register so that received data cannot overwrite data being written into the transmit register. Consequently you can't read back data you wrote into the transmitter register.
The register address is the same for both TXB and RBX and the actual addressed register is determined by the modality in which the UART is (reading or writing mode). This is depended on the actual implementation, but usually it consist in setting one or two more pins.
You can consider UDR register as the buffer between TXD and RXD registers.
As you know UART is sent bit by bit in the bus, While recieving the bits is entering the RXD register, when all the byte is being recieved it copied to UDR register and the flag is raised, now you should read the UDR register and if you write to it you will lose the recieved byte!!
By the same way in transmission, you write the a byte in UDR then it moved to TXD then output from registerbit by bit and the UDR is empty during transmission.
That's why there is interrupt for UDR, when the UDR becomes empty, and interrupt for TXD, when trasnmission is completed.