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

Having a RS485 and RS232 port on a PIC18F1320

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



Joined: 01 Feb 2006
Posts: 5

View user's profile Send private message

Having a RS485 and RS232 port on a PIC18F1320
PostPosted: Wed Feb 01, 2006 3:03 pm     Reply with quote

Hi,

I'm trying to setup two serial ports on my chip. I already use the PIC USART module, but can't seem to be able to use the

#use rs232(baud=9600,xmit=PIN_DALLAS_TX,rcv=PIN_DALLAS_RX,stream=DALLAS)

Command to implement my other port. Could you please help me.

P.S. Here's my serial interupt routine.

#int_RDA
void UART_RX(void)
{
int i=0;
int timer_usart_rx=0;

if (kbhit(RS_485))
{

/* Boucle pendant 20msec ou jusqu'� ce que le buffer soit plein */
while(timer_usart_rx <= MAX_USART_TIMER && i <= RS485_BUFFER_SIZE)
{
if(kbhit(RS_485))
{
rs_485_buffer[i]=getc(RS_485);
i++;
}
delay_ms(1);
timer_usart_rx++;
}

bit_set(flag1,RS_485_RX_FLAG);
}

}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 01, 2006 3:36 pm     Reply with quote

Quote:
#use rs232(baud=9600,xmit=PIN_DALLAS_TX,rcv=PIN_DALLAS_RX,stream=DALLAS)

Show both of your #use rs232() statements, and show the #define
statements for all constants that you use in them. (Like the "DALLAS"
constants above).
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