Closed carlos-e-teixeira closed 6 years ago
Please, don't call me Mr Pavel.
The only program where I'm using the XADC block is sdr-transceiver-hpsdr.c. I'm reading the data with the following code:
int32_t value;
value = xadc[144] >> 3;
value = xadc[145] >> 3;
value = xadc[152] >> 3;
value = xadc[153] >> 3;
The addresses are from the XADC Wizard documentation (PG091, page 18).
Sorry Pavel, I was trying to be courteous.
So... I totally understand now, but just one more question. Why do you use a right-shift operation of 3 positions? Would not it be a right-shift operation of 4 positions, since we have 16-bits registers that keep the 12-bit MSB justified result of A/D conversion on the corresponding auxiliary analog input.
Thank you again, Pavel! You help me a lot! Best regards!
Why do you use a right-shift operation of 3 positions? Would not it be a right-shift operation of 4 positions, since we have 16-bits registers that keep the 12-bit MSB justified result of A/D conversion on the corresponding auxiliary analog input.
You're right. The right-shift by 4 is the most correct way to process the XADC data.
However, in my program I was looking for a way to obtain 12-bit values for the unipolar analog voltages and the right-shift by 3 worked well enough.
Hi Mr. Pavel, I'm trying now to read some analog values using the IP XADC Wizard. For hardware configuration, I used the TCL code you implemented.
For my C application, I declared a volatile pointer and the memory mapping of this pointer is also according to your code ('sdr-transceiver-hpsdr.c') and hardware addressing.
From now on, I'm not sure about the next steps (pieces of code) to be implemented in order to get 4 analog values corresponding to the 4 slow analog inputs available on the connector E2 of the Red Pitaya.
I did not understand what you've implemented. I know the XADC block only converts analog values to digital vectors of 12 bits, doesn't it?
Also, I know the XADC block accepts bipolar analog voltages (-0.5V to +0.5V) and unipolar analog voltages (0V to +1V). Since I'm using the temperature sensor LM35, I think I will not have any problem to read it.
I appreciate again in advance your help! Thank you so much! Best regards!