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

Unable to use RDA interrupt with 16F648A mcu....PCM bug ??

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



Joined: 08 Sep 2003
Posts: 492
Location: India

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

Unable to use RDA interrupt with 16F648A mcu....PCM bug ??
PostPosted: Sat Jul 22, 2006 6:21 am     Reply with quote

Hi,

Compiler: PCM 3.169
MCU: 16F648A

I found that the INT_RDA interrupt does not work with the 16F648A mcu, whereas the RDA interrupt works well with a 16F628 mcu (using the same hardware and software).

Kindly advise what I am missing out here...???

See Code below....

thanks
arunb

Code:


#include <16F648A>

#use delay(clock=4000000)

#FUSES INTRC,NOWDT,PUT,NOPROTECT,NOMCLR,NOCPD,BROWNOUT,NOLVP
#use rs232(baud=1200,xmit=pin_b2, rcv=pin_b1,parity=n,errors)

char cRcvData;

#ZERO_RAM
void initialise()
{

   setup_comparator(NC_NC_NC_NC);
   set_tris_a(0b11110010);
   set_tris_b(0b00000010);

   enable_interrupts(INT_RDA);
   enable_interrupts(GLOBAL);

}

void main()
{
   initialise();

   do
   {


   }while(TRUE);

}

#int_rda
usart_rcv()
{
   cRcvData=getc();
   putc(cRcvData+1);

}

PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Jul 22, 2006 12:54 pm     Reply with quote

Quote:
Compiler: PCM 3.169
I found that the INT_RDA interrupt does not work with the 16F648A mcu.

Vs. 3.169 doesn't generate code for a hardware UART on pins B2 and B1.
It creates a software UART instead.

You have at least four possible solutions:
1. Use a different PIC.
2. Upgrade the compiler.
3. If you have PCW or PCWH, then use the Device Editor to try to fix it.
4. Try a work-around as shown in this post:
http://www.ccsinfo.com/forum/viewtopic.php?t=26631&start=8
The register addresses are the same, for the 16F648A.
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

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

RE:
PostPosted: Sat Jul 22, 2006 9:20 pm     Reply with quote

Hi,

Thank you for the help.

Well I could use the workaround, but won't CCS give me updated files for the compiler ??? Do you think I should ask ???

Actually I don't have contract with them...

thanks
arunb
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Jul 22, 2006 11:07 pm     Reply with quote

Vs. 3.169 was released in mid-July of 2003. That's 3 years ago.
I doubt that they would give you a free upgrade after that amount
of time, but you can ask them.
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

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

RE:
PostPosted: Sun Jul 23, 2006 12:02 am     Reply with quote

Hi,

Just one more query. I am planning to use the 16F88 mcu, are there any bugs in the compiler regarding this mcu ?

thanks
arunb
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jul 23, 2006 2:47 am     Reply with quote

PCM vs. 3.169 has the same bug for the 16F88. It won't generate code
for a hardware UART on the hardware pins (B5 and B2). It creates a
soft UART instead.
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

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

RE":
PostPosted: Sun Jul 23, 2006 11:28 pm     Reply with quote

Can you give the code for a puts command as well ??

thanks
arunb
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

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

PostPosted: Mon Jul 24, 2006 8:04 am     Reply with quote

You don't have to use the compiler's built in functions. You can setup the UART yourself. If you are going to use the printf command, then you will need to write your own or use sprintf to put the data into a variable and then write that data out the uart.
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