Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Difference between MAX6953 and MAX6952 is that one is working with I2C and while other is working with SPI, Only communication protocol and transmission rate between them is the difference..
So now you have to decide based on the above criteria that whether you want to use MAX6953 and MAX6952...
8051 is not having the inbuilt I2C, so you need to have software i2c implementation
I2c code....
#define SDA P0_0
#define SCL P0_1
void I2CInit(){
SDA = 1;
SCL = 1;
}
void I2CStart(){
SCL = 1;
SDA = 0;
SCL = 0;
}
void I2CRestart(){
SCL = 0;
SDA = 1;
SCL = 1;
SDA = 0;
}
void I2CStop(){
SCL = 0;
SDA = 0;
SCL = 1;
SDA = 1;
}
void I2CAck(){ // Does the Ack signal need to be generated by code?
SDA = 0;
SCL = 1;
SCL = 0;
SDA = 1;
}
void I2CNak(){
SDA = 1;
SCL = 1;
SCL = 0;
}
void I2CSend(unsigned char Data){
unsigned char i;
for(i=0;i<8;i++){
SCL = 0;
if((Data&0x80)==0)
SDA = 0;
else
SDA = 1;
SCL = 1;
Data<<=1;
}
SCL = 0; // Why this clock and data lines to be assigned to these values at end? Is it must ?
SDA = 1; // Why this clock and data lines to be assigned to these values at end? Is it must ?
}
unsigned char I2CRead(){
unsigned char i, Data=0;
for(i=0;i<8;i++){
SCL = 0;
SCL = 1;
if(SDA)
Data |=1;
Data<<=1;
}
SCL = 0; // Why this clock and data lines to be assigned to these values at end? Is it must ?
SDA = 1;
return Data;
}