![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
johnl
Joined: 30 Sep 2003 Posts: 120
|
#use i2c hardware pin error |
Posted: Tue Apr 12, 2016 5:21 pm |
|
|
I get the following error even though the pins selected are specified as the default hardware pins in the 16F1764 datasheet. (CCS Version 5.055)
C:\__b\CC\Pic16F1764\RANDpwmGen\RandPWM.X\Rand.c:6:5: Error#99 Option invalid Wrong pins for H/W
Code: |
#include <16f1764.h>
#include <stdlib.h>
#fuses INTRC_IO,NOWDT, PUT, MCLR, NOPROTECT,NOBROWNOUT, NODEBUG, NOLVP
#use delay(INTERNAL = 32000000)
#use i2c(SLAVE, sda=PIN_C1,scl=PIN_C0, address=0xA0)
void main(void)
{
} |
|
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Apr 12, 2016 5:44 pm |
|
|
If I do it like this, with all the pin selects, then it compiles. I looked at
the .LST file and it is setting up SSP1CON1 for an i2c slave. I tested this
with compiler vs. 5.056.
Code: | #include <16f1764.h>
#include <stdlib.h>
#fuses INTRC_IO,NOWDT, PUT, MCLR, NOPROTECT,NOBROWNOUT, NODEBUG, NOLVP
#use delay(INTERNAL = 32000000)
#pin_select SCL1OUT = PIN_C0
#pin_select SCL1IN = PIN_C0
#pin_select SDA1OUT = PIN_C1
#pin_select SDA1IN = PIN_C1
#use i2c(SLAVE, I2C1, address=0xA0)
void main(void)
{
} |
|
|
![](templates/subSilver/images/spacer.gif) |
johnl
Joined: 30 Sep 2003 Posts: 120
|
|
Posted: Tue Apr 12, 2016 6:04 pm |
|
|
Yes, that works. I guess the compiler doesn't acknowledge the "default" selections.
Thank you very much. |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|