|
|
View previous topic :: View next topic |
Author |
Message |
fabsys Guest
|
poblem with rda interupt ... |
Posted: Fri Jun 02, 2006 8:34 pm |
|
|
hi all,
i've a probleme with a rda interupt
Code: |
#include <16F876.h>
#use delay (clock=20000000)
#fuses HS, NOWDT, NOPROTECT, PUT, BROWNOUT, NOLVP
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7,parity=n,bits=8)
#int_global
char a;
#int_rda
void int_reception(void)
{
static char c;
// Read char from USART.
c = getc();
// Send char back to the PC.
putc(c);
}
void main(void)
{
SET_TRIS_a(0b00000010);
SET_TRIS_a(0);
set_tris_c(0b10000000);
// PORT_C=0x00;
// Enable the USART receive interrupt.
enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);
printf("start");
for(;;)
{
if (a)
{
OUTPUT_HIGH(PIN_A0);
a=0;
}
else
{
OUTPUT_LOW(PIN_A0);
a=1;
}
if (INPUT(PIN_B1))
OUTPUT_HIGH(PIN_B2);
else
OUTPUT_LOW(PIN_B2);
delay_ms(100);
}
}
|
if someone can help me ..... thx ;) |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Guest
|
|
Posted: Sat Jun 03, 2006 6:34 am |
|
|
thx PCM programmer for ur help
it's ok |
|
|
|
|
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
|