Hi
I see you have set the chip to run on it's internal oscillator. For this to work you also need to include a C-Code block as your first icon in your chart to set the associated register. If you add in Component Libraries > Runtime > IntOsc Helper this will assist in creating the required code. You can copy & paste the suggested code directly into your C-code block. The WDT was enabled but no "clears" were present so the chip would reset itself every x-seconds. I disabled this for your tests.
I also removed the connection points as they at present are not required, the Loop itself will increment and populate.
Your variables a/k/x are floating point, however you forgot to initialise them as such ( "0.0" )
When sending to Excel, I found you need to terminate with \r\n or else you end up with a very long string.
I modified your chart based on the above (attached).
Hope this helps.
Regards
PIC18F25K22 UART ERROR
-
- Valued Contributor
- Posts: 1605
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 357 times
- Been thanked: 565 times
-
- Posts: 123
- Joined: Tue Dec 13, 2022 9:04 pm
- Has thanked: 32 times
- Been thanked: 2 times
Re: PIC18F25K22 UART ERROR
Hi ,
I made some tests with last FC charts , ESP-ESP_AP_RX and ESP-ESP_AP_TX . I get no data from sender so far.
In sender, as it seems in simulator, there is no sending data to receiver ..I don't change dummy data before get that in receiver and then to PC...receiver send data to Excel with PIC18F25K22 after corrections, so I think the problem is maybe in sender..
I made some tests with last FC charts , ESP-ESP_AP_RX and ESP-ESP_AP_TX . I get no data from sender so far.
In sender, as it seems in simulator, there is no sending data to receiver ..I don't change dummy data before get that in receiver and then to PC...receiver send data to Excel with PIC18F25K22 after corrections, so I think the problem is maybe in sender..
- Attachments
-
- ESP-ESP_AP_Rx.fcfx
- (30.88 KiB) Downloaded 458 times
-
- ESP-ESP_AP_Tx.fcfx
- (20.57 KiB) Downloaded 532 times
-
- Valued Contributor
- Posts: 1605
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 357 times
- Been thanked: 565 times
Re: PIC18F25K22 UART ERROR
Hi
Watchdog Timer is set in both your charts therefore they will be resetting the chips every x-seconds. Disable both in Build>Project Options.
Lets focus on the Rx side first.
Do you have a serial-usb convertor? If so refer to the diagram I sent earlier. Connect the Rx pin of the adapter to the Tx pin of UART2 (the one facing the PC). Set your terminal program for 9600 baud and connect.
Boot/reboot the Rx PIC. Do you see anything appear in your terminal program? You should receive "Test OK". If not double check all connections and settings as there really isn't much to go wrong at this stage.
Regards
Watchdog Timer is set in both your charts therefore they will be resetting the chips every x-seconds. Disable both in Build>Project Options.
Lets focus on the Rx side first.
Do you have a serial-usb convertor? If so refer to the diagram I sent earlier. Connect the Rx pin of the adapter to the Tx pin of UART2 (the one facing the PC). Set your terminal program for 9600 baud and connect.
Boot/reboot the Rx PIC. Do you see anything appear in your terminal program? You should receive "Test OK". If not double check all connections and settings as there really isn't much to go wrong at this stage.
Regards
-
- Posts: 123
- Joined: Tue Dec 13, 2022 9:04 pm
- Has thanked: 32 times
- Been thanked: 2 times
Re: PIC18F25K22 UART ERROR
Hi,
I was checked connections...are ok..with set watchdog timer enabled , after boot/reboot I have test OK after 2min and every 2min...with set watchdog timer disabled, I have no test OK...
regards
I was checked connections...are ok..with set watchdog timer enabled , after boot/reboot I have test OK after 2min and every 2min...with set watchdog timer disabled, I have no test OK...
regards
-
- Valued Contributor
- Posts: 1605
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 357 times
- Been thanked: 565 times
Re: PIC18F25K22 UART ERROR
Hi
Good and bad
Good it did something expected, bad not exactly what was expected...
Keep WDT disabled. The fact that you are getting the message repeated shows that the WDT is working as it is resetting the PIC every x-seconds, and as you see the message, connections / speeds are fine.
When you boot, pretty much immediately the "Test OK" will be sent out on the UART, so it could be easy to miss. Keep your terminal program connected when you reboot/power cycle chip and you should see the message.
Do you have a display connected?
Regards
Good and bad

