EEPROM_FLOAT PIC16F1939

For general Flowcode discussion that does not belong in the other sections.
ELECTRONICA67
Posts: 83
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Flowcode v10 EEPROM_FLOAT PIC16F1939

Post by ELECTRONICA67 »

Hello, I would appreciate some help;

I have had some free time and I have been playing with Flowcode 10 and its components, which I see have added features that they did not have in previous versions, some features such as the 16x2 display, EEPROM, which added writing and reading in float, long, INT I made a small flowchart that reads a FLOAT number and then writes it to the EEPROM memory and reads it when required; add 2 switches, one reads a number with 6 decimal places and the second switch reads another number with 6 decimal places also but negative; I have a GPS that I want to improve and record locations at different times, to later check the places visited, but after recording the numbers in the EEPROM to later read them, one reads the recorded number, but the second changes to a different number; I send the flowchart. I would appreciate if you can see it and help me; I assume that using variables in FLOAT the number is read directly and with that same variable it is recorded in the EEPROM, I looked for an example, but in FLOAT I found nothing.

I appreciate any help in advance.

Enrique
Thanks
Attachments
EEPROM_FLOAT.fcfx
Flowchart EEPROM_FLOAT
(24.71 KiB) Downloaded 17 times

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: EEPROM_FLOAT PIC16F1939

Post by chipfryer27 »

Hi

I can only run in simulation, and after storing variables Lat / Long in EEPROM I set them to zero before reading back to check what was being returned.

Simulation debugger displayed as expected.

When switch A0 is active the Lat is displayed at position 0/1 of your display. When switch A1 is active Long is displayed at position 0/1 of your display thereby overwriting the previously displayed Lat value.

Perhaps change the position of Lat to 0/0 ?

Regards

ELECTRONICA67
Posts: 83
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Re: EEPROM_FLOAT PIC16F1939

Post by ELECTRONICA67 »

Hello Chipfryer27,

in the simulation it also sends numbers different from those recorded in the EEPROM, it sends images of the numbers recorded in the EEPROM and later read; The number recorded in address 0 changed the value when it was read, the number recorded in address 1 remained the same.

Enrique
Attachments
Read1.jpg
Read1.jpg (38.51 KiB) Viewed 303 times
Write1.jpg
Write1.jpg (42.79 KiB) Viewed 303 times

ELECTRONICA67
Posts: 83
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Flowcode v10 Re: EEPROM_FLOAT PIC16F1939

Post by ELECTRONICA67 »

imagen
Attachments
Write2.jpg
Write2.jpg (40.66 KiB) Viewed 303 times
Read2.jpg
Read2.jpg (43.75 KiB) Viewed 303 times

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: EEPROM_FLOAT PIC16F1939

Post by chipfryer27 »

Hi

Hmm.... Using a different machine I'm now getting the same results as you. I may have not noticed it earlier though........

Everything is fine until you read from eeprom in your branch (if Inicio = 1).

I'll see what I get in hardware when I get a chance.

Regards

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: EEPROM_FLOAT PIC16F1939

Post by medelec35 »

Hello.
You will need to remember that a float is 4 bytes.
If each address of EEPROM can only hold a byte, then you need to allow 4 addresses for each float variable.
It seems like you are corrupting EEPROM addresses reserved for LAT with values of LONG

Try setting LAT to address 0 and LONG to Address 4
Martin

ELECTRONICA67
Posts: 83
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Re: EEPROM_FLOAT PIC16F1939

Post by ELECTRONICA67 »

Hi,

Yesterday I did that test, I recorded at address 0, 3, 7, 11; But it does not work

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: EEPROM_FLOAT PIC16F1939

Post by medelec35 »

Try again 0, 4 etc not 0, 3
Martin

ELECTRONICA67
Posts: 83
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Re: EEPROM_FLOAT PIC16F1939

Post by ELECTRONICA67 »

Hi Martin,

Maybe I'm missing one more direction; 0, 4, 8, 12... . I will do another test with those addresses; A problem that continues to persist is that the GPS takes too long to connect to a satellite; Now I have had it connected for 1 hour and 40 minutes and it still cannot connect.

ELECTRONICA67
Posts: 83
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 20 times
Been thanked: 6 times

Flowcode v10 Re: EEPROM_FLOAT PIC16F1939

Post by ELECTRONICA67 »

I'm just waiting for the GPS to connect so it can show me the coordinates and do the tests. Flowchart shipping.
Attachments
TEST1939v10a.fcfx
FLOWCHART
(26.63 KiB) Downloaded 8 times
GPS.jpg
GPS.jpg (44.06 KiB) Viewed 284 times

Post Reply