PSOC6 UART using TXS0104 bidirectional voltage level translation

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
AyZo_4728016
Level 1
Level 1

Hi There,

I am using PSOC6 to communicate with a controller board over UART. I am using TXS 0104 between the PSOC6 micro and the RS422 driver. The message length is about 300 bytes sent every 100 milliseconds. The issue is every few messages I get extra bytes (1 to 3 bytes) the extra bytes are 0xFF.

Any Idea what what might be causing this behavior?

pastedImage_0.png

0 Likes
8 Replies
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi,

Can you please let us know the baud rate ?

Are you using HAL ?

Can you please share your project so that we can reproduce the issue at our end?

Regards

Alakananda

Alakananda
0 Likes

The baud rate is 115200.

No I am not using HAL.

0 Likes

Hi,

Can you have a look at the below code example

https://www.cypress.com/documentation/code-examples/ce219656-psoc-6-mcu-uart-using-low-level-apis

Can you please share your project so that we can reproduce the issue at our end.

Regards

Alakananda

Alakananda
0 Likes

can I privately send it to you?

0 Likes

Hi,

Did you try the code example which we shared in the previous post

Is it possible for you to send the truncated version of the code in forum?

Regards

Alakananda

Alakananda
0 Likes

Hi,

yes i did try this code before posting on this forum.

Here is the code for the UART task

#define

#define

#define Ch1_PORT       P5_0_PORT

#define Ch1_RX_NUM     P5_0_NUM

#define Ch1_TX_NUM     P5_1_NUM

// UART config In the main loop

   Ch1_Serial_Start();

   Cy_SCB_UART_Init(Ch1_Serial_HW, &Ch1_Serial_config, &Ch1_Serial_context);

   Ch1_Serial_HW->INTR_RX_MASK = SCB_INTR_RX_MASK_NOT_EMPTY_Msk;

Cy_SysInt_Init(&Ch1_Serial_SCB_IRQ_cfg, &Ch1_Serial_Isr);

   NVIC_EnableIRQ(Ch1_Serial_SCB_IRQ_cfg.intrSrc);

  

Cy_SCB_UART_Enable(Ch1_Serial_HW);

  Cy_GPIO_SetDrivemode(Ch1_PORT, Ch1_RX_NUM, CY_GPIO_DM_HIGHZ);

Cy_GPIO_SetDrivemode(Ch1_PORT, Ch1_TX_NUM, CY_GPIO_DM_STRONG_IN_OFF);

// UART ISR

   void Ch1_Serial_Isr()

{

       

        if((Ch1_Serial_HW->INTR_RX_MASKED & SCB_INTR_RX_MASKED_NOT_EMPTY_Msk ) != 0)

   {

            

           Ch1_Serial_HW->INTR_RX = Ch1_Serial_HW->INTR_RX & SCB_INTR_RX_NOT_EMPTY_Msk;

           

           Rx_Buffer_Ring[RX_Counter]=Cy_SCB_UART_Get(Ch1_Serial_HW);

                    

           

            if (RX_Counter>0)

      {

                          if (Rx_Buffer_Ring[RX_Counter]==End_Byte2 && Rx_Buffer_Ring[RX_Counter-1]== End_Byte1)

                {

                    Ch1_Rx_Byte_Count= RX_Counter+1;

                    RX_Full_Flag=1;

                }

                     else {RX_Full_Flag=0;}

       }

            

              if (RX_Full_Flag==0){RX_Counter++;}

   }

   

}

    }

0 Likes

Hi,

just checking to see if there is any update on this.

Thank you

0 Likes

BTW, when I use PSOC4 I with the same setup I dont get those extra bytes.

Thank you

0 Likes