reggie
Newbie level 1
ssp1con1
Hi,
i configure SSP module as master and slew_off mode using code written by microchip. my code is;
OpenI2C1( 0x08,0xc0);
IdleI2C1();
StartI2C1();
but when the code execute StartI2C1 stage, the SSP1CON2 register can not be modified, so I2C can not start.
the source codes of the functions are;
void OpenI2C1( unsigned char sync_mode, unsigned char slew )
{
SSP1ADD = 0x3D;
SSP1STAT &= 0x3F;
SSP1CON1 = 0x00;
SSP1CON2 = 0x00;
SSP1CON1 |= sync_mode;
SSP1STAT |= slew;
I2C1_SCL = 1;
I2C1_SDA = 1;
SSP1CON1 |= 0x20;
}
void StartI2C1( void )
{
SSP1CON2bits.SEN = 1;
}
Anyone know how to solve this problem?
Thanks
Hi,
i configure SSP module as master and slew_off mode using code written by microchip. my code is;
OpenI2C1( 0x08,0xc0);
IdleI2C1();
StartI2C1();
but when the code execute StartI2C1 stage, the SSP1CON2 register can not be modified, so I2C can not start.
the source codes of the functions are;
void OpenI2C1( unsigned char sync_mode, unsigned char slew )
{
SSP1ADD = 0x3D;
SSP1STAT &= 0x3F;
SSP1CON1 = 0x00;
SSP1CON2 = 0x00;
SSP1CON1 |= sync_mode;
SSP1STAT |= slew;
I2C1_SCL = 1;
I2C1_SDA = 1;
SSP1CON1 |= 0x20;
}
void StartI2C1( void )
{
SSP1CON2bits.SEN = 1;
}
Anyone know how to solve this problem?
Thanks