I2C Implementation on PIC error
Discussion in "Project Doubts" started by dyoussef Jun 30, 2016.
Thu Jun 30 2016, 01:04 am
Hello,
I am referencing this project: http://www.8051projects.net/wiki/I2C_Implementation_on_PIC
I am using PIC16F1847 and XC8 so I've had to make a few changes to the code. While making changes, my compiler gave me an error for the I2CWait function for the while statement. It says "unexpected token amp".
Here is the line in question:
I changed the register names to be consistent with my PIC but it didn't solve the problem.
What changes do I need to make to this function so that this error does not occur?
I am referencing this project: http://www.8051projects.net/wiki/I2C_Implementation_on_PIC
I am using PIC16F1847 and XC8 so I've had to make a few changes to the code. While making changes, my compiler gave me an error for the I2CWait function for the while statement. It says "unexpected token amp".
Here is the line in question:
while ((SSPCON2 & 0x1F ) || ( SSPSTAT & 0x04 ) );
I changed the register names to be consistent with my PIC but it didn't solve the problem.
What changes do I need to make to this function so that this error does not occur?
[ Edited Thu Jun 30 2016, 01:07 am ]
Thu Jun 30 2016, 11:14 am
I think the display/ editor software added the amp
It should say...
while ((SSPCON2 & 0x1F ) || ( SSPSTAT & 0x04 ) );
It should say...
while ((SSPCON2 & 0x1F ) || ( SSPSTAT & 0x04 ) );
[ Edited Thu Jun 30 2016, 11:17 am ]
Powered by e107 Forum System