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

High-Speed Mode of I2C

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



Joined: 07 Jul 2005
Posts: 27
Location: Rotova

View user's profile Send private message

High-Speed Mode of I2C
PostPosted: Thu Jan 12, 2006 6:41 am     Reply with quote

Hello Everyone!!!
I working with PIC16F877 and I want to transmit information across I2c to the conversor ADS1100. In differents programs the ADS1100 not send me the bit acknowledged. I try in fast and slow speed mode,now I want to use the HIGH-SPEED mode(to see if there is for it that not send me the bit acknowledged) but I not as activates this mode.
This is my code:
Code:


#include <16F877.h>
#use delay(clock=20000000)
#fuses NOWDT,HS, PUT, NOPROTECT, NOBROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG
#use i2c(Master,fast,sda=PIN_C4,scl=PIN_C3)

byte r,y,x;

void main()
{
   while(1)
   {
       
      i2c_start();           
      i2c_write(0x94);      //device addres with  the low bit=0
      i2c_write(0x8c);      //Configuration Register
      i2c_start();
      i2c_write(0x95);      //device addres with  the low bit=1
      r=i2c_read();
      y=i2c_read();
      x=i2c_read();       
        i2c_stop();
      delay_ms(11);
   }

}


That I must change to use the HIGH-SPEED mode??
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jan 12, 2006 1:28 pm     Reply with quote

Quote:
now I want to use the HIGH-SPEED mode

Example:
#use i2c(Master, sda=PIN_C4, scl=PIN_C3, FORCE_HW, FAST=1000000)
John Ilicitean



Joined: 07 Jul 2005
Posts: 27
Location: Rotova

View user's profile Send private message

PostPosted: Fri Jan 13, 2006 3:59 am     Reply with quote

Hello!!
I proved this option and the compiler have a error because FAST=1000000 don't is option valid.
" Option invalid Bad Option: 1000000"

In declaration of the bus I2C (#use i2c(master,......etc)) it does not allow the option FAST=XXXXX.

That it can do?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jan 13, 2006 4:10 am     Reply with quote

You probably have an old version of the compiler, that doesn't support
that feature. See the following thread which shows how to write to
the i2c baud rate register directly. (This is the SSPADD register.)
http://www.ccsinfo.com/forum/viewtopic.php?t=19257&highlight=sspadd
John Ilicitean



Joined: 07 Jul 2005
Posts: 27
Location: Rotova

View user's profile Send private message

PostPosted: Fri Jan 13, 2006 6:48 am     Reply with quote

Thank's!!!
I'm working to a major frequency.
Now, I must to find because the ADS1100 not send me the bit acknowledged .
Some time ago that I have this problem,I was thinking that I having worked a major frequency It was the solution for the slave send me the bit ACK, but it is not like that.
Also I'm sure that is not hardware problem.
I am doing something badly in my program, but not that!!! Sad Sad Sad
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