techtravels.org

Latest attempt

Tim mentioned something in the last post regarding SYNC which really had me thinking about how to SYNC the data coming in the drive with the data going to the UART of the USB2SER converter.

Then I was thinking, now that I have this super fast serial port on my machine, why not just SAMPLE the data aka pc-based-oscope. I can choose my sample rate, and then forward the raw data to the machine to process it.

The fastest rate (given my ISR code size) I can achieve is about 1.25mbps for a sample rate. Not too too bad. I’m running it at 921600 right now, because that’s a standard rate. maybe I’ll bump it to 1mbps just to round off the numbers.

Anyways what I do is write a 1-bit if i’ve seen a falling edge since the last 1 us, and write a 0-bit if I haven’t. Since the clock is very accurate, have the PC count the number of bits/bytes between edges, and I should be on target.

I’ve tried a couple terminal programs (namely realterm, ‘the terminal’, hyperterminal) but they all sort of choke when handling such a high baud rate. I can easily write some software that will capture this, as long as the PC can handle the speed. I may have to adjust buffer sizes, etc, but it should be doable.

The USR2SER supports 3mbps, so I’m guessing the PC/OS/driver etc should handle 1mbps in terms of real throughput.

I originally was just sampling at every 1us, but if I miss the low, which is quite possible — I miss the ‘edge.’ This way is much better.

There is the issue of LSB vs MSB since the drive spits out the stuff in MSB, and the UART takes stuff LSB. I haven’t thought about the impact of that. I can certainly do whatever on the PC — I don’t want to add anything else to the SX at this point.

I gotta do more manipulation of the data on the PC now, and I’ll post back this weekend about the results there.

keith

Amateur Electronics Design Engineer and Hacker

Add comment