what are your A0,A1,A2 settings... are they to ground?!? if so try this one
Code:define OSC 4 B0 var word B1 var byte B2 var byte cont con %10100000 b1=0 for b0=0 to 63 I2cread PORTB.4,PORTB.5,cont,b0,[b2] write b1,b2 pause 50 b1=b1+1 next b0
what are your A0,A1,A2 settings... are they to ground?!? if so try this one
Code:define OSC 4 B0 var word B1 var byte B2 var byte cont con %10100000 b1=0 for b0=0 to 63 I2cread PORTB.4,PORTB.5,cont,b0,[b2] write b1,b2 pause 50 b1=b1+1 next b0
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
yes,A0,A1,A2 are on ground.
but with your code,nothing happens.
with my code the pic reads "FF" in the internal eeprom
i have searched and posted in many forums last week,
but nobody can help me.
Please help me!
RON
well it's suppose to work... can you send your data to your PC or on a PORT and monitor that??? have you put 1k - 4k7 pull-ups on SDA & SCL pins ?!? Is by any chance you revert SDA & SCL pins?!?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Be sure you have the WP (pin #7) tied to ground, and pull-up
resistors on SDA & SCL (pins #4 & #5)
A0, A1 and A2 are not used on the 24LC16B, so you can leave
these pins (#1,#2,#3) floating.
The control byte consists of a 4-bit control code of %1010 which
remains constant.
The next 3-bits in the control byte are the "block select bits".
These can be from %000 to %111 for blocks 0 to 7 (8 blocks total).
Note that these 3-bits are the high-order "address" bits, so you do
not follow the control byte with a word sized variable for the address
of this EEPROM. The upper 3-bits of the word address are the lower
nibble bits 1,2,3 in the control byte.
The last bit of the control byte is for read or write, but PBP will
automatically flip this bit for you.
So, the control byte can be from %1010 000 0 to %1010 111 0 to
access blocks 0 to 8. The low-order address byte can be from 0-255.
Code:B0 var byte B1 var byte B2 var byte Cont con %10100110 ' Control 1010 + block #3 address 011 SYMBOL SDA = PORTB.4 ' Data pin SYMBOL SCL = PORTB.5 ' Clock pin Main: FOR B0=0 to 63 ' Locations 0 to 63 = 64 bytes B1=B0+4 ' Write address + 4 to each location I2cWrite SDA,SCL,Cont,B0,[B1] ' Cont + B0 = word address PAUSE 10 ' Pause for writes NEXT B0 FOR B0=0 to 63 ' Locations 0 to 63 = 64 bytes I2cRead SDA,SCL,Cont,B0,[B2] ' Cont + B0 = word address WRITE B0,B2 NEXT B0 Display: FOR B0 = 0 to 63 READ B0,B2 HSEROUT ["ADD: ",DEC B0," VAL: ",DEC B2,13,10] NEXT B0 Here: GOTO Here
Hi again!
Thank you for your code example.
But it still don't works.Sorry for that!
Here is a Picture of my connections:
http://www.xg-midifiles.de/24LC16B.jpg
I use OSC=RC in my programmer settings.
I can't understand wy it don't works.
By'e
RON
we already told it but...you didn't place any pull-up resistor on the SDA and SCL pin...1.8k-4.7k
the internal one will never give you good results if you're using them.
Last edited by mister_e; - 8th March 2005 at 00:55.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi!
I have WP on Ground and pull up SDA and SCL.
Here a picture:
http:www.xg-midifiles.de/24LC16B.jpg
But nothing happen's!
When i write the serial Eeprom with the loader.hex then it works great.
But with your(my) program it doesn't.(WHY?)
By'e
Ron
Bookmarks