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

18f452 #INT_TBE Problem

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



Joined: 10 Sep 2003
Posts: 13

View user's profile Send private message

18f452 #INT_TBE Problem
PostPosted: Fri Oct 01, 2004 1:11 am     Reply with quote

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

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

PostPosted: Fri Oct 01, 2004 6:05 am     Reply with quote

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.
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