Fast Streaming Issues

Post your C and C++ discussions here
Post Reply
MarkW
Newbie
Posts: 0
Joined: Wed Feb 13, 2013 7:26 am

Fast Streaming Issues

Post by MarkW »

Hi,

I've been having lots of issues trying to write an application that runs my 2204 scope in fast streaming mode. There appears to be an issue when the drivers reach the end of it's allocated memory and then starts at the beginning again.

A quick explanation of what I'm doing: I am detecting an incoming UART signal that consists of ascii characters 33 to 126 repeated. I know what to expect thus my app uses the algorithm to determine which bit is expected and compare the detected bit with the correct bit. Here is a piece of an example of the output:


0000000001111111111111111111111111 1 1
110000000000000000000000000 0 0
01111111111111111111111111 1 1
10000000000000000000000000 0 0
000000000000000000000000 0 0
0001111111111111111111111111 1 1
10000000000000000000000000 0 0
000000000000000000000000 0 0
000ITERATION: 25600

TOTAL: 76796
000000000000000000000 0 0
000000000000000000000000 0 0
00000001111111111111111111111111 1 1
10000000000000000000000000 0 0
01111111111111111111111111 1 1
10000000000000000000000000 0 0
01111111111111111111111111 1 1
111111111111111111111111 1 1

All the zeros and ones are samples below and above 3V respectively. When it has detected 24 samples of the same value in a row, it then knows that is the detected incoming bit. You can see that everytime it will print the samples and then a space and then the bit it has detected and then a space and then the bit it is expecting. Also, after each iteration i print 'ITERATION' and say how many samples are collected in the next 'block' of data.

It works perfectly until I get an output like this:

111111111111111111111111 1 1
11110000000000000000000000000 0 0
01111111111111111111111111 1 1
10000000000000000000000000 0 0
0000000000000000000000ITERATION: 23996

TOTAL: 510394
00 0 0
000000000000000000000000 0 1
000000000000000000000000 0 0
000000000000000001111111111111111111111111 1 0
10000000000000000000000000 0 1
01111111111111111111111111 1 1
111111111111111111111111 1 1

The blocks of samples are almost always of length 25600 or 51200. When I receive a block of less length as above, the samples are wrong (you can see that the two bits at the end of each line no longer match up). After further investigation (and printing where the overview buffer is pointing to) I found that this occurs when the memory sort of 'resets' to back to the beginning of the allocated memory. I also found that if I offset my array when it detects a block of '23996' samples by 1604 (which is 25600-23996) then the block after 'ITERATION: 23996' is correct (which tells me at the end of this memory allocation the call back function runs twice without breaking back to the main function), but all blocks after that are still wrong, as if the overview buffer is no longer pointing to the correct address or the device is somehow skipping some data.

This issue is becoming very urgent for me, as I thought I would've had this working within a week but it has already been 2 weeks!

Please let me know of this issue and/or how to fix it, and if you require further explanation of my application, or if you would like me to post the code.

Thanks
Mark Wilson

Post Reply