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 support@ccsinfo.com

i2c slave and address 0xCC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
asa



Joined: 20 Sep 2006
Posts: 3

View user's profile Send private message

i2c slave and address 0xCC
PostPosted: Wed Sep 20, 2006 7:08 am     Reply with quote

I've a problem with i2c slave device which use 0xCC address. My master/slave system works fine if I use other than 0xCC address in slave device!?!
The slave keeps SDA-line low after ack-bit if master sends non parity data (lsb is 1) (eg. 0x01,0x03,0x05...)?!?
Example:
Data from master to slave (first one is addr.)
CC 00 02 That works fine!
CC 00 01 Slave stuck.
CC 01 Slave stuck.
CC 03 Slave stuck.
Same problem occurs in slave if I use code EX_SLAVE.C of PICC and 0XCC address. I tested slave addreses C0,C2,C4,C8,CA,CE,EE and these work fine.
Master works fine with i2c EEPROM devices(e.g. at24c16).
Is address 0xCC not valid for slave or is that bug ?!?!
Device is PIC16F877
Ttelmah
Guest







PostPosted: Wed Sep 20, 2006 10:57 am     Reply with quote

Address 0xCC, should not cause a problem. There are some address ranges to avoid on I2C (0b0000xxx. 0b1111xxx. 0b11110xx..), but the other addresses ought not to give a problem.
I don't remember there being any erratas for the I2C on the 16F877.
I'd be adding some diagnostics, and try a simplified 'test', printing out the actual I2C status bytes as well as the data after one of the faulty transmissions to see what the chip is saying has happened.
You say 'device is', but two devices are involved. What is the master, have you actually recorded and checked the waveforms from the master?.
The 16F877 has been around for a long time, and I think a problem would have been noticed.
The commonest cause of 'odd' I2C problems, is slightly too high pull up resistors for the bus capacitance, resulting in the edges being missed, or interpreted at the wrong time.

Best Wishes
asa



Joined: 20 Sep 2006
Posts: 3

View user's profile Send private message

PostPosted: Wed Sep 20, 2006 1:19 pm     Reply with quote

Actually master and slave is same device and it works in two modes.
I cheked singals on scope and they looked fine. Pull ups are changeable (1k,2k2 and 10k). Slave has 1k and master has 10k pull ups, so line pull ups are 0.9k and line is quite short (low capacitance).
It is strange that everything works fine on other addreses....
I have do some kind diagnostic to RS232.
Thanks for answer !
Ttelmah
Guest







PostPosted: Wed Sep 20, 2006 2:31 pm     Reply with quote

There is only meant to be one pullup resistor on each of the two I2C lines. Two shouldn't 'matter', but is not 'in spec'. For 5v operation, with no series resistors, the minimum total pull-up value, is 2KR. This drops to 1.7K, if series resistors are fitted (these help to protect against spikes). For 5v, with a 2K pull up, the series resistors may be up to 220R.
I understand that other data patterns are working, but '0xCC', is like 0x55, an 'unusual' pattern, giving two successive ones, then two successive zeros. I actually think that the chip is failing to recognise the address, because of a slight mistiming, and is then seeing the next few bits as '00', and thinking it has found a general call address.

Best Wishes
asa



Joined: 20 Sep 2006
Posts: 3

View user's profile Send private message

PostPosted: Sat Sep 30, 2006 2:17 am     Reply with quote

The problem is solved. It was in the software. 0xCC is valid address and works fine.
In the master mode device can't send data to address which is same than SSPADD. Software is quite special because of master and slave mode Laughing
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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