View previous topic :: View next topic |
Author |
Message |
mohammad_robotic
Joined: 10 Nov 2013 Posts: 4
|
mlx90614 address config |
Posted: Mon Jun 01, 2015 5:29 am |
|
|
hi
I write code for mlx90614 in i2c mode and I can get data from a single sensor but I dont know how to set address for 4 sensors.
can you help me with a sample code?
Notice! I read datasheet and application note carefully.
hardware: pic16f877a
software: ccs compiler |
|
|
RF_Developer
Joined: 07 Feb 2011 Posts: 839
|
Re: mlx90614 address config |
Posted: Mon Jun 01, 2015 6:49 am |
|
|
mohammad_robotic wrote: |
Notice! I read datasheet and application note carefully.
|
In that case you'll already have seen on page 14 and elsewhere that these devices have a programmable address. They all come with the same default address, and you have to program them with the required address. You cannot do this in a system with multiple sensors as they would clash and get confused. You have to do it one by one before fitting them to the final system. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19496
|
|
Posted: Mon Jun 01, 2015 7:33 am |
|
|
Opcode 0x2E.
Ideally you need a separate little programmer unit, into which you can plug the chips, and then write to this location (0xE in the EEPROM). Be careful to choose 'legal' addresses. Avoid addresses starting with 0, and with 0xF. |
|
|
mohammad_robotic
Joined: 10 Nov 2013 Posts: 4
|
|
Posted: Mon Jun 01, 2015 1:08 pm |
|
|
so i should change address
but what should i write in a blank address like 0xB7??? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19496
|
|
Posted: Mon Jun 01, 2015 1:22 pm |
|
|
8bit addresses, are always a 'pair', on an even address. Even address = write. Odd address = read. You cannot use B7, the base must be even.
What you use is dependent on what else is on the bus. Draw a little table listing what you have on the bus. If there is nothing else, then use the default address already programmed as the first, and then use default+2, default+4 & default+6, as logical places to put the other chips. |
|
|
mohammad_robotic
Joined: 10 Nov 2013 Posts: 4
|
|
Posted: Wed Jun 03, 2015 5:43 am |
|
|
thanks a lot
I did the change and I got result
with the best wishes for all of the members |
|
|
|