Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data types and transfer in pulsed_nmr #1087

Closed
pasicl opened this issue Mar 10, 2023 · 3 comments
Closed

Data types and transfer in pulsed_nmr #1087

pasicl opened this issue Mar 10, 2023 · 3 comments

Comments

@pasicl
Copy link

pasicl commented Mar 10, 2023

Description of the setup:

Device: 125-14-Z7020-LN
SD card image: red-pitaya-alpine-3.14-armv7-20220322
Application: pulsed_nmr
Description of the problem:

I am trying to use both ADCs of the StemLab with the pulsed_nmr application, and I don't understand how is the data transfer from the FPGA to the server software running in the Red Pitaya. I've tried using both channels and only the first one seems to work.

From what I understand looking at the block diagram of the FPGA project, there are 4 streams of 32 bits each one: 1st ADC (I), 1st ADC (Q), 2nd ADC (I), 2nd ADC (Q). Then they are combined with the stream combiner and it is a unique stream of 128 bits. Then it enters a FIFO which allows to write in 128 bits at a time but only read 32 bits, and these 32 bits are stored in the Stream-reader, which is associated to the register with starting adress 0x40010000. Does this mean that only 1 of of the 4 streams is used?
image

Then, from the C code, it stores in a buffer the contents of such register, and sends it to the client, which uses a uint64_t variable to store the data. However, in the register, the data is only 32 bits long. I tried reducing the size of the *rx_data variable and the *buffer and it seems to work the same way, and even this 32 bit long data contains real and imaginary parts.

What am I missing? I don't get the format of the streams and how they are transferred. Is there any way to debug the FPGA (I don't know any method) or to access the data inside the buffer in the c-code?

@pavel-demin
Copy link
Owner

The sample type is a 32-bit signed integer. When copied to memory, the I and Q samples are interleaved exactly as you describe: 1st ADC (I), 1st ADC (Q), 2nd ADC (I), 2nd ADC (Q), etc.

@pavel-demin
Copy link
Owner

pavel-demin commented Mar 11, 2023

BTW. Since you are looking at the code, I recommend looking at the code in the develop branch. There are some improvements and some of them may fix the #1080 issue.

@pasicl
Copy link
Author

pasicl commented Mar 16, 2023

Perfect, that is exacly what I needed, thank you!

@pasicl pasicl closed this as completed Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants