View previous topic :: View next topic |
Author |
Message |
Bingo Guest
|
Change I2C Speed |
Posted: Tue Apr 25, 2006 5:55 am |
|
|
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
|
|
Posted: Tue Apr 25, 2006 6:25 am |
|
|
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
|
|
Posted: Wed Apr 26, 2006 2:05 am |
|
|
The compiler can handle this, with HW and Software I2C:
Code: | #use i2c(MASTER, SDA=I2C1_SDA, SCL=I2C1_SCL, FAST=50000) |
|
|
|
|
|
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
|