generating consecutive bursts without gaps?

Applications, development tools, FPGA, C, WEB
Post Reply
gooseman
Posts: 7
Joined: Wed Apr 20, 2016 4:36 pm

generating consecutive bursts without gaps?

Post by gooseman » Wed May 11, 2016 1:31 pm

I am trying to send consecutive bursts with different characteristics (be it amplitude, frequency or completely arbitrary). Is there a proper way to ensure that the previous burst has been completely generated before the next burst is started? Something like a 'burst queue'? Having a continuous output signal without gaps or jumps is important for my project.

Thanks!

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: generating consecutive bursts without gaps?

Post by Nils Roos » Wed May 11, 2016 9:41 pm

With the current ASG logic, there is no easy way to find out when a burst is finished, and there is no queueing of bursts.

You could observe the buffer pointer and determine that way when a burst is finished. Programming a new burst should only be done once the generator is idle, so you'll have some neccessary delay between bursts. If you need to reprogram the waveform, this delay can get quite large.

You could of course change the ASG logic to suit your needs better, implementing a 'burst queue' that is coupled to the burst state should be possible.

gooseman
Posts: 7
Joined: Wed Apr 20, 2016 4:36 pm

Re: generating consecutive bursts without gaps?

Post by gooseman » Thu May 12, 2016 7:50 am

Hello Nils,
would that be the following function call?

Code: Select all

/**
 * Returns current position of ADC write pointer.
 * @param pos Write pointer position
 * @return If the function is successful, the return value is RP_OK.
 * If the function is unsuccessful, the return value is any of RP_E* values that indicate an error.
 */
int rp_AcqGetWritePointer(uint32_t* pos);
Thanks!

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: generating consecutive bursts without gaps?

Post by Nils Roos » Thu May 12, 2016 9:49 am

No, sorry, the API does not expose this functionality. If you want to add it yourself, the information can be read from the structure member ch_properties_t.buffReadPointer, like this (RedPitaya/api/rpbase/src/generate.c):

Code: Select all

int generate_getReadPointer(rp_channel_t channel, uint32_t *readpointer) {
    volatile ch_properties_t *ch_properties;

    ECHECK(getChannelPropertiesAddress(&ch_properties, channel));
    *readpointer = ch_properties->buffReadPointer;
    return RP_OK;
}

gooseman
Posts: 7
Joined: Wed Apr 20, 2016 4:36 pm

Re: generating consecutive bursts without gaps?

Post by gooseman » Wed May 18, 2016 5:59 pm

after some include file adding, I can compile.. but I am getting a segmentation fault. When I comment all three lines from generate_getReadPointer() except for the return line, it works. Any ideas how to trace down the problem?

gooseman
Posts: 7
Joined: Wed Apr 20, 2016 4:36 pm

Re: generating consecutive bursts without gaps?

Post by gooseman » Thu May 19, 2016 8:58 am

If anybody wants to have a look, here is the code.. probably a stupid mistake but I cannot find it..
You do not have the required permissions to view the files attached to this post.

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: generating consecutive bursts without gaps?

Post by Nils Roos » Fri May 20, 2016 3:09 pm

Not a stupid mistake, you just misunderstood how the different pieces work together. Your generate pointer is private to your sourcefile and will not be filled with the appropriate value when you call RP_Init(). So when you use it, it will still contain NULL and cause segfaults.

You need to put your generate_getReadPointer() into the generate.c file of the API, add wrappers for it to gen_handler.c and rp.c and put prototypes into the corresponding headerfiles. Then rebuild librp.so and install it on your RP. It sounds more complicated than it is, most things can just be copy-pasted from existing code.

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 86 guests