|
|
View previous topic :: View next topic |
Author |
Message |
Maverick72
Joined: 01 Feb 2006 Posts: 5
|
Having a RS485 and RS232 port on a PIC18F1320 |
Posted: Wed Feb 01, 2006 3:03 pm |
|
|
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
|
|
Posted: Wed Feb 01, 2006 3:36 pm |
|
|
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). |
|
|
|
|
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
|