CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Have you ever heard of such a thing ?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Jean FOUGERON



Joined: 30 Nov 2012
Posts: 110
Location: France

View user's profile Send private message Visit poster's website

Have you ever heard of such a thing ?
PostPosted: Mon Feb 04, 2013 8:01 am     Reply with quote

Hi friends
I know, it is not a software problem, but a hardware one. It makes me angry as I am blocked on it since months, without answer of manufacturers.
Does anybody know somebody who can help me ?
PLEEEAAAASE

The story is :
I use, in my application, the GPIO PCA9655E from ON Semi or PCA9535 form NXP/Philips.
This IC is pilot via I2C bus and has its own address fixed with 3 pins
I cannot use all the possible addresses allowed in the data sheet. Only 4 of them work !
I have built a test board on which I test each address allowed (apply address combination on pins, apply supply voltage, send I2C command, see result) and only 4 of them work.

Thank you
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Mon Feb 04, 2013 8:12 am     Reply with quote

Remember this uses 7bit addresses. The address byte needed for a particular pattern on the bits, is twice the number given in the data sheet.
Then study the sheet, The pattern needed are not simple high/low wiring, they require the address pins to be cross wired to SCL, SDA, Vdd and GND. Four different connections for each pin. Using just Vdd and GND, would give just eight possible addresses.
I have used these, and the addresses do work.
Remember the extra loads on SCL and SDA, mean the pull up resistors on these have to be a little lower than is otherwise needed.

Best Wishes
Jean FOUGERON



Joined: 30 Nov 2012
Posts: 110
Location: France

View user's profile Send private message Visit poster's website

PostPosted: Mon Feb 04, 2013 8:32 am     Reply with quote

