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

int_rda calls forever

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



Joined: 26 Jul 2009
Posts: 5

View user's profile Send private message

int_rda calls forever
PostPosted: Sun Mar 21, 2010 9:32 am     Reply with quote

Please help,
I wrote a simple Rx counter code.
I expected to see each RX activity, but unfortunately this call executes every cycle of CPU and counts forver!
What can I do to call this isr when RX comes ?
Code:

#include <16F688.H>
#fuses INTRC_IO, NOWDT, NOPROTECT, PUT,NOMCLR
#use delay(clock = 8000000)

#use rs232 (baud=19200, rcv=pin_c5, xmit=pin_c4, parity=N, stop=1,Errors)

#include "flex_lcd420_688.c"
#include "stdlib.h"

int counter;

#int_rda
void comm_test ()
{
         counter= counter +1;
         lcd_gotoxy(1,1);
         printf(lcd_putc,"int_rda : %d ",counter);
   
}

void main() {
     lcd_init();
     enable_interrupts(int_rda);
     enable_interrupts(GLOBAL);

while(true) {}
}

please help Rolling Eyes
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Mar 21, 2010 9:47 am     Reply with quote

You have to read the UART receive register in the INT_RDA routine to clear the interrupt. Example: c=getc()
_________________
Google and Forum Search are some of your best tools!!!!
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