PDA

View Full Version : 24C512 control?



a.majid
- 21st August 2007, 17:13
Hi all,
I would like to use seeprom 24C512.
Please tell me how to assign control byte.

Thanks

ohiohort
- 22nd August 2007, 04:15
cont con %10100000

I2CWRITE SDA,SCL,cont,Addr,[x]

or............ I2CWRITE SDA,SCL,%10100000,Addr,[x]

its all in your PicBasic Pro Compiler manual under i2cwrite and i2cread commands.Goto Microchip.com and Download the 24c512 datasheet, well tell you everything you need to know.

sayzer
- 22nd August 2007, 06:54
One thing to remember:

Constants should not be used for control commands.

Ex:
Cont CON %10100000


Use them as BYTE variables.

Ex:
Cont CON %10100000
Control VAR BYTE

Control = Cont

Now, use "Control" instead of Cont.

I2CWRITE SDA,SCL,Control,Addr,[x]


==========================