lokaluser Guest
|
INT_RDA |
Posted: Wed Jul 14, 2004 3:52 pm |
|
|
Hi,
this is the first time I use C for my project. I try to receive a DMX512 signal via the hardware-uart on pin c7 of the pic16f871.
I'm using a short programm that should light a LED when data is received, but nothing happens. The signal on Pin C7 is OK, but the LED stays dark.
Here is my Code:
8<------- Snipp --------
#include <16f871.h>
#fuses HS,NOWDT,NOPROTECT,NOBROWNOUT,NOPUT
#use DELAY(CLOCK=20000000)
#use RS232(BAUD=250000,RCV=PIN_C7,BITS=9,BRGH1OK,ERRORS)
#use FAST_IO(A)
#use FAST_IO(B)
#use FAST_IO(C)
#use FAST_IO(D)
#use FAST_IO(E)
#define LED_GRUEN PIN_B1
#define LED_ROT PIN_B2
#INT_RDA
isr_rda() {
output_low(Pin_B1);
}
void main() {
OUTPUT_A (0b00000000);
SET_TRIS_A (0b11111111);
OUTPUT_B (0b11111111);
SET_TRIS_B (0b11111001);
OUTPUT_C (0b11111110);
SET_TRIS_C (0b11110000);
OUTPUT_D (0b00000000);
SET_TRIS_D (0b10000000);
OUTPUT_E (0b00000000);
SET_TRIS_E (0b11111100);
ENABLE_INTERRUPTS(INT_RDA);
ENABLE_INTERRUPTS(GLOBAL);
output_low(Pin_B2);
while(1){}
}
8<-------- Snapp ---------
Thanks for looking,
Stefan
P.S. I also try to write in english. |
|