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

Parity simulation for UART input in debug function

Hi all!

For example, I set disable parity generation and checking at UART0 Line Control Register.
Then I could write "S0IN = 0xAB" to simulate uart input, and it's ok.

But I neen to use UART with parity (even). How could I correct init S0IN? I tried "S0IN = 0xAB" and "S0IN = 0x1AB", anyway Keil say parity error.

Parents
  • You haven't said what chip you're using but, almost certainly, the SIN register comes after parity has been stripped - in just the same way that it does not contain the start & stop bits!

    You usually don't get to see the parity bit itself - just a status bit that tells you whether there was an error.

    You will have to study the documentation for the specific processor for details...

Reply
  • You haven't said what chip you're using but, almost certainly, the SIN register comes after parity has been stripped - in just the same way that it does not contain the start & stop bits!

    You usually don't get to see the parity bit itself - just a status bit that tells you whether there was an error.

    You will have to study the documentation for the specific processor for details...

Children
  • I use LPC2129. When I set no parity, then everything is ok, I have the same result at Debugger and at real hardware. But when I set parity_even, my programm at real harware work fine, but at Debugger always set parity error (PE).

    So, I found some words at:
    www.keil.com/.../uv4_sm_uartcommunication.htm

    "You may write 8-bit or 9-bit values to SxIN. [...] Other special values may be used to simulate parity or frame errors."

    So, could you please tell me how to correct use virtual register S0IN to simulate parity input.

  • I could use "real_device <---> com_port_terminal" and "keil_debugger <---> serial_window".
    For example I type one symbol at keyboard.

    If I use uart with no_parity, both variants work equal.

    If I use uart with even_parity, "real_device <---> com_port_terminal" work correct (the same as befor with no_parity). But "keil_debugger <---> serial_window" generate Parity Error (PE) after any symbol typing.

    So, how could I adjust Keil Serial Window to correct send symbol with parity? Or how I could use S0IN to correct send symbol with parity?

  • Starting to sound like an issue where you should involve Keil support.

    Please open a support issue, and then post back in this thread with the answer you receive from Keil.