i2c macro

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times

i2c macro

Post by saschech@gmx.de »

Hello

I want work with a i2c eeprom 24FC1025

If i take as device id = 0xa0 > write i show 64 instead (160) in all v4.

regards wolfgang
Attachments
i2c.gif
(43.16 KiB) Downloaded 935 times

User avatar
Dan81
Valued Contributor
Valued Contributor
Posts: 268
Joined: Sun Jan 15, 2006 4:07 pm
Location: Albi France
Been thanked: 60 times
Contact:

Re: i2c macro

Post by Dan81 »

Hello Wolfgang

With "Transaction" macros , Device_ID is the "real" I2C address (7 bits) : 0x50 not the control byte 0xA0 (Write) or 0xA1(Read).

(in the code there is a "left shift" and 0xA0 becomes 0x20=64)

Daniel

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times

Re: i2c macro

Post by saschech@gmx.de »

Hello Daniel

ok,but what is the right input for wr or rd the 24FC1025_eeprom??

Regards wolfgang
Attachments
eeprom.gif
(39.14 KiB) Downloaded 915 times

User avatar
Dan81
Valued Contributor
Valued Contributor
Posts: 268
Joined: Sun Jan 15, 2006 4:07 pm
Location: Albi France
Been thanked: 60 times
Contact:

Re: i2c macro

Post by Dan81 »

Hello Wolfgang

If you want to write from 0x 0 0000 to 0x 0 FFFF
try : Send Byte Transaction ( 0x50, hh, ll ,data)

If you want to write from 0x 1 0000 to 0x 1 FFFF
try : Send Byte Transaction ( 0x54, hh, ll ,data)

I suppose that A1 and A0 are connected to GND

I can't test it on hardware.

With "transaction" macros , you'll be able to write (or read) only 1 data at a time.
Sequential read or write could be interesting.

Daniel

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times

Re: i2c macro

Post by saschech@gmx.de »

Hello Daniel

I understand,but ........

Regards wolfgang

Harry Tuttle
Posts: 27
Joined: Sat Aug 01, 2009 3:15 pm
Has thanked: 2 times
Been thanked: 10 times

Re: i2c macro

Post by Harry Tuttle »

Hi,
Is this what you should be seeing s,64,0,0,8,P?
This is version V4 of flow code.
Not sure what is wrong with yours!!!
flowcodeI2C.jpg
(242.09 KiB) Downloaded 2099 times

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times

Re: i2c macro

Post by saschech@gmx.de »

Hello Harry
I look for adresse :
a7 > 8 0
a6 > 0 0
a5 > 2 0
a4 > 0 0
___10 0 > hex 0xa0

The macro work:
a7 > 0 0
a6 > 4 0
a5 > 0 0
a4 > 1 0
____5 0 >hex 0x50 << 1 = 0xa0 = 160
You understand?

Regards Wolfgang
Attachments
i2c adressen.gif
(98.89 KiB) Downloaded 874 times

Post Reply