I am aware that the preset baud rates don't work with the software uart and the user defined option has to be used to get usable bit times, however there is another strange problem.
If I send a string of up to 31 characters plus crlf via the software uart everything works as expected. Uppercase U is a good character to use as its bits alternate and it is easy to measure the bit time. At 9600 baud this comes out at 104us. If I then send strings of 32 or 33 characters + crlf the terminal screen displays rubbish because the bit time has majically changed to 143us. Strings of 34 and more characters work again as the bit time returns to 104us. I haven't tested to see if the problem recurrs around 64 characters but I wouldn't be surprised if it did.
I noticed this first at 115.2 kbaud and put it down to the high speed but it happens exactly the same way at 9600.
I am using an 18F4620 @ 40MHz. Any ideas?
Thanks,
Brian Walsh
software uart baud rate changes
Moderator: Benj
-
- Posts: 29
- Joined: Thu Jan 14, 2010 10:43 pm
- Has thanked: 3 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: software uart baud rate changes
Hello Brian,
I have a plan in place to make the software UART more reliable for the upcoming release. Its strange how the number of characters is effecting the baud rate. I wouldn't have thought that was possible. I'll get around to looking at the code this week so I'll let you know if I spot anything that could be causing this strange behavior.
I have a plan in place to make the software UART more reliable for the upcoming release. Its strange how the number of characters is effecting the baud rate. I wouldn't have thought that was possible. I'll get around to looking at the code this week so I'll let you know if I spot anything that could be causing this strange behavior.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 29
- Joined: Thu Jan 14, 2010 10:43 pm
- Has thanked: 3 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: software uart baud rate changes
I also found using software uart higher than 4800 baud causes problems. So I just stick to 4800 for now, if that helps.
Martin
Martin
Martin
-
- Posts: 29
- Joined: Thu Jan 14, 2010 10:43 pm
- Has thanked: 3 times
Re: software uart baud rate changes
Hi Martin,
I was actually dismissing baud rate as the culprit but focussing on string length as the somewhat bizzare villain of the piece. Are you saying that you can send my delinquent string lengths at 4800 baud?
Regards,
Brian Walsh.
I was actually dismissing baud rate as the culprit but focussing on string length as the somewhat bizzare villain of the piece. Are you saying that you can send my delinquent string lengths at 4800 baud?
Regards,
Brian Walsh.
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: software uart baud rate changes
To be honest, I can't answer that question. What I said may not be relevant at all. I only mentioned it because you are having issues with software based UART, and I am with baud above 4800.
Although I am using 4MHz internal osc, Factory calibrated to 1%, That maybe the cause with my set up?
Although I am using 4MHz internal osc, Factory calibrated to 1%, That maybe the cause with my set up?
Martin