Improved Serial Driver
Kye
Posts: 2,200
I can't seem to find a thread that flew by a while ago about making a serial driver without jitter on the serial port. I was going to post this there. Anyway...
I'm posting here today because I think I have a nice solution to the serial port driver jitter problem. I've updated my full duplex serial driver found here, http://obex.parallax.com/objects/397/, to run at 250,000 BPS using a 96 MHz clock. It has the added feature that it always changes the state of the TX pin aligned to the baud rate. So, it has no output jitter! Additionally, the driver is full duplex and can receive at 250,000 BPS at the same time. Finally, you can dynamically stop and start the driver while sending data and it will never corrupt any bytes being transmitted. The driver also has 256 byte transmit and receive FIFO buffers for easy serial operation.
Let me know what you think!
Thanks,
I'm posting here today because I think I have a nice solution to the serial port driver jitter problem. I've updated my full duplex serial driver found here, http://obex.parallax.com/objects/397/, to run at 250,000 BPS using a 96 MHz clock. It has the added feature that it always changes the state of the TX pin aligned to the baud rate. So, it has no output jitter! Additionally, the driver is full duplex and can receive at 250,000 BPS at the same time. Finally, you can dynamically stop and start the driver while sending data and it will never corrupt any bytes being transmitted. The driver also has 256 byte transmit and receive FIFO buffers for easy serial operation.
Let me know what you think!
Thanks,
Comments
I look forward to trying your new driver.
Thanks,
http://forums.parallax.com/showthread.php?129776-Anybody-aware-of-high-accuracy-%280.7-or-less%29-serial-full-duplex-driver
Probably is the thread you are referring to.
Massimo
Anyway, with my new driver, if you look at the ASM code, it always changes the bit on the tx line within 4 cycles of completing a waitcnt. The TX output is locked to the system timer.
Phil's PBnJ object in that other thread you were looking for synchronizes with waitcnts at 1/6 bit-time intervals--there was a reason for 1/6--and it achieves essentially zero jitter for baud rates up something above 115200 with clkfreq=80MHz. When I get a chance I'll test yours too for timing statistics.