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 support@ccsinfo.com

INT_RDA

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







INT_RDA
PostPosted: Wed Jul 14, 2004 3:52 pm     Reply with quote

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.
carlosma



Joined: 24 Mar 2004
Posts: 53
Location: Portugal

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

PostPosted: Thu Jul 15, 2004 1:56 am     Reply with quote

If you need to turn ON:
Code:

#INT_RDA
isr_rda() {
output_high(Pin_B1);
}

The CCS auto TRIS the PORTs

Carlos
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