Content originally posted in LPCWare by james on Tue Mar 13 21:06:50 MST 2012
Thanks for the replies,
I am sending signals of 9600baud, 1start, 1stop, 8bits, no parity. As I need the UART1 for other devices, I have to use UART0 for rs485 communication. I am using a GPIO p1.24 for the enable control. p0.2 to Tx and p0.3 to Rx of max485.
I modified the UART example and changed
<code>
UART0_Init(9600);
LPC_GPIO1->FIOSET = Enable;
UART0_Sendchar(c);
UART0_Sendchar(c);
LPC_GPIO1->FIOCLR = Enable;
while(1)
{
cout = UART0_Getchar();
printf("%d\n",cout);
}
</code>
After sending the 2byte, I should be getting response from the device I am talking to. However the the response i got was 0.
I check with a picoscope and confirmed that there was data been sent out.
From the 1768 user manual, only UART1 was stated to have RS485 support, does my implementation work? Or what did i implemented wrongly?
Please advise.