PDA

View Full Version : I2C and FM24C16



igeorge
- 10th October 2004, 10:58
Hello everybody,
I need help on solving an I2C problem
I am new to Pics as i am new to Pic Basic Pro (5 days only)
I got from rentron the flash-lab77 kit with pic basic pro and the rest.
My problems are two , related to the i2c commands
1) First one is that i would like to write on the eeprom some decimal
numbers of 4 digits each. Let say A=1234 and B=5678
I would like with one i2cwrite command to put this data in the eeprom. The
next step is to retrieve this data as decimal numbers too , so i can display
it on an serial LCD ( i have figured out the display part and it works).
I wrote this, but does not work

a var word
b var word
a=1234
b=5678
I2CWRITE PORTC.0,PORTC.1,$a0,0,[A,B]
I2Cread PORTC.0,PORTC.1,$a0,0,[A,B]
It will read only one byte from the word.

2) My second problem is to write some ASCII text on the eeprom and be able
to read it back . lets say i want to write
"this is text one on eeprom" , then, i would like to be able to read it back
so i can display it on the lcd.

I would appreciate if any of you can help me, and a small piece of code as an example it will be a jackpot.
Just keep in mind that i am a complete newbee and what it is obvious for you it might be a mistery for me.
Thank you very much for reading my mail and i hope to hear soon from you
Ion George