CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

#use i2c hardware pin error

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
johnl



Joined: 30 Sep 2003
Posts: 120

View user's profile Send private message

#use i2c hardware pin error
PostPosted: Tue Apr 12, 2016 5:21 pm     Reply with quote

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)
 {
 }
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Apr 12, 2016 5:44 pm     Reply with quote

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)
 {
 }
johnl



Joined: 30 Sep 2003
Posts: 120

View user's profile Send private message

PostPosted: Tue Apr 12, 2016 6:04 pm     Reply with quote

Yes, that works. I guess the compiler doesn't acknowledge the "default" selections.

Thank you very much.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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