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?
Problems usin SW Chanel of CAL Uart
Moderator: Benj
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Problems usin SW Chanel of CAL Uart
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?
Do you have a scope to verify this?
Can you post your flowchart, so we can see if anything looks amiss?
Martin
-
- Posts: 47
- Joined: Mon Apr 16, 2018 10:28 am
- Location: Germany
- Has thanked: 1 time
- Been thanked: 9 times
- Contact:
Re: Problems usin SW Chanel of CAL Uart
ok , i have tes with a small testprogramm, it looks like something is wrong with the timitng ......
i will try to measure it.....
i will try to measure it.....
- Attachments
-
- rs232_1827_on.fcfx
- (16.55 KiB) Downloaded 150 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Problems usin SW Chanel of CAL Uart
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.
What you can do if timing is out, is use custom baud and adjust value as necessary.
Martin
-
- Posts: 47
- Joined: Mon Apr 16, 2018 10:28 am
- Location: Germany
- Has thanked: 1 time
- Been thanked: 9 times
- Contact:
Re: Problems usin SW Chanel of CAL Uart
you are absolutly right, it seems to be a problem with the timing.
But why?
But why?
- Attachments
-
- cal_uart.JPG (52.21 KiB) Viewed 2964 times
-
- Posts: 47
- Joined: Mon Apr 16, 2018 10:28 am
- Location: Germany
- Has thanked: 1 time
- Been thanked: 9 times
- Contact:
Re: Problems usin SW Chanel of CAL Uart
But the question is, is there any way to get the right timing? And whats the reason for the difference?
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Problems usin SW Chanel of CAL Uart
Hi,
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.
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.
I did state how I achieve the correct timing in the above post:CSM2711 wrote:But the question is, is there any way to get the right timing?
So just sendString "U"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.
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.
When you select channel that will be by far the best option.CSM2711 wrote:And whats the reason for the difference?
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.
Martin