Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC18F97J60 I2C help - SSP1CON2 reister

Status
Not open for further replies.

reggie

Newbie level 1
Joined
Nov 10, 2005
Messages
0
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,280
Activity points
1,296
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
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top