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

PIC16F1824 INT_RDA does not work

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



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Feb 10, 2012 7:34 pm     Reply with quote

The PIC data sheet says you have to set the APFCON0 bits to 1,
in order to select the alternate pins. I did that and it works:
Code:

#include <16F1824.h>
#fuses INTRC_IO, NOWDT, BROWNOUT, PLL_SW, NOLVP
#use delay(clock=4M)
#use rs232(baud=9600, UART1, ERRORS)


#byte APFCON0 = getenv("SFR:APFCON0") 

#bit TXSEL = APFCON0.2
#bit RXSEL = APFCON0.7

#int_RDA
void  RDA_isr(void)
{
char c;

c = getc();
putc(c);
}



//========================================
void main()
{
TXSEL = 1;
RXSEL = 1;

clear_interrupt(INT_RDA);
enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);
   
while(1);
}
Beowulf



Joined: 10 Feb 2012
Posts: 7
Location: washington

View user's profile Send private message

PostPosted: Fri Feb 10, 2012 8:53 pm     Reply with quote

just updated to the 4.129 software version.

this no longer appears in the LST file in the default case(tx=C4,rx=C5)
Code:

0056:  MOVLB  02
0057:  BSF    1D.2
0058:  BSF    1D.7


I am no longer at my work bench ...so I can't load this onto the PIC to be sure...but It seems as though the 4.128 version has a bug when compiling for this processor. If I have time this weekend I will try this out to see if it works on the PIC.
Beowulf



Joined: 10 Feb 2012
Posts: 7
Location: washington

View user's profile Send private message

(Solved)
PostPosted: Mon Feb 13, 2012 9:15 am     Reply with quote

I listed my compiler version incorrectly in the problem statement. The version that has this issue is:
Code:

CCS PCM C Compiler, Version 4.124


I am convinced that this was a compiler bug. I upgraded to 4.129 and the problem has gone away. Th tx/rx pins are correctly assigned now and the interrupts occur as expected.

**always check for updates**
Ttelmah



Joined: 11 Mar 2010
Posts: 19529

View user's profile Send private message

Re: (Solved)
PostPosted: Mon Feb 13, 2012 9:23 am     Reply with quote

Beowulf wrote:
I listed my compiler version incorrectly in the problem statement. The version that has this issue is:
Code:

CCS PCM C Compiler, Version 4.124


I am convinced that this was a compiler bug. I upgraded to 4.129 and the problem has gone away. Th tx/rx pins are correctly assigned now and the interrupts occur as expected.

**always check for updates**

No!.
Not if the compiler works for what you want.....

Key here is that the 1824 is a pretty new chip, and it always seems to take CCS perhaps a dozen versions to get these working.
However CCS's 'updates', generally are not reliable till they have been tested for a while, so rule has to be 'check for updates _if_ you have something not working right'. Otherwise you may well be asking for problems.....

Best Wishes
Beowulf



Joined: 10 Feb 2012
Posts: 7
Location: washington

View user's profile Send private message

PostPosted: Mon Feb 13, 2012 11:27 am     Reply with quote

you are correct....updates are only useful when there is an actual problem to solve...
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