| View previous topic :: View next topic |
| Author |
Message |
Jean FOUGERON
Joined: 30 Nov 2012 Posts: 110 Location: France
|
|
Posted: Tue Feb 05, 2013 8:44 am |
|
|
You know, this only is a test board, on the project board the adresses are fixed (direct to Gnd and Vcc via a Resistor) and grows as soon as supply.
But it does'nt work anymore !
I wrote a routine to scan which adresses are present on the board (in reality there are 4) and it finds only 3
No, I go too far : it finds 4 one time every 15 days !
| Code: | void testIC()
{
int I_Adress;
s_alarm(TRUE); // show the test begins
Efface_Tout(); // put all the outputs to low
for (I_Adress=0x40; I_Adress<0x50;I_Adress+=2)
{
Monitor_D3(); // show the next adress
i2c_start();
i2c_write(I_Adress);
i2c_write(OUTPUT);
i2c_write(0xFF); // put output to high
i2c_write(0xFF);
i2c_stop();
delay_ms(50);
if(!B_NoLed) // output current measured => It's OK
{
UART_Trace_Adress[i++]=I_Adress; // memorise this "good" adress
Monitor_D2();
}
delay_ms(50);
i2c_start();
i2c_write(I_Adress);
i2c_write(OUTPUT);
i2c_write(0x00); // put back output to low
i2c_write(0x00);
i2c_stop();
delay_ms(400);
}
s_alarm(FALSE); // show the test terminates
BLEU_D2(FALSE); // afterward, send all the good adress list via UART
BLEU_D3(FALSE);
} |
|
|
 |
temtronic
Joined: 01 Jul 2010 Posts: 9658 Location: Greensville,Ontario
|
|
Posted: Tue Feb 05, 2013 10:43 am |
|
|
I had a quick look at the spec sheets of both parts and don't think you can have an 'active programmable address' via the PIC.
I think the 'internal I2C state machine' of the IC is ...upon reset,read the address pins, then configure the I2C 'machine' for that address.In order to change the devices address, you'ld have to power down the chip.
It'd be a simple test to have the PIC control Vcc to the device via a FET or high side driver.
hth
jay |
|
 |
Jean FOUGERON
Joined: 30 Nov 2012 Posts: 110 Location: France
|
|
Posted: Tue Feb 05, 2013 11:07 am |
|
|
| temtronic wrote: | you'ld have to power down the chip.
It'd be a simple test to have the PIC control Vcc to the device via a FET or high side driver. |
Thanks
it is exactly what it is done on my test panel
Ttelmah says that applying Vcc on ADx when the IC is not supplied is not a good idea, and I think he is right, but ... I have not found yet a simplest solution for the time being.
On the project panel, the IC's are connected conventionally
Do you think TCA9535 is better than PCA9535 ?
( http://e2e.ti.com/support/logic/f/151/t/88941.aspx ) |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20161
|
|
Posted: Tue Feb 05, 2013 12:00 pm |
|
|
| temtronic wrote: | I had a quick look at the spec sheets of both parts and don't think you can have an 'active programmable address' via the PIC.
I think the 'internal I2C state machine' of the IC is ...upon reset,read the address pins, then configure the I2C 'machine' for that address.In order to change the devices address, you'ld have to power down the chip.
It'd be a simple test to have the PIC control Vcc to the device via a FET or high side driver.
hth
jay |
Exactly.
The device reads the pins as it's power comes up, and most certainly does _not_ expect power to be on it's pins before the supply rises. If you note, the device won't reset unless it's supply pin goes down to only a tiny fraction of a volt. I'm thinking that with the address pins powered, this is not reliably happening, the internal protection is serving to keep some power on the device, and preventing the device initialising properly.
As I said, I have used this device, and with simple jumpers selecting the addresses (in fact for me, two of the bits fixed, and just one bit selectable between the four possible states), it merrily worked for me.
Best Wishes |
|
 |
Jean FOUGERON
Joined: 30 Nov 2012 Posts: 110 Location: France
|
|
Posted: Wed Feb 06, 2013 3:48 am |
|
|
OK
OK
This morning I tried on the application board where the IC's are "hard-connected"
IC2 0x40 OK
IC3 0x42 OK
IC4 0x48 OK
IC5 0x4A not OK
I tried all the adresses for IC5 and the result is :
0x40 OK
0x42 OK
0x44 not OK
0x46 not OK
0x48 OK
0x4A not OK
0x4C not OK
0x4E not OK
However I checked all the pins and they are correctly connected (of course otherwise it would not work at 0x40, 0x42 and 0x48)
"I loose my latin" (French expression) |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20161
|
|
Posted: Wed Feb 06, 2013 4:45 am |
|
|
One possibility is that you have damaged the chip.
The address inputs on them is complex. Given each can detect four possible connection patterns, I'd suspect applying power to them, with the chip powered off, has done damage....
Best Wishes |
|
 |
Jean FOUGERON
Joined: 30 Nov 2012 Posts: 110 Location: France
|
|
Posted: Wed Feb 06, 2013 4:56 am |
|
|
| Ttelmah wrote: | One possibility is that you have damaged the chip.
|
I have tried with 2 different ON IC's and one NXP, on 2 different prototypes panels
| Ttelmah wrote: | Given each can detect four possible connection patterns, I'd suspect applying power to them, with the chip powered off, has done damage....
|
This have been done on another panel, mounted specialy for that. |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20161
|
|
Posted: Wed Feb 06, 2013 4:59 am |
|
|
Seriously, back to my previous comment. Try PCM programmer's scanner.
Select one of the patterns you are finding to not work. Run this. I'd bet you are going to find the chip is there, but at another address. Then look in the data sheet at what pattern of connections is needed to select this address.
Look at your patterns. Except for one (4A) - possibly an error, the ones that fail are the ones with Vdd on AD1.....
Best Wishes |
|
 |
Jean FOUGERON
Joined: 30 Nov 2012 Posts: 110 Location: France
|
|
Posted: Wed Feb 06, 2013 9:38 am |
|
|
I am afraid I have found from where the problem came (on the application panel)
I am rather shamely of it
So I will not tell it (think something like the difference between < and <=)
Thanks everybody for your help |
|
 |
|