View previous topic :: View next topic |
Author |
Message |
John Ilicitean
Joined: 07 Jul 2005 Posts: 27 Location: Rotova
|
High-Speed Mode of I2C |
Posted: Thu Jan 12, 2006 6:41 am |
|
|
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
|
|
Posted: Thu Jan 12, 2006 1:28 pm |
|
|
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
|
|
Posted: Fri Jan 13, 2006 3:59 am |
|
|
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
|
|
|
John Ilicitean
Joined: 07 Jul 2005 Posts: 27 Location: Rotova
|
|
Posted: Fri Jan 13, 2006 6:48 am |
|
|
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!!! |
|
|
|