Page 1 of 1
Problems usin SW Chanel of CAL Uart
Posted: Fri May 10, 2019 8:46 am
by CSM2711
Hello,
I have some problem by using the Software chanel of CAL Uart on my PIC16F1827.
When I use the Hardware chanel everthing works fine, after selecting sofware chanel (same Pins) the uart want work.
Does everyone has an Idea?
Re: Problems usin SW Chanel of CAL Uart
Posted: Fri May 10, 2019 10:10 am
by medelec35
Could it be that the UART data is being sent, but the baud is a bit out of tolerance for the terminal?
Do you have a scope to verify this?
Can you post your flowchart, so we can see if anything looks amiss?
Re: Problems usin SW Chanel of CAL Uart
Posted: Fri May 10, 2019 10:32 am
by CSM2711
ok , i have tes with a small testprogramm, it looks like something is wrong with the timitng ......
i will try to measure it.....
Re: Problems usin SW Chanel of CAL Uart
Posted: Fri May 10, 2019 10:47 am
by medelec35
I just Send an upper case U and the baud = 1/off (or on) pulse duration.
What you can do if timing is out, is use custom baud and adjust value as necessary.
Re: Problems usin SW Chanel of CAL Uart
Posted: Fri May 10, 2019 11:12 am
by CSM2711
you are absolutly right, it seems to be a problem with the timing.
But why?
Re: Problems usin SW Chanel of CAL Uart
Posted: Mon May 13, 2019 7:44 am
by CSM2711
But the question is, is there any way to get the right timing? And whats the reason for the difference?
Re: Problems usin SW Chanel of CAL Uart
Posted: Mon May 13, 2019 8:13 am
by medelec35
Hi,
CSM2711 wrote:But the question is, is there any way to get the right timing?
I did state how I achieve the correct timing in the above post:
medelec35 wrote:I just Send an upper case U and the baud = 1/off (or on) pulse duration.
What you can do if timing is out, is use custom baud and adjust value as necessary.
So just sendString "U"
All the bits will be then the same duration, so you can measure just one pulse width.
For example, if you require a baud of 9600, If the width of a single pulse is 109.9uS
Then baud = 1/109.8 x 10E-6 = 9107 so you know you need to increase the custom baud rate.
CSM2711 wrote:And whats the reason for the difference?
When you select channel that will be by far the best option.
That is because interrupts are used internally with a dedicated baud generator to generate to correct timing.
With software, the data is bitbanged.
The advantages of using Channel:
Far more accurate.
Interrupts don't interfere like it does with software mode.
You can use RX interrupt to capture incoming data, you can't with software.
I always select Channel over Software if I have a choice.