Page 1 of 4
I2C test
Posted: Mon Sep 30, 2024 12:09 pm
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!
Re: I2C test
Posted: Mon Sep 30, 2024 1:18 pm
by stefan.erni
Hi Samtin
Which eeprom you are using?
regards
Stefan
Re: I2C test
Posted: Mon Sep 30, 2024 1:53 pm
by samtin
Hi,
I use 24LC512
Re: I2C test
Posted: Mon Sep 30, 2024 3:39 pm
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.
Re: I2C test
Posted: Mon Sep 30, 2024 4:15 pm
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.
Re: I2C test
Posted: Mon Sep 30, 2024 4:48 pm
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
Re: I2C test
Posted: Mon Sep 30, 2024 5:35 pm
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.
Re: I2C test
Posted: Mon Sep 30, 2024 8:08 pm
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
Re: I2C test
Posted: Tue Oct 01, 2024 10:10 am
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.
Re: I2C test
Posted: Tue Oct 01, 2024 10:17 am
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?