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

Problems with INT_RDA. PIC 16F877.
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Oct 21, 2014 3:04 pm     Reply with quote

Code:
   z==getc();
I saw.
I left.
Gabriel



Joined: 03 Aug 2009
Posts: 1077
Location: Panama

View user's profile Send private message

PostPosted: Tue Oct 21, 2014 3:47 pm     Reply with quote

What the hell is this?

Code:
#INT_RDA
void SerialInt()
{

  if(RC7==0)
  {
     Receive_String[counter_read]=getchar();         // Gets chars from uart
     counter_read++;                           // Increment counter
     if(counter_read==SIZE_BUFFER)counter_read=0;   // Circle Buffer
 
   }else{
   
     getc()

   }

}



you only read and fill the buffer when you input is Zero?
and if its 1 then you also get the char? what the hell?

as Ttelmah said:
Quote:
When INT_RDA triggers it is saying 'there is a character that needs to be read now'.



You dont have to poll the line once you are in the interrupt... the interrupt is triggered by the UART once it ALREADY has the character ready to be placed in a variable or buffer..


I dont think you fully understand what the ISR does, what triggers it, how you are supposed to handle it, and how code flows with interrupts...


G.
_________________
CCS PCM 5.078 & CCS PCH 5.093
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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