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

Change I2C Speed

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







Change I2C Speed
PostPosted: Tue Apr 25, 2006 5:55 am     Reply with quote

How change I2C speed in program

#include <18F452.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=2000000)
#use I2C(MASTER, sda=PIN_C4, scl=PIN_C3, Fast)

main(){
...
void pump1(void){
...
}
change speed I2C Slow
void pump2(void){
...
}
change speed I2C Fast
...
}
rberek



Joined: 10 Jan 2005
Posts: 207
Location: Ottawa, Canada

View user's profile Send private message

PostPosted: Tue Apr 25, 2006 6:25 am     Reply with quote

Set the SSPADD register to the value that will give you your new required buad rate. Check the datasheet of the PIC you are using to determine that value.

r.b.
JPA
Guest







PostPosted: Wed Apr 26, 2006 2:05 am     Reply with quote

The compiler can handle this, with HW and Software I2C:

Code:
#use i2c(MASTER, SDA=I2C1_SDA, SCL=I2C1_SCL, FAST=50000)
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