Thanks Ttelmah.
I fix AD2 to AD0 to Gnd of Vcc (on the test board, I fix with 3 outputs of a PIC18F and experiment all the range.
When A2 to A0 goes from 0-0-0 to 1-1-1 the address value goes from 0x40 to 0x4E.
So I make a loop, increasing address value 2 by 2 from 0x40 to 0x4E
I need only these 8 addresses.
The SCL and SDA have 1K resistor to Vcc.
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Mon Feb 04, 2013 9:32 am     Reply with quote

1K is rather low!. Are you running with 3.3v?. Rpmin at 5v, for fast mode or standard mode I2c, is normally quoted as about 1.2KR.

Best Wishes
Jean FOUGERON



Joined: 30 Nov 2012
Posts: 110
Location: France

View user's profile Send private message Visit poster's website

PostPosted: Mon Feb 04, 2013 11:23 am     Reply with quote

OH, 1K is recommended in the data sheet, and I think it is not stupid, as I tried with 10K and the I2C signal was very integrated.

Yes it runs under 3V3
I work in fast mode (400kHz)
Only 0x40, 0x42, 0x4C and 0x4E are recognized

Nor ONSemi nor NXP answer on their forum. I will try Texas.

On your application, did you connect ADx to Vcc or Gnd directly or with a resistor or a RC ? Have the adress to be present at the beginning of POR or after ?
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Mon Feb 04, 2013 1:02 pm     Reply with quote

Jean FOUGERON wrote:
Quote:

When A2 to A0 goes from 0-0-0 to 1-1-1 the address value goes from 0x40 to 0x4E.

Wrong.
A0 it is not the LSB in the internal PCA9655E Address Register, instead it is the bit #1.
A0 = R/W selector

Hence A2-A0 going from 000 to 111 should give the following values:
0x00 to 0x0E for Write cycle
0x01 to 0x0F for Read cycle

The detected errors regarding 'unrecognizable addresses' double -check that a slave receiver which is addressed, must generate an
acknowledge after the reception of each byte.
Also, a master must generate an acknowledge after the reception of each byte that has been clocked out of the slave transmitter.
The device that acknowledges has to pull down the SDA line during the acknowledge clock pulse, such that the SDA line is stable LOW
during the HIGH period of the acknowledge clock pulse.
Scope the bus signal signal shapes, set−up time and hold time must be taken into account working in FAST MODE.


regards,

Humberto
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Mon Feb 04, 2013 3:52 pm     Reply with quote

For 3.3v 1K is fine. It is all down to current, and at 3.3v, you only want about 2/3rd the resistor values normally used with 5v.

Humberto, the addressing of this chip is not simple like this, it allows up to 64 addresses using just three pins. With the pins wired with the 8 patterns using GND or VDD, the 7 bit addresses will be 0x40 to 0x4E.
However, Jean, note the second point that Humberto is making. It is the same as the first line of my earlier post:
Quote:

Remember this uses 7bit addresses. The address byte needed for a particular pattern on the bits, is twice the number given in the data sheet.

So, alternate addresses 0x80 to 0x9c as sent by the PIC.

Use PCM programmers device finder program, rather than going DIY. It's in the code library.

Best Wishes
Jean FOUGERON



Joined: 30 Nov 2012
Posts: 110
Location: France

View user's profile Send private message Visit poster's website

PostPosted: Tue Feb 05, 2013 1:43 am     Reply with quote

Ttelmah wrote:
the 7 bit addresses will be 0x40 to 0x4E.
However, Jean, note the second point that Humberto is making. It is the same as the first line of my earlier post:
Quote:

Remember this uses 7bit addresses. The address byte needed for a particular pattern on the bits, is twice the number given in the data sheet.

Best Wishes

That is why when applying Gnd-Gnd-Gnd the adress is 0x40 (= 2 times 0100 000 "Gnd-Gnd-Gnd-Write")
and when applying Vcc-Vcc-Vcc the adress is 0x4E (= 2 times 0100 111 "Vcc-Vcc-Vcc-Write")
So, when I write 0xFF to the adress AA I obtain SS on the PCA outputs
AA SS
0x40 0xFF
0x42 0xFF
0x44 0x00 Evil or Very Mad
0x46 0x00 Evil or Very Mad
0x48 0x00 Evil or Very Mad
0x4A 0x00 Evil or Very Mad
0x4C 0xFF
0x4E 0xFF

Ttelmah wrote:
Use PCM programmers device finder program, rather than going DIY. It's in the code library.

Please explain this as I am not sure to understand. What do you mean by DIY. I think it is not a software problem, but a hardware one. Maybe it is a time problem, I change delays between Supply and Applying Adress values, but no effect.
What do you mean by "PCM progr' device finder prg", I use PCH.
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Tue Feb 05, 2013 1:58 am     Reply with quote

PCM's scanner will scan the bus, and show you the address the chip is at.
Allow you to see where the device really is.

Best Wishes
Jean FOUGERON



Joined: 30 Nov 2012
Posts: 110
Location: France

View user's profile Send private message Visit poster's website

PostPosted: Tue Feb 05, 2013 2:14 am     Reply with quote

Tell me more, I don't know this tool.
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Tue Feb 05, 2013 2:39 am     Reply with quote

As I said, it is in the code library. Search for I2C scanner.

Best Wishes
Jean FOUGERON



Joined: 30 Nov 2012
Posts: 110
Location: France

View user's profile Send private message Visit poster's website

PostPosted: Tue Feb 05, 2013 3:29 am     Reply with quote

I see
You know, my test board looks like a scanner (I apply an Adress on DUT,I switch on power supply on DUT,I configure the DUT in OUTPUT MODE, I send a write 0xFF and I look whether the output goes on. Then finally I switch off the supply on DUT)

I observe there is no ACK when it does'nt work, it seems normal but I do not understand why it ACKS on som adresses and not on others ! Twisted Evil
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Tue Feb 05, 2013 6:08 am     Reply with quote

Seriously, I doubt if you can do addressing like this. Most devices would not accept this. If you are applying the address as signals, which include Vdd, then the device will be partially powered by the address lines, and the address won't be correctly read. You can't have powered lines driving a chip that is switched off. If you are controlling the chip's power with a processor output, then the same power line needs to feed the circuit that 'applies the address' as well.....

Best Wishes
Jean FOUGERON



Joined: 30 Nov 2012
Posts: 110
Location: France

View user's profile Send private message Visit poster's website

PostPosted: Tue Feb 05, 2013 7:51 am     Reply with quote

Ttelmah wrote:
If you are controlling the chip's power with a processor output, then the same power line needs to feed the circuit that 'applies the address' as well.....

Best Wishes


The processor drives a emmitter follower trans which supply the DUT
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Tue Feb 05, 2013 8:04 am     Reply with quote

But what feeds the addresses.

The point is that the chip _will_ have protection diodes on the address inputs, so that if they go above the supply rail (when the chip is turned off), current will flow through these inputs leading to unexpected results.

I'd say the only way you are going to get this to work right, without major changes to the hardware, is to connect all the address inputs via resistors to the computer controlled supply. Then use the outputs that drive these as open collector drives. So set the latch to 'low', and use output_drive when you want the pin to be driven low, and output_float when you want it to go high.

The problem is in how you are trying to control the address signals, not the chip.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group