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

i2c affecting interrupts

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



Joined: 04 Feb 2009
Posts: 83
Location: PA

View user's profile Send private message Send e-mail

i2c affecting interrupts
PostPosted: Fri Apr 17, 2009 7:38 am     Reply with quote

Hello all!

I am trying to implement (and get working correctly) my i2c bus and RS232. I would also like to use interrupts.

I don't believe there is a need to post the code I have for this yet, since I have a vague question.

Am I really stuck with using the SCL and SDA pins?
I would prefer using these (on my 18F2331) for interrupts.
Since I only have three interrupts I would rather use these pins for INT1 and INT2 and have i2c communicate using two other pins.

Is this possible??

I have:
Code:
#define LCD_XMIT       PIN_A3   //LCD serial transmit
#define LCD_RCV        PIN_A3   //pin reused (receive not required
#define DEVICE_SDA   PIN_C4   //i2c SDA line
#define DEVICE_SLC    PIN_C5   //i2c SLC line
#define RS232_XMIT    PIN_C6   //RS232 serial transmit
#define RS232_RCV     PIN_C7   //RS232 serial receive
//**************************************************

#use rs232(baud=2400,parity=N,xmit=LCD_XMIT,rcv=LCD_RCV,bits=8,invert,stream=LCD)
#use rs232(baud=115200,xmit=RS232_XMIT,rcv=RS232_RCV,parity=N,bits=8,stream=COMP)
#use i2c(master,sda=DEVICE_SDA,scl=DEVICE_SLC)

Thanks as always,

deperkin
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Fri Apr 17, 2009 10:54 am     Reply with quote

If you're only going to use this PIC as a master then you can assign almost any pin for your SCL & SDA pins. The compiler will simply use software I2C to drive them. Simply place the proper pins in your #use i2c() statement and it should work.

Ronald
deperkin



Joined: 04 Feb 2009
Posts: 83
Location: PA

View user's profile Send private message Send e-mail

I2c interrupts
PostPosted: Sat Apr 18, 2009 9:52 pm     Reply with quote

Thank you rnielsen!

I will try this. I am using two 18F2331's but the one in question is always running as master.

THank you for the help... i will try this.
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