View previous topic :: View next topic |
Author |
Message |
JPA Guest
|
I2C speed |
Posted: Thu Apr 21, 2005 1:34 pm |
|
|
Hello,
When reading compiler updates, I see that since v3.215, the speed of I2C bus could be specified using FAST=xxxxx
"3.215 #USE I2C now allows the speed to be set in BPS using FAST=xxxxxxx"
Are there limits on the BPS value ?
Is this also available when using the hardware I2C ?
In my application, I have 2 I2C bus from the same chip:
-1 for accessing serial EEPROM, needs to be as fast as possible (max EEPROM clock frequency is 1MHz )
-1 for accessing expanded I/O, which are located 50cm away from the PIC, and needs to be slower (less data to transmit, minimize EMI/EMC problems)
Has anybody already try this feature and has some advices for me ?
Thanks for your answers. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Thu Apr 21, 2005 1:44 pm |
|
|
Quote: | Are there limits on the BPS value ?
|
Of course silly!
Read the datasheet on the PIC and you can see those limits. It is just an address that is loaded (SSPADD I believe). I believe this is probably just for the hardware. I will be surprise if CCS went through the trouble to have delays built into the software routine. |
|
|
JPA Guest
|
I2C Speed |
Posted: Thu Apr 21, 2005 2:51 pm |
|
|
With I2C hardware, I have to analyse the code in LST to see what they are doing. For the software implementation, I compiled the same code with several speed from 1000 BPS to 100 000 BPS and I have seen differences in the generated ASM code (low speed -> loop with different values, high speed -> a lot of nop). I suspect that these are relatives to delays changing and it seems they did it in software.
To be sure I need to look at the signals on the bus using my scope.
Anybody else tried this feature ? |
|
|
Fabri
Joined: 22 Aug 2005 Posts: 275
|
|
Posted: Sun Feb 25, 2007 3:35 am |
|
|
Hi,
I'm also using I2C bus to comunicate with a control pannel. I have some problem with EMC with burst +- 2KV on power ac line. Especially when I connect the controll pannel with a cable of at least 50 cm. I use the same 6 wire cable to supply the pannel.
The main board do some reset but control pannel stop to work. I use watchdog to reset all if there's no any valid comunication but it work only in some case. I do some test on power supply of control pannel and it work fine also with burst.
Have you got to suggest me to solve the problem ?
Regards,
Fabri |
|
|
|