muneer
Joined: 06 Apr 2009 Posts: 5
|
#int_ssp not work |
Posted: Fri Oct 16, 2009 4:44 pm |
|
|
Hello All
I have two Pic microcontrollers 18F2550.
I use I2C (One PIC master and one PIC slave).
My problem is the #int_ssp not work.
MASTER:
Code: |
#use i2c(master, SDA=PIN_B0, SCL=PIN_B1, address=0x01)
#use rs232(baud=9600, xmit=PIN_C6,rcv=PIN_C7,STREAM=PC)
#INT_SSP
void i2c_isr()
{
printf("\n\r&&&&&&&&&&& enter master interrupt &&&&&&&&&&&&\n\r");
}
void main ()
{
enable_interrupts(GLOBAL);
enable_interrupts(INT_SSP);
for(;;) {
i2c_start();
i2c_write(0x02);
i2c_write('a');
i2c_stop();
}
|
SLAVE:
Code: |
#use i2c(SLAVE, SDA=PIN_B0, SCL=PIN_B1, address=0x02,)
#use rs232(baud=9600, xmit=PIN_C6,rcv=PIN_C7,STREAM=PC)
BYTE state;
unsigned char i =0;
#int_ssp
void i2c_isr()
{
printf("\n\r********Enter interrupt************\n\r");
state = i2c_isr_state();
printf("++++++++++++State = %x+++++++++++++++++++++++++\n\r",state);
}
void main ()
{
enable_interrupts(GLOBAL);
enable_interrupts(int_ssp);
for(;;){ }
} |
|
|