View previous topic :: View next topic |
Author |
Message |
Duke Guest
|
I2c Hardware problem |
Posted: Fri Dec 26, 2003 2:36 pm |
|
|
Hi, everyone.
I 've doing some tests about the i2c hardware built-ins on a 16f876, but they didn't work.
Does anybody know about a bug on the compiler or something else ?
My circuit is ok, because software routines programmed on my own, work fine.
Thanks a lot ! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Dec 26, 2003 3:32 pm |
|
|
Quote: | My circuit is ok, because software routines programmed on my own, work fine. |
So this means you did not use the CCS software i2c libraries ?
You wrote your own driver ?
Quote: | I 've doing some tests about the i2c hardware built-ins on a 16f876, but they didn't work. |
Are you using the CCS i2c library for this ?
Questions:
1. Do you have a pull-up resistor on both SDA and SCL ?
2. What version of the CCS compiler do you have ? |
|
|
burnsy
Joined: 18 Oct 2003 Posts: 35 Location: Brisbane, Australia
|
i2c problems |
Posted: Fri Dec 26, 2003 9:23 pm |
|
|
I had problems immediately with the 16F876, using the CCS routines. I was using FAST. The moment I used SLOW all the problems went away.
As speed hasn't been an issue, I didn't bother to figure out why. Give that a try.
Watch the restart_wdt too.
Here's a snipit of my i2c code..compiled with V3.055.
#use I2C(MASTER, SDA=PIN_C4, SCL=PIN_C3, NOFORCE_SW, SLOW, RESTART_WDT)
NOFORCE_SW is what I used previously. My new compiler manual may have replaced it with FORCE_HW??
Good Luck.. _________________ This is the last code change until its ready.... |
|
|
Duke
Joined: 26 Dec 2003 Posts: 2 Location: Buenos Aires - Argentina
|
|
Posted: Mon Dec 29, 2003 7:45 am |
|
|
[quote="PCM programmer"] Quote: | My circuit is ok, because software routines programmed on my own, work fine.
So this means you did not use the CCS software i2c libraries ?
You wrote your own driver ? |
Exactly. In fact I couldn't use them. Because they didn't work fine.
Quote: | I 've doing some tests about the i2c hardware built-ins on a 16f876, but they didn't work.
Are you using the CCS i2c library for this ? |
I was trying. Because when I tried to use them they had failed and I had to program my own i2c software built-ins.
Quote: |
Questions:
1. Do you have a pull-up resistor on both SDA and SCL ?
|
Yes. I do. Remember that my software routines work fine, so it isn't a circuit problem.
Quote: |
2. What version of the CCS compiler do you have ?
|
How could I know that ? _________________ FC |
|
|
Duke
Joined: 26 Dec 2003 Posts: 2 Location: Buenos Aires - Argentina
|
Re: i2c problems |
Posted: Mon Dec 29, 2003 7:48 am |
|
|
burnsy wrote: | Quote: | I had problems immediately with the 16F876, using the CCS routines. I was using FAST. The moment I used SLOW all the problems went away.
As speed hasn't been an issue, I didn't bother to figure out why. Give that a try.
Watch the restart_wdt too.
Here's a snipit of my i2c code..compiled with V3.055.
#use I2C(MASTER, SDA=PIN_C4, SCL=PIN_C3, NOFORCE_SW, SLOW, RESTART_WDT)
NOFORCE_SW is what I used previously. My new compiler manual may have replaced it with FORCE_HW??
Good Luck.. |
Ok, thanks. I will try and tell you how it worked.
|
_________________ FC |
|
|
|