Hi.
For ex. the eeprom is set to A8 hex address, but It responds to every adrs!
also when I use two memories with dif. adrs both of them respond to every adrs and grab same data in same adrs in same call from micro!
How I can solve it?
24c02 pic interface problem
- Aleksandar.Mitrovic
- mikroElektronika team
- Posts: 1697
- Joined: 11 Mar 2015 12:48
Re: 24c02 pic interface problem
Hi hannan,
Did you take a look at our example for EEPROM in mikroBasic PRO for PIC compiler folder:
...\Mikroelektronika\mikroBasic PRO for PIC\Examples\Development Systems\EasyPic7\EEPROM (I2C)\I2C Advanced
Best regards,
Aleksandar
Did you take a look at our example for EEPROM in mikroBasic PRO for PIC compiler folder:
...\Mikroelektronika\mikroBasic PRO for PIC\Examples\Development Systems\EasyPic7\EEPROM (I2C)\I2C Advanced
Best regards,
Aleksandar
Re: 24c02 pic interface problem
yes.
I saw many ex. programs.
all of them was written in same way.
I tested my program on 34c02 and everything was ok. but when I want to work with 24c02 my code isn't applicable!
I saw many ex. programs.
all of them was written in same way.
I tested my program on 34c02 and everything was ok. but when I want to work with 24c02 my code isn't applicable!
- biljana.nedeljkovic
- mikroElektronika team
- Posts: 1043
- Joined: 30 Jun 2015 15:15
Re: 24c02 pic interface problem
Hello Hannan,
I suggest to do side by side comparison of those EEPROM modules:
http://www.farnell.com/datasheets/656901.pdf
http://www.atmel.com/Images/doc0180.pdf
In this example in the compiler, we used 24C02 EEPROM with PIC18F45K22:
...\Mikroelektronika\mikroBasic PRO for PIC\Examples\Development Systems\EasyPic7\EEPROM (I2C)\I2C Simple
Can you explain further how did you develop your project, which hardware do you use with it?
You can also attach the small project to help us detect the possible problem in your code.
Kind regards,
Biljana
I suggest to do side by side comparison of those EEPROM modules:
http://www.farnell.com/datasheets/656901.pdf
http://www.atmel.com/Images/doc0180.pdf
In this example in the compiler, we used 24C02 EEPROM with PIC18F45K22:
...\Mikroelektronika\mikroBasic PRO for PIC\Examples\Development Systems\EasyPic7\EEPROM (I2C)\I2C Simple
Can you explain further how did you develop your project, which hardware do you use with it?
You can also attach the small project to help us detect the possible problem in your code.
Kind regards,
Biljana
Re: 24c02 pic interface problem
pic18f452
At24c02
At34c02
the brief code:
//////////////////////////
....
main:
...
setBit(SSPSTAT, 7)
setBit(SSPCON1, 5) 'Synchronous Serial Port Enabled
ClearBit(SSPCON1, 0)
ClearBit(SSPCON1, 1)
ClearBit(SSPCON1, 2)
setBit(SSPCON1, 3) 'Master mode
SSPADD=$1A
....
sub procedure bwrt
setBit(SSPCON2, 0)
Delay_ms(10)
SSPBUF=$A6
Delay_ms(10)
SSPBUF=xxx
Delay_ms(10)
SSPBUF=xxx
Delay_ms(10)
setBit(SSPCON2, 2)
Delay_ms(10)
end sub
....
/////////////////////////////////////
in this code the device with A6 adrs was called but all 24c02 devices responded and exact 34c02 responded.
At24c02
At34c02
the brief code:
//////////////////////////
....
main:
...
setBit(SSPSTAT, 7)
setBit(SSPCON1, 5) 'Synchronous Serial Port Enabled
ClearBit(SSPCON1, 0)
ClearBit(SSPCON1, 1)
ClearBit(SSPCON1, 2)
setBit(SSPCON1, 3) 'Master mode
SSPADD=$1A
....
sub procedure bwrt
setBit(SSPCON2, 0)
Delay_ms(10)
SSPBUF=$A6
Delay_ms(10)
SSPBUF=xxx
Delay_ms(10)
SSPBUF=xxx
Delay_ms(10)
setBit(SSPCON2, 2)
Delay_ms(10)
end sub
....
/////////////////////////////////////
in this code the device with A6 adrs was called but all 24c02 devices responded and exact 34c02 responded.
- biljana.nedeljkovic
- mikroElektronika team
- Posts: 1043
- Joined: 30 Jun 2015 15:15
Re: 24c02 pic interface problem
Hello,
would it be a problem for you to attach the project from the compiler, so I get properly see the configuration and reproduce the same behavior?
Kind regards,
Biljana
would it be a problem for you to attach the project from the compiler, so I get properly see the configuration and reproduce the same behavior?
Kind regards,
Biljana
Re: 24c02 pic interface problem
All of the config. mentioned in previous reply.
In fact remain code includes set port , reset port etc.
xtal=11.0592Mhz
LVP=disable
WDT=dis.
HS=en.
In fact remain code includes set port , reset port etc.
xtal=11.0592Mhz
LVP=disable
WDT=dis.
HS=en.
- biljana.nedeljkovic
- mikroElektronika team
- Posts: 1043
- Joined: 30 Jun 2015 15:15
Re: 24c02 pic interface problem
Hello,
this way I am not able to reproduce the same situation as you did. Please, apologize and try to understand that I would need it in order to reproduce the behavior.
How have you tested your code?
At this moment, I can't really see the problem with your settings. If you would put the compiler project that would be great.
Kind regards,
Biljana
this way I am not able to reproduce the same situation as you did. Please, apologize and try to understand that I would need it in order to reproduce the behavior.
How have you tested your code?
At this moment, I can't really see the problem with your settings. If you would put the compiler project that would be great.
Kind regards,
Biljana