I2C test

For general Flowcode discussion that does not belong in the other sections.
samtin
Posts: 47
http://meble-kuchenne.info.pl
Joined: Sat Jul 10, 2021 2:43 pm
Has thanked: 12 times
Been thanked: 6 times

I2C test

Post by samtin »

Hi everyone,
I'm trying to create a flowchart in Flowcode 10 that works according to the "3. EEPROM read and write V3" flowchart, but it doesn't work. Please help me.
All the best!
Attachments
test eeprom.fcfx
(19.6 KiB) Downloaded 171 times
I2C test.jpg
I2C test.jpg (64.49 KiB) Viewed 6618 times

stefan.erni
Valued Contributor
Posts: 1002
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 191 times
Been thanked: 217 times

Re: I2C test

Post by stefan.erni »

Hi Samtin

Which eeprom you are using?

regards

Stefan

samtin
Posts: 47
Joined: Sat Jul 10, 2021 2:43 pm
Has thanked: 12 times
Been thanked: 6 times

Re: I2C test

Post by samtin »

Hi,
I use 24LC512

stefan.erni
Valued Contributor
Posts: 1002
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 191 times
Been thanked: 217 times

Re: I2C test

Post by stefan.erni »

Hi Samtin

You can test with the component from Flowcode

search for "24LC512" and drag and trop it.

This is comfortable to use.
Attachments
2024-09-30_16-34-40.PNG
2024-09-30_16-34-40.PNG (51.19 KiB) Viewed 6584 times

samtin
Posts: 47
Joined: Sat Jul 10, 2021 2:43 pm
Has thanked: 12 times
Been thanked: 6 times

Re: I2C test

Post by samtin »

Hi Stefan,
I tried and it gives an error, below is the Flowcode message:
Microchip MPLAB XC8 C Compiler V2.10
Build date: Jul 30 2019
Part Support Version: 2.10
Copyright (C) 2019 Microchip Technology Inc.
test eeprom copy.c: 519: (1250) could not find space (130 bytes) for variable _FCL_BUFF
(908) exit status = 1
(908) exit status = 1

Error returned from [xc8.exe]

C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\PIC\batch\pic_xc8_comp.bat reported error code 0x1

Autoclose turned off


FINISHED

I am using PIC16F877A.

mnfisher
Valued Contributor
Posts: 1462
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 135 times
Been thanked: 713 times

Re: I2C test

Post by mnfisher »

This is a continuation from the old forum. The MCU doesn't have enough RAM for the component to work.

See https://www.flowcode.co.uk/mmforums/vie ... 62#p108662

If I get a chance this evening I'll try making a 'sawn-off' version of the component without the Write/Read page functions.

Martin

samtin
Posts: 47
Joined: Sat Jul 10, 2021 2:43 pm
Has thanked: 12 times
Been thanked: 6 times

Re: I2C test

Post by samtin »

Hi,
It seems that there is no more activity on the old forum, but there it was discussed and developed program sequences for I2C and eeprom, both of which interest me, to be able to use Flowcode 10 for both I2C and eeprom. To create or modify a component, I have already begun to study and understand how to proceed for a good result so that in the future I can create a component for flowcode, I am aware that this will take some time, that is why I am asking for help from those who have enough experience and who plays with something like that. Whenever you can, help me to make the presented flowchart work.

mnfisher
Valued Contributor
Posts: 1462
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 135 times
Been thanked: 713 times

Re: I2C test

Post by mnfisher »

Yes - definitely a more lively forum here.

Cut the component down to it's bare minimum. Read and Write. It should compile - and I've tested on an Arduino and it works there...

To install:

1) Save the .fcpx file to a directory - point FC at this in Build->Customise->Locations->Search for components in. Close and re-open FC.
2) Search for the component (it's called EEPROM (24LC5212) Minimal)
3) Use Read and Write. Note that i2c requires pull-up resistors on SDA and SCL

You'll need to add some code to display the values. Let us know how it goes :-)

I probably should have renamed the component source code ?

Martin
Attachments
eeprom512_min.fcpx
(4.33 KiB) Downloaded 175 times
eeprom(1).fcfx
(9.4 KiB) Downloaded 184 times
FC_Comp_Source_Serial_EEPROM_(24LC512).fcfx
(30.56 KiB) Downloaded 181 times

samtin
Posts: 47
Joined: Sat Jul 10, 2021 2:43 pm
Has thanked: 12 times
Been thanked: 6 times

Re: I2C test

Post by samtin »

Hi Martin,
First of all, I have to thank you for your help. This time it compiled, but it doesn't store, it seems, because it displays 255. In Flowcode it simulates correctly, but it also simulates correctly with the Flowcode component unmodified, only it doesn't compile. Always the pull-up resistors are connected, I also pay great attention to the connections between the microcontroller and other components such as this eeprom.
Attachments
fc.png
fc.png (217.64 KiB) Viewed 6503 times
eep_min.jpg
eep_min.jpg (73.79 KiB) Viewed 6503 times

mnfisher
Valued Contributor
Posts: 1462
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 135 times
Been thanked: 713 times

Re: I2C test

Post by mnfisher »

Odd, it is just the component - I've not modified it, just deleted the page functions...


Do you have a logic analyser - take a look at what is on the i2c.

You don't have the 'protect' pin pulled high by mistake?

Post Reply