Key File System Driver Serial Port Problem
jazzed
Posts: 11,803
I'm using the file system driver for testing:
I find at 100MHz or 104MHz, the Propeller sometimes receives bad characters on the serial port at 115200 baud. This does not happen with FullDuplexSerial (and friends) at up to 104MHz on any board.
It always happens with the File System Driver on any board in my office at 100MHz +.
Since I plan to offer the 96MHz and 104MHz crystals in a product, I would appreciate it if the problem could be fixed.
│ SD2.0 FATEngine Demo │ │ │ │ Author: Kwabena W. Agyeman │ │ Updated: 6/16/2010 │ │ Designed For: P8X32A @ 80Mhz │ │ Version: 1.0 │ │ │ │ Copyright (c) 2010 Kwabena W. Agyeman │ │ See end of file for terms of use. │ │ │ │ Update History: │ │ │ │ v1.0 - Original release - 6/16/2010. │
I find at 100MHz or 104MHz, the Propeller sometimes receives bad characters on the serial port at 115200 baud. This does not happen with FullDuplexSerial (and friends) at up to 104MHz on any board.
It always happens with the File System Driver on any board in my office at 100MHz +.
Since I plan to offer the 96MHz and 104MHz crystals in a product, I would appreciate it if the problem could be fixed.
Comments
Anyway, the PASM section in question is the same. I ran the test again with both drivers and they show the same issue although at a different offset. So your test timing may have just moved out of the DMZ to not see it
I just use the RS232_COMEngine because I never have probems with it. I accept though that it does not work perfectly and that trying to use the waitcnt statments in it make life hell. I'll get arround to fixing that driver sometime... when I have time.
@ kuroneko - My serial driver is not broken by design. But it is not robust by design either. I use a 4X sample rate and align myself to be somewhere in the 1/4 to 1/2 bit width area. My driver does not sample the bit in the middle of the period so it chokes when data is not pretty much perfect... using the waitcnt statement pretty much kills FDX functionality, you can't get speed and precision at the same time. I'll have to recode the driver.
I'll get on recoding that then. I won't included it in anymore releases. (I'll be lazy and just remake FDX with my interface)
Anyway, I will fix the serial port driver in all future releases and very soon. Version 1.6 of the serial driver is the best I can do (and I think anyone else and still hit 250_000BPS) using waitcnt statments. If I increase the timing to 8X in the driver the problem will probably go away, but the max speed will decrease.
Chip's FDX serial driver is the way to go I guess for the propeller. Even though it has horrid bit timing.
kuoneko seems to have found a possible cause in post #17
1. Cut the code back to 115,200 by all means. But 115,200 is used a lot. Above this, we can do something else, or fix it later.
2. Is there any way to use a counter (kuroneko?) to start counting the start bit once it is received. I think it's highly possible. That way, you can detect how much time was lost when you detect the start bit, and take that into account. This may well fix the problem, because the timing would then be synchronised properly to the start bit.
Is my understanding of the counters correct?...
If the counter were set up to add frqa (=1) to phsa (+1) each clock when the start bit arrives (is active), then it would be a matter of clearing phsa each time the code enters the wait for start bit. Once a start bit is detected, read phsa to see how many clocks have passed to be used in calculating the sampling for the middle of each.
So the counter would be set to Logic !A (start bit =0 for non-inverted mode) or Logic A (start bit =1 for inverted mode).
If this is correct, I will have a go of putting it into FullDuplexSerial_rr004.spin - this version can have variable buffer length in ^2 sizes. I have a unverified version that checks for CTS. So it would be a good start to updating the FDX. Maybe reclaim the hub space for the buffers too!
You need more instructions to read them robustly and if your reading the counter modules during the bit transistion time stuff goes wrong.
@ kuroneko - Will do.