Searching \ for '24c02 eeprom read problems' 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/mems.htm?key=eeprom
Search entire site for: '24c02 eeprom read problems'.

Truncated match.
PICList Thread
'24c02 eeprom read problems'
1999\06\23@190704 by Simon Redwood

flavicon
picon face
Pleeease HELP !

I am unable to read the information in an 24C02 eeprom, I can successfully
write to any address, but all reads return a 'FF', irrelevant of the
information held in them, which I know to be valid data.

How can I set the port up to read instead of write on the data lines esp.
DATA_0(pin 2)


Regards,
Simon

unsigned char in_byte(void)
/* fetch byte, most significant bit first */
{
   unsigned char i_byte=0x00;
   int n;

SetPortReadmode();                    <------------ set bit 5 of control
port to 1
high_SDA();

for (n=0; n<8; n++) {
 high_SCL();
 i_byte=(i_byte << 1) | (inportb(DATA));
 low_SCL();
}

SetPortWritemode();                    <------------ set bit 5 of control
port to 0

return(i_byte);
}

1999\06\23@191745 by Tim Hamel

picon face
Simon Says:
In a message dated 6/23/99 4:07:29 PM Pacific Daylight Time,
spam_OUTspredwoodTakeThisOuTspamsri-net.demon.co.uk writes:

> Pleeease HELP !
>
>  I am unable to read the information in an 24C02 eeprom, I can successfully
>  write to any address, but all reads return a 'FF', irrelevant of the
>  information held in them, which I know to be valid data.
>
>  How can I set the port up to read instead of write on the data lines esp.
>  DATA_0(pin 2)


Hi Simon,

Is this interface to a PIC or parallel port?  If it's to a parallel port, and
you want to use the DATA lines as input, make sure your port is set to EPP or
ECP.  Then, you'll need to set bit 5 of the control port, in pseudo code,
it'd be something like this:

Out to Control Port = Control Port (37A on some puters) OR  &H20

This will set all 8 data lines to input.

As far as the I2C read routines, can't help ya there, I've never implemented
I2C on the parallel port -- I got too darn frustrated with it and put it on
hold.


Hope this helps,

Tim H.

1999\06\24@033355 by root

flavicon
face
Hi,

look at the comment inserted below. I hope it will help you.
Imre

On Thu, 24 Jun 1999, Simon Redwood wrote:

{Quote hidden}

// changing the following line

>   i_byte=(i_byte << 1) | (inportb(DATA) & 0x01);
// actually, you should (and want) to read a single bit instead of
// the whole port...

{Quote hidden}

1999\06\24@063500 by Caisson

flavicon
face
> Van: Simon Redwood <.....spredwoodKILLspamspam@spam@sri-net.demon.co.uk>
> Aan: PICLISTspamKILLspamMITVMA.MIT.EDU
> Onderwerp: 24c02 eeprom read problems
> Datum: donderdag 24 juni 1999 1:04
>
> Pleeease HELP !
>
> I am unable to read the information in an 24C02 eeprom, I can
successfully
> write to any address, but all reads return a 'FF', irrelevant of the
> information held in them, which I know to be valid data.
>
> How can I set the port up to read instead of write on the data lines esp.
> DATA_0(pin 2)

Simon, I did send you an ASCII drawing to interface a 24Cxx to a standard
Printer-port connector.  Did you receive it ?

I'm using it here, connected to the Programming-adapter (IC-foot) with four
lose wires of about a meter, and it did not fail me once (in over a year)
..

Greetz,
 Rudy Wieser

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