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

Order of #use declarations

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



Joined: 02 Jul 2008
Posts: 27

View user's profile Send private message

Order of #use declarations
PostPosted: Sat Feb 14, 2009 10:18 am     Reply with quote

Hi!

Do I have to keep a particular order with the #use declaration?

In this order:
Code:
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, timeout=100)
#use i2c(master,sda=PIN_C4,scl=PIN_C3,fast=4000,force_hw)
I2C is working.

But in this way:
Code:
#use i2c(master,sda=PIN_C4,scl=PIN_C3,fast=4000,force_hw)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, timeout=100)
it doesn't work.

Why?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Feb 14, 2009 1:54 pm     Reply with quote

1. Post your PIC.

2. Post your compiler version.

3. Post the #use delay() statement.

4. Be aware that your i2c clock speed is set at only 4000 Hz in your #use i2c
statement. Is that what you want ?
wewa



Joined: 02 Jul 2008
Posts: 27

View user's profile Send private message

PostPosted: Tue Feb 17, 2009 9:10 am     Reply with quote

1. PIC18F4525
2. #use delay(clock=20000000)
3. v 4.057
4. Not really, but this' only a prototype and speed doesn't matter now. I'll change it in my final prog.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Feb 17, 2009 10:12 pm     Reply with quote

I compiled it both ways and compared the .LST files and I don't see any obvious problem. You need to post a little test program that shows the
problem.
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