Hi
Love and respect from Istanbul to everyone.
When communicating with UART; I can send data but not read data.
Can you help me please?
PIC18F26K22 Not reading data UART [SOLVED]
Moderator: Benj
- celebriums
- Posts: 125
- Joined: Sun Sep 25, 2016 3:50 pm
- Has thanked: 71 times
- Been thanked: 33 times
- Contact:
PIC18F26K22 Not reading data UART [SOLVED]
- Attachments
-
- PIC_WIFI_V1 only wifi.fcfx
- (21.09 KiB) Downloaded 136 times
Last edited by celebriums on Tue Sep 21, 2021 9:26 am, edited 1 time in total.
-
- 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: PIC18F26K22 Not reading data UART
Hi Sadık,
For reliable UART RX communication, You will be best using UART RXINT0 interrupt.
You can then place the UART ReceieveString with the interrupt call macro.
For reliable UART RX communication, You will be best using UART RXINT0 interrupt.
You can then place the UART ReceieveString with the interrupt call macro.
Martin
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: PIC18F26K22 Not reading data UART
Hi Sadık
Check the length of Your STR_Receive it's just 80 but You wait for 100Bytes.
Change the waiting time.
In the loop use a delay (1mSec)
Use a text to display in the decision under yes, like "receive ok" then You know reciving ist ok but the ASCII are bad.
Try to use what Martin told an IRQ is always the best way.
regards
Stefan
Check the length of Your STR_Receive it's just 80 but You wait for 100Bytes.
Change the waiting time.
In the loop use a delay (1mSec)
Use a text to display in the decision under yes, like "receive ok" then You know reciving ist ok but the ASCII are bad.
Try to use what Martin told an IRQ is always the best way.
regards
Stefan
- celebriums
- Posts: 125
- Joined: Sun Sep 25, 2016 3:50 pm
- Has thanked: 71 times
- Been thanked: 33 times
- Contact:
Re: PIC18F26K22 Not reading data UART
Thank you for the replies.
@stefan.erni
@medelec35
But I tried everything you said. The result has not changed.
I have set the Led to stay on if any data comes in.
I can see incoming and outgoing data via UART to USB converter. But the PIC cannot see any of these data.
Pictures of incoming and outgoing data to PIC from ESP8266 are attached.
In addition, if I choose the configuration of the UART module as software instead of channel 1, a compilation error occurs.
Data sent by ESP to PIC outgoing data from PIC (Data from PIC to ESP )
@stefan.erni
@medelec35
But I tried everything you said. The result has not changed.
I have set the Led to stay on if any data comes in.
I can see incoming and outgoing data via UART to USB converter. But the PIC cannot see any of these data.
Pictures of incoming and outgoing data to PIC from ESP8266 are attached.
In addition, if I choose the configuration of the UART module as software instead of channel 1, a compilation error occurs.
Data sent by ESP to PIC outgoing data from PIC (Data from PIC to ESP )
- Attachments
-
- PIC_WIFI_V2 only wifi.fcfx
- (22.44 KiB) Downloaded 136 times
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: PIC18F26K22 Not reading data UART
Hi Sadık
I compiled your program and the error was like this
So if I go down with the Baudrate to 19200 I can compile with softwaremode uart.
Try if its working to receive some byte.
regards
I compiled your program and the error was like this
(103) #error: "Software UART Baud Rate Not Available At This Clock Speed" ^
So if I go down with the Baudrate to 19200 I can compile with softwaremode uart.
Try if its working to receive some byte.
regards
- celebriums
- Posts: 125
- Joined: Sun Sep 25, 2016 3:50 pm
- Has thanked: 71 times
- Been thanked: 33 times
- Contact:
Re: PIC18F26K22 Not reading data UART
Hello dear friends...
Hello flowcode family
Everybody greeatings from istanbul
I found the error about the software. Since the B5 pin is 0, communication reading stops.
Once I did the B5, all settings went back to normal.
Thank you to all those who showed interest, replied and read.
Hello flowcode family
Everybody greeatings from istanbul
I found the error about the software. Since the B5 pin is 0, communication reading stops.
Once I did the B5, all settings went back to normal.
Thank you to all those who showed interest, replied and read.