PIC18F25K22 UART ERROR

For general Flowcode discussion that does not belong in the other sections.
SILVESTROS
Posts: 90
http://meble-kuchenne.info.pl
Joined: Tue Dec 13, 2022 9:04 pm
Has thanked: 24 times
Been thanked: 1 time

Re: PIC18F25K22 UART ERROR

Post by SILVESTROS »

Hi,
for now I don't use Excel..I get data normally in terminal , so I'll make some tests with sensors..I'll use 3 sensors ..
I must sent 6 variables to receiver in a string : FSR, X1,Y1,Z1, HR, OX....In Get_Data macro of Tx chart, how can make the chart after gather sensor data to set up all variables in the string data? I'll do it for the first var (FSR), but how for six?...also Rx chart needs modification?
regards

chipfryer27
Valued Contributor
Posts: 1213
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 297 times
Been thanked: 429 times

Re: PIC18F25K22 UART ERROR

Post by chipfryer27 »

Hi

The Rx won't need any modifications as it is just receiving a CSV string and then sending it back out. Whatever string comes in will go straight out.

If you refer back to a Tx chart from earlier in this thread, it shows how to create a CSV string from your sensors. Very important to create a single string with all CSV within, ending with \r\n

With regards to the current Tx chart (that connects to the Rx ESP) :-

Create another User Macro and call it Sensor_Init with all sensor initialisation within. Place this Macro Call near the beginning in Main and certainly before you enter the Loop in Main.

Create another new User Macro called Sample_Sensor and put all your code to gather sensor values in there.

In the User Macro Get_Data I have an empty command block to signify this is where to sample/process your data before it is sent, so change this to a Macro call that points to the new Sample_Sensor.

Hopefully that will now gather your data and send it out.

Regards

chipfryer27
Valued Contributor
Posts: 1213
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 297 times
Been thanked: 429 times

Re: PIC18F25K22 UART ERROR

Post by chipfryer27 »

Hi

My mistake. The post I referred to is in another thread, which I can't seem to find at present.

However, in it we obtained the individual data from each sensor, the using a calculation box we created the required string which contained all data in CSV.

If you can't find the post it's easy to recreate it all.

Regards

SILVESTROS
Posts: 90
Joined: Tue Dec 13, 2022 9:04 pm
Has thanked: 24 times
Been thanked: 1 time

Re: PIC18F25K22 UART ERROR

Post by SILVESTROS »

Hi, and many thanks.
I can't find that ...I try to make Data string , but I get error in compile...
would you like to remind me the calculations ?
regards

chipfryer27
Valued Contributor
Posts: 1213
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 297 times
Been thanked: 429 times

Re: PIC18F25K22 UART ERROR

Post by chipfryer27 »

Hi

If I remember correctly you posted a chart with an accelerometer which returned x/y/z and you also had an oximeter(?).

If you send it again I can either check for what I re-posted or recreate.

Regards

SILVESTROS
Posts: 90
Joined: Tue Dec 13, 2022 9:04 pm
Has thanked: 24 times
Been thanked: 1 time

Re: PIC18F25K22 UART ERROR

Post by SILVESTROS »

Hi,
this is a first chart for sensors ..I add an force sensor , so I'll use 3...FSR, MMA8452 ACCELEROMETER and MAX30100 HR/OXIMETER..
regards
Attachments
ESP8266_STA_PIC18F46K22_SENSORS1.fcfx
(25.08 KiB) Downloaded 66 times

chipfryer27
Valued Contributor
Posts: 1213
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 297 times
Been thanked: 429 times

Re: PIC18F25K22 UART ERROR

Post by chipfryer27 »

Hi

I'll look to see if I have my reply, if not it will be easy to recreate.

Regards

SILVESTROS
Posts: 90
Joined: Tue Dec 13, 2022 9:04 pm
Has thanked: 24 times
Been thanked: 1 time

Re: PIC18F25K22 UART ERROR

Post by SILVESTROS »

Hi,
I was found your reply, it was 24 Feb. 2023 , 9:03 PM...
I was finished TX chart , Data string send and receive ok...but there is delay about 4 sec for a new data update. how can I reduce that time ? what is the reason for that delay and at what chart? I think that it is in TX chart..
regards

chipfryer27
Valued Contributor
Posts: 1213
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 297 times
Been thanked: 429 times

Re: PIC18F25K22 UART ERROR

Post by chipfryer27 »

Hi

I can't find my copy, so if you can send it back I'll have a look.

I might have had a delay in the loop just for testing, and this could be reduced to something more suitable.

Regards

SILVESTROS
Posts: 90
Joined: Tue Dec 13, 2022 9:04 pm
Has thanked: 24 times
Been thanked: 1 time

Re: PIC18F25K22 UART ERROR

Post by SILVESTROS »

Hi,
If you mean a delay in a loop at Main, I set at 100ms, but the delay for data update remains the same..
Also in sensors test I was tested FSR and accelerometer MMA 8452..FSR data ok, but I have 0,0,0 data from MMA8452..
connections in hardware are +3.3V, GND , MMA8452 SDA to pin D1 of PIC, MMA8452 SCL to pin D0 of PIC (CHANNEL2). ..is there something wrong in chart , or about address of MMA8452?
regards
Attachments
ESP-ESP_AP_Tx_v2_18F46K22.fcfx
(36.33 KiB) Downloaded 60 times

Post Reply