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

Conflict between hardware UART and INT_EXT2 / I2C

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



Joined: 04 Aug 2006
Posts: 98

View user's profile Send private message

Conflict between hardware UART and INT_EXT2 / I2C
PostPosted: Wed Jan 11, 2012 8:57 pm     Reply with quote

Hi

I have a system where I:

1. listen for interrupt on pin INT_EXT2
2. in interrupt handler, set flag when INT_EXT2 triggered
3. in main loop code, if flag set:
- read data from IC with I2C
- send the data over hardware UART with putc()

When the IC sends interrupts slowly, everything is fine. But when the frequency of interrupts from the IC increases, I start losing data that I should be receiving from the IC.

If I comment out the putc() code that sends over UART, then the PIC receives all the data from the IC no matter how fast the IC sends data.

So it seems when I send over UART, it is somehow interfering with either I2C or INT_EXT2. Is there anything I can do to stop this?

Note I believe I use hardware I2C and hardware UART:
Code:
#use rs232(baud=31250, xmit=PIN_C6, rcv=PIN_C7, PARITY=N, ERRORS)
#use I2C(master, sda=PIN_B0, scl=PIN_B1, FORCE_HW)


Thanks Smile
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jan 11, 2012 10:31 pm     Reply with quote

If you are going to start a new thread instead of continuing your previous
thread, you need to post your PIC and your compiler version in the new thread.
We don't remember it from the old thread.
theteaman



Joined: 04 Aug 2006
Posts: 98

View user's profile Send private message

PostPosted: Wed Jan 11, 2012 11:19 pm     Reply with quote

PCM programmer wrote:
If you are going to start a new thread instead of continuing your previous
thread, you need to post your PIC and your compiler version in the new thread.
We don't remember it from the old thread.


Hi PCM programmer,

I understand what you mean but this is a different topic, the last one was about RTCC interference. I am sorry for any confusion caused.

I am using a PIC 18F2550 for this project and while i am not at the computer with the dev tools, I know the compiler version is > 4.
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