High Speed Asynchronous Comms...
ght_dak
Posts: 15
There's been some discussion about the ability of the prop to do high speed serial comms.· Generally, the problem of leading edge detection is the culprit.
I've been playing around with the counters and wonder if they're not the solution.
Why·couldn't one use·the counter's logic·modes, nail APIN to the receive pin,·and use the PHSA value to determine the leading edge of the·start bit?· Assembly code would simply need to read PHSA within the start bit window and·use the PHSA value to determine when the leading edge of the bit was and, therefore, where the center of the rest of the bits·should be (within reasonable values considering the 1/80 MHz clock)
As an augmentation, using the B counter in duty cycle mode to drive the BPIN of the A counter, one could even be reasonably sloppy getting to the phsa register when reading the rest of the bits.
To see if the FDDI USB chip / Driver·can handle high rates, I did a cheap test today by nailing rx and tx together and using the PC to send and receive its own byte streams... I got distracted at 153600 baud... but there were no transmission·/ receive errors. (maybe this is a flawed test but it tested the driver speed... perhaps not the hardware).
Perhaps I'll code this up but I was wondering if anyone has done any work in this area before I started.· I didn't see anything using the search... but that doesn't always mean much.
-glenn
I've been playing around with the counters and wonder if they're not the solution.
Why·couldn't one use·the counter's logic·modes, nail APIN to the receive pin,·and use the PHSA value to determine the leading edge of the·start bit?· Assembly code would simply need to read PHSA within the start bit window and·use the PHSA value to determine when the leading edge of the bit was and, therefore, where the center of the rest of the bits·should be (within reasonable values considering the 1/80 MHz clock)
As an augmentation, using the B counter in duty cycle mode to drive the BPIN of the A counter, one could even be reasonably sloppy getting to the phsa register when reading the rest of the bits.
To see if the FDDI USB chip / Driver·can handle high rates, I did a cheap test today by nailing rx and tx together and using the PC to send and receive its own byte streams... I got distracted at 153600 baud... but there were no transmission·/ receive errors. (maybe this is a flawed test but it tested the driver speed... perhaps not the hardware).
Perhaps I'll code this up but I was wondering if anyone has done any work in this area before I started.· I didn't see anything using the search... but that doesn't always mean much.
-glenn
Comments
The bit time and 1/2 bit time in clock ticks is precomputed, so the leading edge detection and verification is maybe 15 clock cycles for the 1st 1/2 bit time and 13-14 cycles for the 2nd 1/2 bit time. That's roughly 350ns per bit or a bit less than 3MBaud for receive with an 80MHz system clock.
If you want to get fancy and sample multiple times in a bit time slot, taking the best 3 out of 4 or something like that, it would probably slow you down to 1MBaud. Doing parity checking or CRC checking adds a little bit. Copying data to hub memory rather than using a buffer in the cog's memory also slows things down a little from the 2+MBaud figure.
Post Edited (Mike Green) : 7/22/2007 10:16:33 PM GMT
This is not fancy code we're talking about here! It is straightforward, but, like any testbed, is a lot of work to do so it's useful and easily controllable, etc.
http://forums.parallax.com/showthread.php?p=652952
It communicates serial with 2 MBit/s full duplex with the PC and needs only 1 cog.
Andy