LM75b address question (closed)

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
viktor_au
Posts: 342
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 44 times
Been thanked: 60 times
Contact:

LM75b address question (closed)

Post by viktor_au »

It does not matter what address I set on the sensor,
FC8 LM75b component only reads the sensor by using the address 0.
--------------------------------------------------------------------------------------

When I use the LM75b sensor (in FC8) with the FC8 component (macro) address=0 the sensor does the job.
However it does this job with the sensor address being set to 10010011 = decimal 147, or basically any other i2c address.
---------------------------------------
Where: 1001 is the fixed part.
001 is the A2=0, A1=0, A0=1
and the last bit as 1 is the read bit.
----------------------------------------
When I change the FC8 component (macro) address to 147 the sensor is not seen by FC8.
By changing the FC8 component (macro) address back to 0 returns the sensor to work.

Can somebody help?
Thank you.
Attachments
ReadAtAddr0-1.jpg
ReadAtAddr0-1.jpg (19.47 KiB) Viewed 3119 times
Last edited by viktor_au on Sat May 11, 2019 9:07 am, edited 1 time in total.

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: LM75b address question

Post by LeighM »

Have you tried address 73?

mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: LM75b address question

Post by mnf »

hi Viktor,

You have the wrong address - Should be 1001abc (not 10010abc) - So 72 to 79 are possible addresses (note that FC sometimes expects the shifted value - so 2 x this but will always be even)

Martin

viktor_au
Posts: 342
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 44 times
Been thanked: 60 times
Contact:

Re: LM75b address question

Post by viktor_au »

LeighM wrote:Have you tried address 73?
When I use the address 73 for LM75b component (oil) the simulation for this component does not work in FC8.
Attachments
TwoSensorsSim_1.jpg
TwoSensorsSim_1.jpg (44.64 KiB) Viewed 3091 times

viktor_au
Posts: 342
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 44 times
Been thanked: 60 times
Contact:

Re: LM75b address question

Post by viktor_au »

mnf wrote: You have the wrong address - Should be 1001abc (not 10010abc) - So 72 to 79 are possible addresses (note that FC sometimes expects the shifted value - so 2 x this but will always be even)
I thought I have to use:
1001 + abc + the last bit (read/write)

This is wrong, is not it?
-------------------------------------------
I think you right: Address is 7bit, not 8 bit. The 8th bit is write/read bit

viktor_au
Posts: 342
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 44 times
Been thanked: 60 times
Contact:

Re: LM75b address question

Post by viktor_au »

I had to remove the LM75b component(s) and I used the i2c CAL components. One for LM75b1 and one for LM75b2.
As I have two LM75b sensors I have to use two i2c addresses.
After I soldered the first sensor A2=0,A1=0,A0=1 the address is: 1001001 decimal=73
After I soldered the 2nd sensor A2=1,A1=0,A0=0 the address is: 1001100 decimal=76
------------------
Example of i2c address for LM75b1

Before we read sensor we have to write to it by
73 << 1
73 * 2 = 146
Example: to write to LM75b with an address 73, we must actually send out 146 which is 73 moved over by 1 bit. Enable the device and set it to write mode. Our devices addr=73. We need to shift message << 1 to clear the LSB. In 8 bits or in 1 byte MSB is on right, and LSB is on left. LSB has info in this message -- read/write mode.
-------------------
Note: to read from LM75b with an addr 73 we need -

Read bit high = 1 (means = master reads slave)
odd address = 147 or 10010011
--------------------------
After that FC8 does a job and two sensors work.
-------------------------
PS
There is one problem: no simulation during the FC8 programming.

Post Reply