|
|
View previous topic :: View next topic |
Author |
Message |
theteaman
Joined: 04 Aug 2006 Posts: 98
|
Conflict between hardware UART and INT_EXT2 / I2C |
Posted: Wed Jan 11, 2012 8:57 pm |
|
|
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 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jan 11, 2012 10:31 pm |
|
|
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
|
|
Posted: Wed Jan 11, 2012 11:19 pm |
|
|
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. |
|
|
|
|
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
|