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

RDA_isr() PIC16F648A
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
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Wed Aug 22, 2007 5:58 am     Reply with quote

Quote:

I will finish the projetc with no RDA_isr()

Leaving an objective it is not the way to overcome it, nor to learn.

I also guess that the problem is related with your hardware.
Program your PIC with the code posted by PCM Programmer and with the help of a meter
pls. could you post the following voltages measured in your circuit.

GND as reference.
PIC_PIN14:
PIC-PINB1:
PIC-PIN4 (MCLR):
MAX232-PIN2:
MAX232-PIN6:



Humberto
saleh3



Joined: 28 Oct 2011
Posts: 1

View user's profile Send private message

PostPosted: Fri Oct 28, 2011 4:11 pm     Reply with quote

Use this
Code:

#define rx_buffer_size  16
char rx_buffer[rx_buffer_size];
#bit framingeError = getenv("BIT:FERR")
#bit overrunError = getenv("BIT:OERR")
char rx_index = 0;
#byte RCREG = getenv("SFR:RCREG")

#int_RDA
void  RDA_isr(void)
{   
   char data;   
   data = RCREG;
   if ((!framingeError) & (!overrunError)){
     rx_buffer[rx_index++] = data;
   }
   if (rx_index >= 16) rx_index = 0;
   
}

and
Code:

#use rs232(baud=9600,parity=E,xmit=PIN_C6,rcv=PIN_C7,bits=8,ERRORS)

don't forget errors.

When data has been transmitted to microcontroller, flag bit CRIF set to true and it will be cleared as soon as RCREG value has been read.
If you don't read RCREG's value in isr RCIF will remain set and produce interrupt and send your micro to infinite loop.
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