Keil Logo

µVISION DEBUGGER: PRINTF DOES NOT PRINT THE LAST CHARACTER


Information in this article applies to:

  • C166 Version 4.03

SYMPTOMS

I have the following line of code in my program:

printf("\nhello");

When I step through my code to the line after the printf and I examine the serial window I see:

hell

Why isn't it printing the last character?

CAUSE

The debugger is accurately simulating the baudrate of the microcontroller. As you step through code you will have to step through several more lines before the required delay has elapsed and the final character has been completely transmitted. The number of lines depends on your code and the baudrate.

RESOLUTION

You can turn off accurate simulation of the serial port timing by setting VTREG S0TIME (for serial port 0) to 0. You can do this by typing the following into the Command window:

S0TIME = 0

To turn it back on, set VTREG S0TIME to 1.

Note:

  • Use the VTREG STIME for MCUs that support only 1 serial port.

Last Reviewed: Tuesday, October 14, 2008


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.