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 support@ccsinfo.com

Re: I2C with 20MHz Processor

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



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: I2C with 20MHz Processor
PostPosted: Fri Mar 07, 2003 3:29 pm     Reply with quote

(For some reason, the board will not accept replies to your
original post, so I'm posting my reply as a new message).

1. Did you change the #use delay statement when you changed
the crystal ? Example:

#use Delay(clock=5000000)

#use Delay(clock=20000000)

2. Are you using software or hardware i2c ? I don't think
hardware i2c works properly on the 16C77. I think it
only works on PICs that have a "MSSP" (16F877), and not
a "BSSP" which the 16C77 has.

3. What version of the compiler are you using ?

4. Are you testing this on a real chip, or are you using
ICE or simulation ?
___________________________
This message was ported from CCS's old forum
Original Post ID: 12468
Roger Eberle
Guest







Re: I2C with 20MHz Processor
PostPosted: Fri Mar 07, 2003 3:46 pm     Reply with quote

1. I changed the #use Delay to 20000000
2. I am using sw i2C.
3. PCW Compilter IDE Version 2.28
PCB and PCM Version 2.726
4. I'm using an ICEPIC



:=(For some reason, the board will not accept replies to your
:=original post, so I'm posting my reply as a new message).
:=
:=1. Did you change the #use delay statement when you changed
:=the crystal ? Example:
:=
:=#use Delay(clock=5000000)
:=
:=#use Delay(clock=20000000)
:=
:=2. Are you using software or hardware i2c ? I don't think
:= hardware i2c works properly on the 16C77. I think it
:= only works on PICs that have a "MSSP" (16F877), and not
:= a "BSSP" which the 16C77 has.
:=
:=3. What version of the compiler are you using ?
:=
:=4. Are you testing this on a real chip, or are you using
:= ICE or simulation ?
___________________________
This message was ported from CCS's old forum
Original Post ID: 12469
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: I2C with 20MHz Processor
PostPosted: Fri Mar 07, 2003 4:17 pm     Reply with quote

:=1. I changed the #use Delay to 20000000
:=2. I am using sw i2C.
:=3. PCW Compilter IDE Version 2.28
:= PCB and PCM Version 2.726
:=4. I'm using an ICEPIC
:=
------------------------------------------------------
Here's a list of CCS bug fixes, in the vicinity of your
compiler version. They fixed a problem with i2c slave
functions in vs. 2.725, so your version is probably OK.

2.719 Optimization updates
2.721 I2C hardware master mode now works on chips that have it
2.722 Optimization bug fixed
2.724 DELAY_US improved
2.725 Lost I2C slave functions restored
2.727 Small problem with macros fixed
2.727 Optimization improvments

You may not like this, but the first thing I would suspect
would be the ICE.

I recall that someone had a recent problem with, I believe,
RS-232 baud rates and framing errors. They were using an ICE.
They thought the PIC clock frequency was one value, but
instead the ICE was using a different value. This was causing the baud rate to be off frequency.
Can you check if that's the problem ? It may be affecting
the i2c baud rate in some way. What does the SCL signal
look like, when viewed with an oscilloscope ?

If that's not the problem, the closest version I have to
yours is vs. 2.727. I could compile a small program and
test it, if need be.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12470
Roger Eberle
Guest







Re: I2C with 20MHz Processor
PostPosted: Fri Mar 07, 2003 4:53 pm     Reply with quote

:=:=1. I changed the #use Delay to 20000000
:=:=2. I am using sw i2C.
:=:=3. PCW Compilter IDE Version 2.28
:=:= PCB and PCM Version 2.726
:=:=4. I'm using an ICEPIC
:=:=
:=------------------------------------------------------
:=Here's a list of CCS bug fixes, in the vicinity of your
:=compiler version. They fixed a problem with i2c slave
:=functions in vs. 2.725, so your version is probably OK.
:=
:=2.719 Optimization updates
:=2.721 I2C hardware master mode now works on chips that have it
:=2.722 Optimization bug fixed
:=2.724 DELAY_US improved
:=2.725 Lost I2C slave functions restored
:=2.727 Small problem with macros fixed
:=2.727 Optimization improvments
:=
:=You may not like this, but the first thing I would suspect
:=would be the ICE.
:=
:=I recall that someone had a recent problem with, I believe,
:=RS-232 baud rates and framing errors. They were using an ICE.
:=They thought the PIC clock frequency was one value, but
:=instead the ICE was using a different value. This was causing the baud rate to be off frequency.
:=Can you check if that's the problem ? It may be affecting
:=the i2c baud rate in some way. What does the SCL signal
:=look like, when viewed with an oscilloscope ?
:=
:=If that's not the problem, the closest version I have to
:=yours is vs. 2.727. I could compile a small program and
:=test it, if need be.
---------------------------------------------------------------
I don't belive that a hardwareproblem is the reason. I'm using on two other pins a RS232 with 57,6k and this works fine. I will check the SCL-Timing tomorrow.
Thanks for your help.
Roger
___________________________
This message was ported from CCS's old forum
Original Post ID: 12472
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: I2C with 20MHz Processor
PostPosted: Fri Mar 07, 2003 5:03 pm     Reply with quote

<font face="Courier New" size=-1>:=:=:=1. I changed the #use Delay to 20000000
:=:=:=2. I am using sw i2C.
:=:=:=3. PCW Compilter IDE Version 2.28
:=:=:= PCB and PCM Version 2.726
:=:=:=4. I'm using an ICEPIC
:=:=:=
-
:=I don't belive that a hardwareproblem is the reason. I'm using on two other pins a RS232 with 57,6k and this works fine. I will check the SCL-Timing tomorrow.
--------------------------------------------------------

I don't know if this applies to you or not, but on this
page, there's a FAQ on the ICEPIC, and they say the 16C
series has a maximum emulation speed of 10 MHz.
<a href="http://www.okwelectronics.com/datasheets/faqicepic.htm#speed" TARGET="_blank"> <a href="http://www.okwelectronics.com/datasheets/faqicepic.htm#speed" TARGET="_blank">http://www.okwelectronics.com/datasheets/faqicepic.htm#speed</a></a>
They say a new version is (or will be) available to allow
20 MHz operation. Which version do you have ?

-------------------

I found the other thread I was looking for:

In this thread, he's using an ICE, and the USART baudrate
frequency is not correct:
<a href="http://www.pic-c.com/forum/general/posts/10878.html" TARGET="_blank">http://www.pic-c.com/forum/general/posts/10878.html</a>

Here's where he discovered what the problem was:
<a href="http://www.pic-c.com/forum/general/posts/10973.html" TARGET="_blank">http://www.pic-c.com/forum/general/posts/10973.html</a>



--</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 12473
Sergio
Guest







Re: I2C with 20MHz Processor
PostPosted: Sat Mar 08, 2003 12:25 am     Reply with quote

I also was going to suggest you check the signals with a scope. I do know that the I2C program verifies if it's sending the proper digital state and if not it gets stuck in a loop.



:=:=1. I changed the #use Delay to 20000000
:=:=:=2. I am using sw i2C.
:=:=:=3. PCW Compilter IDE Version 2.28
:=:=:= PCB and PCM Version 2.726
:=:=:=4. I'm using an ICEPIC
:=:=:=
:=:=------------------------------------------------------
:=:=Here's a list of CCS bug fixes, in the vicinity of your
:=:=compiler version. They fixed a problem with i2c slave
:=:=functions in vs. 2.725, so your version is probably OK.
:=:=
:=:=2.719 Optimization updates
:=:=2.721 I2C hardware master mode now works on chips that have it
:=:=2.722 Optimization bug fixed
:=:=2.724 DELAY_US improved
:=:=2.725 Lost I2C slave functions restored
:=:=2.727 Small problem with macros fixed
:=:=2.727 Optimization improvments
:=:=
:=:=You may not like this, but the first thing I would suspect
:=:=would be the ICE.
:=:=
:=:=I recall that someone had a recent problem with, I believe,
:=:=RS-232 baud rates and framing errors. They were using an ICE.
:=:=They thought the PIC clock frequency was one value, but
:=:=instead the ICE was using a different value. This was causing the baud rate to be off frequency.
:=:=Can you check if that's the problem ? It may be affecting
:=:=the i2c baud rate in some way. What does the SCL signal
:=:=look like, when viewed with an oscilloscope ?
:=:=
:=:=If that's not the problem, the closest version I have to
:=:=yours is vs. 2.727. I could compile a small program and
:=:=test it, if need be.
:=---------------------------------------------------------------
:=I don't belive that a hardwareproblem is the reason. I'm using on two other pins a RS232 with 57,6k and this works fine. I will check the SCL-Timing tomorrow.
:=Thanks for your help.
:=Roger
___________________________
This message was ported from CCS's old forum
Original Post ID: 12475
Sergio
Guest







Re: I2C with 20MHz Processor
PostPosted: Sat Mar 08, 2003 12:30 am     Reply with quote

Can you neither read nor write to the chip?


:=:=:=1. I changed the #use Delay to 20000000
:=:=:=2. I am using sw i2C.
:=:=:=3. PCW Compilter IDE Version 2.28
:=:=:= PCB and PCM Version 2.726
:=:=:=4. I'm using an ICEPIC
:=:=:=
:=:=------------------------------------------------------
:=:=Here's a list of CCS bug fixes, in the vicinity of your
:=:=compiler version. They fixed a problem with i2c slave
:=:=functions in vs. 2.725, so your version is probably OK.
:=:=
:=:=2.719 Optimization updates
:=:=2.721 I2C hardware master mode now works on chips that have it
:=:=2.722 Optimization bug fixed
:=:=2.724 DELAY_US improved
:=:=2.725 Lost I2C slave functions restored
:=:=2.727 Small problem with macros fixed
:=:=2.727 Optimization improvments
:=:=
:=:=You may not like this, but the first thing I would suspect
:=:=would be the ICE.
:=:=
:=:=I recall that someone had a recent problem with, I believe,
:=:=RS-232 baud rates and framing errors. They were using an ICE.
:=:=They thought the PIC clock frequency was one value, but
:=:=instead the ICE was using a different value. This was causing the baud rate to be off frequency.
:=:=Can you check if that's the problem ? It may be affecting
:=:=the i2c baud rate in some way. What does the SCL signal
:=:=look like, when viewed with an oscilloscope ?
:=:=
:=:=If that's not the problem, the closest version I have to
:=:=yours is vs. 2.727. I could compile a small program and
:=:=test it, if need be.
:=---------------------------------------------------------------
:=I don't belive that a hardwareproblem is the reason. I'm using on two other pins a RS232 with 57,6k and this works fine. I will check the SCL-Timing tomorrow.
:=Thanks for your help.
:=Roger
___________________________
This message was ported from CCS's old forum
Original Post ID: 12476
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