Searching \ for 'CCS &' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=ccs
Search entire site for: 'CCS &'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] CCS & 24LC16B, can not read data'
2000\08\17@083452 by aipi Wijnbergen

picon face
Hello,

I would like to ask for the PicList members help on a problem I am having
using the serial EEPROM 24LC16B connected to 16C77 using SDA & SCL pins
with 4.7K ohm pull up resistors.

I am using CCS example to interface to this EEPROM, here is the code:

byte read_ext_eeprom(long int address) {
   byte data;

   i2c_start();
   i2c_write((0xa0|(byte)(address>>7))&0xfe);
   i2c_write(address);
   i2c_start();
   i2c_write((0xa0|(byte)(address>>7))|1);
   data=i2c_read(0);  // 0 marks that we should not ACK the received data
   i2c_stop();
   return(data);
}

The problem is that this code is stuck on the i2c_read(0) which polls the
SSPSTAT register bit 0 to check if a data is received. Here is the
disassembly code:

0000                01026 ....................    data=i2c_read(0);  // 0
marks that we should not ACK the received data
02C6 1683           01027 BSF    03,5
02C7 1814           01028 BTFSC  14,0
02C8 2ACB           01029 GOTO   2CB
02C9 1283           01030 BCF    03,5
02CA 2AC6           01031 GOTO   2C6
02CB 1283           01032 BCF    03,5
02CC 0813           01033 MOVF   13,W
02CD 00B8           01034 MOVWF  38


Any idea why wouldn't the 24LC16B answer ?


Using CCS sample for writing a byte to the EEPROM execute with no problems,
only, I can not test if it does something wrong until I have the reading
working.

Thanks Chaipi

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu>

2000\08\20@041627 by )

picon face
Hello,

I would like to ask for the PicList members help on a problem I am having
using the serial EEPROM 24LC16B connected to 16C77 using SDA & SCL pins
with 4.7K ohm pull up resistors.

I am using CCS example to interface to this EEPROM, here is the code:

byte read_ext_eeprom(long int address) {
   byte data;

   i2c_start();
   i2c_write((0xa0|(byte)(address>>7))&0xfe);
   i2c_write(address);
   i2c_start();
   i2c_write((0xa0|(byte)(address>>7))|1);
   data=i2c_read(0);  // 0 marks that we should not ACK the received data
   i2c_stop();
   return(data);
}

The problem is that this code is stuck on the i2c_read(0) which polls the
SSPSTAT register bit 0 to check if a data is received. Here is the
disassembly code:

0000                01026 ....................    data=i2c_read(0);  // 0
marks that we should not ACK the received data
02C6 1683           01027 BSF    03,5
02C7 1814           01028 BTFSC  14,0
02C8 2ACB           01029 GOTO   2CB
02C9 1283           01030 BCF    03,5
02CA 2AC6           01031 GOTO   2C6
02CB 1283           01032 BCF    03,5
02CC 0813           01033 MOVF   13,W
02CD 00B8           01034 MOVWF  38


Any idea why wouldn't the 24LC16B answer ?


Using CCS sample for writing a byte to the EEPROM execute with no problems,
only, I can not test if it does something wrong until I have the reading
working.

Thanks Chaipi

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2000\08\20@073303 by Oliver Broad

flavicon
face
Something doesn't sound right, I'm not familiar with the layout of SSPSTAT
but I fail to see what bit you could be testing, surely either the byte
arrives or it doesn't, since I presume this must be a bit-banging interface.

Oliver.

{Original Message removed}

2000\08\20@170423 by fernteix

flavicon
face
Try to post the question in :
http://ccsinfo.com/wwwboard/

Regards

Fernando


{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...