View previous topic :: View next topic |
Author |
Message |
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
Unable to use RDA interrupt with 16F648A mcu....PCM bug ?? |
Posted: Sat Jul 22, 2006 6:21 am |
|
|
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
|
|
Posted: Sat Jul 22, 2006 12:54 pm |
|
|
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
|
RE: |
Posted: Sat Jul 22, 2006 9:20 pm |
|
|
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
|
|
Posted: Sat Jul 22, 2006 11:07 pm |
|
|
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
|
RE: |
Posted: Sun Jul 23, 2006 12:02 am |
|
|
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
|
|
Posted: Sun Jul 23, 2006 2:47 am |
|
|
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
|
RE": |
Posted: Sun Jul 23, 2006 11:28 pm |
|
|
Can you give the code for a puts command as well ??
thanks
arunb |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Mon Jul 24, 2006 8:04 am |
|
|
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. |
|
|
|