This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

TO CHECK WHETHER RS 485 IS WORKING

Inorder to check whether my rs 485 is working,i had connected my lpc2378 (rs485) with my PC through ADAM-4561(1 port isolated USB to RS 232/422 485converter).when i open the hyperterminal to see the transmitted data ,nothing is shown.Now how to check it and where to check it?????.i am very new to microprocessor development and am still figuring out the way things work on the LPC2378 . So up front apologies for "stupid" questions.i had done the programing.First time iam doing code with rs 485.MAX3430EPA IC pin REbar and DE is connected to p2(2),RO pin to p2(1) and DI pin is connected to p2(0).This is the code which i have written.

#include <LPC23xx.H>

#include <stdio.h>
int main (void)
{

PCONP |= (1<<4)                       /* power for uart 1 */
PINSEL4 |= 0x0000000A;                 /* Enable TxD1 *//* Enable RxD1 */
PINMODE4=0X0000003A;
FIO2DIR=0X00000037;
FI02MASK=0X00000004;
U1LCR = 0x83;                         /* 8 bits, no Parity, 1 Stop bit */
U1DLM = 0x00;
U1DLL = 69;                           /* 9600 Baud Rate @ 16MHz Clock */
U1FDR = 0x21;
U1LCR = 0x03;                          /* DLAB = 0 */
U1FCR = 0x81;

while(1)
{
      FIO2SET|=(1<<2);               /*TRANSMIT MODE*/
      U1THR = 'A';
      while (!(U1LSR & 0x40));
      FIO2CLR|=(1<<2);
     while (!(U1LSR & 0x01));
      data1 =U1RBR;
}

.
while debugging,it is seen that pin 2 is not set in the transmit mode,even if it is given FIO2SET|=(1<<2).what will be the problem.please help
Is my code correct,if not please help me with changes. .please provide valuable suggestions.

Parents Reply Children
No data