PSoc5 UART_SetRxAddress1 does not work - Cypress.com Forums http://www.cypress.com/? Re: PSoc5 UART_SetRxAddress1 does not work http://www.cypress.com/?rID=60278 Glad it worked.

]]>
Sat, 10 Mar 2012 13:56:27 -0600
Re: PSoc5 UART_SetRxAddress1 does not work http://www.cypress.com/?rID=60271 Hi hli,

Thanks for your help. Yes, I need to use the hardware mode. Now I can change the address of the UART.

Ryl

]]>
Sat, 10 Mar 2012 01:50:05 -0600
Re: PSoc5 UART_SetRxAddress1 does not work http://www.cypress.com/?rID=58475 The manual says to that (page 8):

Software Byte by Byte – Hardware indicates the detection of an address byte
(UART_RX_STS_MRKSPC status) for every byte received. Software must read the byte and
determine if this address matches the device addresses defined as in the Address #1 or
Address #2 parameters or any other additional addresses.
 

I would read this as 'the UART tells the ISR that an addrsss byte has received, but the ISR needs to handle the addressing by itself'. This means that setRxAddress would have no effect, since all addressing is done in software (the manual mentions this on the same page).

 

hli

]]>
Fri, 20 Jan 2012 15:12:06 -0600
Re: PSoc5 UART_SetRxAddress1 does not work http://www.cypress.com/?rID=58473 Hi there,

Thank you for your reply.

The UART is configured as Full duplex.

Addressing mode is Byte by Byte.

I use and ISR to read the data (from the UART doc example)

I have attached the setup of the UART as a jpg.

In the code below I added the clear rx and tx buffers as well as the stop and start but this did not help.

 

Ryl

 

// DOES NOT WORK!!!
// The UART_485_SetRxAddress1() call does not change the hardware address
void RS485_SetSensorAddress(int address)
{
    char outputStr[80];
    sprintf(outputStr,"Setting 485 UART address 1 to %d",address);
    SendUARTMessage(outputStr,1);
   
    sprintf(outputStr,"Current address = %d",UART_485_RXADDRESS1_REG);
    SendUARTMessage(outputStr,1);
   
    SendUARTMessage("485 UART TX complete",1);
   
    UART_485_ClearRxBuffer();
    UART_485_ClearTxBuffer();
   
    CyDelay(5);

    UART_485_SetRxAddress1((uint8)address);
    UART_485_Stop();
    UART_485_Start();
   
    sprintf(outputStr,"Current address = %d",UART_485_RXADDRESS1_REG);
    SendUARTMessage(outputStr,1);
   
    SendUARTMessage("485 UART Address change complete",1);
   
}

]]>
Fri, 20 Jan 2012 13:50:00 -0600
Re: PSoc5 UART_SetRxAddress1 does not work http://www.cypress.com/?rID=58420  It would be easier if you upload your project here :-)

]]>
Wed, 18 Jan 2012 16:58:52 -0600
Re: PSoc5 UART_SetRxAddress1 does not work http://www.cypress.com/?rID=58417 Oh, and which method is it that you call? The topic says UART_SetRxAddress1, but the posting UART_SetTxAddress1...

]]>
Wed, 18 Jan 2012 13:55:38 -0600
Re: PSoc5 UART_SetRxAddress1 does not work http://www.cypress.com/?rID=58416 How is your UART configured?

- full vs., half duplex

- what address mode do you use?

- how do you read the data (ISR?)

Could it be that there is still data in the buffer which is send to the old address?

hli

]]>
Wed, 18 Jan 2012 13:54:27 -0600