Good it did something expected, bad not exactly what was expected...
Keep WDT disabled. The fact that you are getting the message repeated shows that the WDT is working as it is resetting the PIC every x-seconds, and as you see the message, connections / speeds are fine.
When you boot, pretty much immediately the "Test OK" will be sent out on the UART, so it could be easy to miss. Keep your terminal program connected when you reboot/power cycle chip and you should see the message.
Do you have a display connected?
Regards
-
- Posts: 123
- Joined: Tue Dec 13, 2022 9:04 pm
- Has thanked: 32 times
- Been thanked: 2 times
Re: PIC18F25K22 UART ERROR
Hi,
no display connected...I'll try to connect a general 4X20 that I have...but can it works with V+ 3,3V ?..
if connects , how can use that for test?
regards
no display connected...I'll try to connect a general 4X20 that I have...but can it works with V+ 3,3V ?..
if connects , how can use that for test?
regards
-
- Valued Contributor
- Posts: 1605
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 357 times
- Been thanked: 565 times
Re: PIC18F25K22 UART ERROR
Hi
In case you don't have a display I modified the Receiver to send out on the UART. We know you can see info coming out so hopefully this will assist a bit more.
Also, in your Send program I see you have set the server address as 28.0.0.0 this needs to be the same address displayed on the receiver (or sent out on UART to PC in this version).
Hope this helps.
Regards
In case you don't have a display I modified the Receiver to send out on the UART. We know you can see info coming out so hopefully this will assist a bit more.
Also, in your Send program I see you have set the server address as 28.0.0.0 this needs to be the same address displayed on the receiver (or sent out on UART to PC in this version).
Hope this helps.
Regards
- Attachments
-
- ESP-ESP_AP_Rx_UART-Out.fcfx
- (27.87 KiB) Downloaded 460 times
-
- Posts: 123
- Joined: Tue Dec 13, 2022 9:04 pm
- Has thanked: 32 times
- Been thanked: 2 times
Re: PIC18F25K22 UART ERROR
Hi,
some corrections in sender hardware and continue tomorrow...many thanks .
regards
some corrections in sender hardware and continue tomorrow...many thanks .
regards
-
- Posts: 123
- Joined: Tue Dec 13, 2022 9:04 pm
- Has thanked: 32 times
- Been thanked: 2 times
Re: PIC18F25K22 UART ERROR
Hi,
first test with (ESP_ESP_AP_Rx_UART_Out)...with sender connected (ESP-ESP_AP_Tx), I get the following
Start fail UART Test OK
Initialise ESP
ESP OK
Create AP
AP Created
Get ESP Server IP
IP=192.168.4.1
Start Server Start OK Waiting for Data..
it seems that sender don't send data...wrong IP in sender code?
regards
first test with (ESP_ESP_AP_Rx_UART_Out)...with sender connected (ESP-ESP_AP_Tx), I get the following
Start fail UART Test OK
Initialise ESP
ESP OK
Create AP
AP Created
Get ESP Server IP
IP=192.168.4.1
Start Server Start OK Waiting for Data..
it seems that sender don't send data...wrong IP in sender code?
regards
- Attachments
-
- ESP-ESP_AP_Tx.fcfx
- (20.58 KiB) Downloaded 524 times
-
- ESP-ESP_AP_Rx_UART-Out.fcfx
- (29.16 KiB) Downloaded 541 times
-
- Valued Contributor
- Posts: 1605
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 357 times
- Been thanked: 565 times
Re: PIC18F25K22 UART ERROR
Hi
I have to have a quick smile. Clearly I need to have less beer when I punctuate based on your UART output...
I shall tidy that up later.
However the good news is that you are pretty much there.
The UART is showing that your Server IP is 192.168.4.1 and this address must be set in the PIC used to Send the data.
In the Tx unit remember to set your SSID, Password and Server address (in this case 192.168.4.1) and also to disable the WDT.
Boot Rx unit before Tx unit as just now, if the Tx tries to connect before the Rx is ready it will fail. The Rx will take longer to boot. Perhaps wait until the "waiting for data" is sent out on UART before booting Tx.
Whilst the Tx is connecting you will see in the Rx UART connection details, then once established the data will appear.
Regards
I have to have a quick smile. Clearly I need to have less beer when I punctuate based on your UART output...

I shall tidy that up later.
However the good news is that you are pretty much there.
The UART is showing that your Server IP is 192.168.4.1 and this address must be set in the PIC used to Send the data.
In the Tx unit remember to set your SSID, Password and Server address (in this case 192.168.4.1) and also to disable the WDT.
Boot Rx unit before Tx unit as just now, if the Tx tries to connect before the Rx is ready it will fail. The Rx will take longer to boot. Perhaps wait until the "waiting for data" is sent out on UART before booting Tx.
Whilst the Tx is connecting you will see in the Rx UART connection details, then once established the data will appear.
Regards