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 fast=400000 doesn't output such bitrate

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



Joined: 02 Dec 2005
Posts: 9

View user's profile Send private message

#use i2c fast=400000 doesn't output such bitrate
PostPosted: Tue Mar 27, 2007 9:40 am     Reply with quote

Hi,

I have trouble getting a correct I2C speed by using #use i2c fast=400000. What I measured on the bus is only around 200khz instead of 400khz as what written in the code. I have to increase it to fast=550000 in order to get close to 400khz.

Any insight about this?
Ttelmah
Guest







PostPosted: Tue Mar 27, 2007 10:18 am     Reply with quote

What is your clockrate?.
Are you using software I2C, or hardware I2C?.
What compiler version?.

Best Wishes
capfelix



Joined: 02 Dec 2005
Posts: 9

View user's profile Send private message

PostPosted: Tue Mar 27, 2007 10:22 am     Reply with quote

Running at 20Mhz and I'm using Force_HW.
Ttelmah
Guest







PostPosted: Tue Mar 27, 2007 10:34 am     Reply with quote

FORCE_HW, means nothing, unless your pin numbers are right...
Smile
Post the actual #use I2C line.
Again, what compiler version.
Also, what PIC.

Assuming the #clock defintion is right, you should get 384615Hz (400000 is impossible), but I'd suspect the system is working in software mode.

Best Wishes
capfelix



Joined: 02 Dec 2005
Posts: 9

View user's profile Send private message

PostPosted: Thu Mar 29, 2007 1:30 am     Reply with quote

Hi,

I'm using PIC18F4455 and the pin is B0 and B1, which are MSSP I2C pin.

I'm using compiler v4.017.

#include <18F4455.h>
#use delay(clock=20000000)

#use i2c(master, sda=PIN_B0, scl=PIN_B1, FORCE_HW, fast=525000)
#use standard_io(A)
#use standard_io(B)
#use standard_io(C)
#use standard_io(D)
Ttelmah
Guest







PostPosted: Thu Mar 29, 2007 9:51 am     Reply with quote

Try it with 3.249.
Seriously, the V4 compilers, are _still_ not working even close to 'right', and are up in the .030's. I would not trust 4.017, to do much right...

Best Wishes
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