|
|
View previous topic :: View next topic |
Author |
Message |
micro
Joined: 10 Sep 2003 Posts: 13
|
18f452 #INT_TBE Problem |
Posted: Fri Oct 01, 2004 1:11 am |
|
|
I wrote a simple code snipped like in the below. I want to use TBE interrupt but some problem. When I wrote the code in below, interrupt routine works (porta turn completely high level) but "putc('A')" function does not work. However, When I disable interrupts, "putc" works. Why does this problem occure?
#include <18f458.h>
#include <string.h>
//#device *=16
#fuses H4,NOWDT,NOPROTECT,NOBROWNOUT,NOPUT,NOLVP
#use delay(clock=40000000)
#use rs232 (baud=9600, xmit=PIN_C6, rcv=PIN_C7,ERRORS)
#INT_TBE
void PumpTransmitInt(void)
{
output_a(0xFF);
}
void main(void)
{
enable_interrupts(INT_TBE);
enable_interrupts(GLOBAL);
putc('A');
while(1);
} |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Fri Oct 01, 2004 6:05 am |
|
|
I think you might be a bit confused about what the TBE int is. It is a transmit interrupt. This is where you normally load the value to be transmitted. The interrupt fires whenever the transmit register is empty. It your case, it is going to fire all the time. Constantly, over and over and over. That is why nothing appears to work after the ints are enabled. |
|
|
|
|
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
|