As i know those 24c04 are I2C device... you must use I2CREAD and I2CWRITE
As i know those 24c04 are I2C device... you must use I2CREAD and I2CWRITE
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Can you give me a code example? I never use memories before.
What I don't understand is the "control" in the i2cwrite command.
Have a look to the PBP manual.
Have a look to this code from Melabs website
and much on this forum.. search for I2CREAD and I2CWRITE
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
this is what I have done, I changed this
shiftout sda, scl, 5, [%10100000, %00000000, 5]
shiftout sda, scl, 5, [%10100000, %00000000, %10100001]
TRISA.7 = 1
shiftin sda, scl, 7, [circunferencia]
TRISA.7 = 0
to this
i2cwrite sda, scl, %10100000, %0000000000, [%00000101]
i2cread sda, scl, %10100001, %000000000, [circunferencia]
But the display shows 128 and not 005
your adress must be 8 bits long.. not much. And you don't need to change you control word... PBP will do it for you.
also refer to your datasheet about the Twrite delay. some will need few milliseconds before the write cycle is finish.
so try
Code:i2cwrite sda, scl, %10100000, 0, [5] pause 10 ' safe delay i2cread sda, scl, %10100000, 0, [circunferencia]
Last edited by mister_e; - 8th March 2005 at 06:42.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I read at the ramtron page that this memory uses a SPI protocol. Is It the same as I2C?
i'm actually read the datasheet
it's really I2C or some will call that 2-wire
SPI or Microwire is for 93c serie, some Xicor (the old X2444, S-29220 and many others). Those you need 4 i/o
CS
CLK
SDI
SDO
and those are use with SHIFTIN/SHIFTOUT.
Those Ramtron FRAM are great... they say that you don't need any delay between the write and the read... they run at the same speed than the bus. Great!
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks