PSOC UART - Mark/Space character sending

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

cross mob
Anonymous
Not applicable

Hi all,

I am going nuts with MDB serial communication, sending MARK/SPACE data. CPU clock is se to 24Mhz.

I have an UART block, set to 9600 and no hw flow. 1 bit parity. I use the block only for sending. The problem that i'm facing that MARK is set on wrong characters which i trace on the line. If i CyDelay(100) it always works, but the problem arises when I want to sent characters in sequence:

For example following code:

        UART_MDB_SLAVE_TX_SetTxAddressMode(UART_MDB_SLAVE_TX_SET_MARK);

        UART_MDB_SLAVE_TX_PutChar((uint8) 0x01); //

        UART_MDB_SLAVE_TX_SetTxAddressMode(UART_MDB_SLAVE_TX_SET_SPACE);

        UART_MDB_SLAVE_TX_PutChar((uint8) 0x02); //

        UART_MDB_SLAVE_TX_PutChar((uint8) 0x03); //

        UART_MDB_SLAVE_TX_PutChar((uint8) 0x04); //

          Puts mark on byte 0x03 ?! or sometimes 0x02...

If i send 5 bytes

        UART_MDB_SLAVE_TX_SetTxAddressMode(UART_MDB_SLAVE_TX_SET_MARK);

        UART_MDB_SLAVE_TX_PutChar((uint8) 0x01); //

        UART_MDB_SLAVE_TX_SetTxAddressMode(UART_MDB_SLAVE_TX_SET_SPACE);

        UART_MDB_SLAVE_TX_PutChar((uint8) 0x02); //

        UART_MDB_SLAVE_TX_PutChar((uint8) 0x03); //

        UART_MDB_SLAVE_TX_PutChar((uint8) 0x04); //

        UART_MDB_SLAVE_TX_PutChar((uint8) 0x04); //

          Puts mark correctly on 0x01

So am i getting this wrong somehow ? To me it looks random, if i send in a while loop:

while(1)

{

        UART_MDB_SLAVE_TX_SetTxAddressMode(UART_MDB_SLAVE_TX_SET_MARK);

        UART_MDB_SLAVE_TX_PutChar((uint8) 0x01); //

        UART_MDB_SLAVE_TX_SetTxAddressMode(UART_MDB_SLAVE_TX_SET_SPACE);

}

Mark is set ever 5 - 10th byte ?!

What am i missing ?

Please some help

0 Likes
1 Reply
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

This link may be useful-

https://community.cypress.com/thread/20001

Please share your project too.

0 Likes