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

Simulator printf bug when using reg515a.h

Can anyone else verify that the Hello example fails to output to the serial#1 window when the reg515a.h is included. Single stepping through the program I can see the characters being written to SBUF but nothing is displayed in serial#1.

Just by replacing the statement "#include <reg515a.h>" with say "#include <reg552.h>" the program works just fine.

Parents
  • I tried the HELLO WORLD example program and selected the C515A-L. It works fine with one exception -- the watchdog timer is set by default for the C515A-L. This resets the simulated chip every so often and MAY be the cause of your problems. Take a look at the following knowledgebase article for information on how to disable it.

    http://www.keil.com/support/docs/1966.htm

    Note that once a character is written into SBUF, it does not instantly appear in the serial window. The serial port (on the real hardware and under simulation) takes some time to transmit a character. So, you will not see the character written to SBUF appear for 10 BAUD bit times. In other words, if your baud rate is 1200, it will take 1/120 seconds before a character written into SBUF appears in the serial window.

    An exception to this rule! If you set the STIME VTREG to a value of 0, accurate serial port timing is thrown out the window and characters written to the serial port are immediately output to the serial window. Refer to the following knowledgebase article for more information:

    http://www.keil.com/support/docs/1943.htm

    Jon

Reply
  • I tried the HELLO WORLD example program and selected the C515A-L. It works fine with one exception -- the watchdog timer is set by default for the C515A-L. This resets the simulated chip every so often and MAY be the cause of your problems. Take a look at the following knowledgebase article for information on how to disable it.

    http://www.keil.com/support/docs/1966.htm

    Note that once a character is written into SBUF, it does not instantly appear in the serial window. The serial port (on the real hardware and under simulation) takes some time to transmit a character. So, you will not see the character written to SBUF appear for 10 BAUD bit times. In other words, if your baud rate is 1200, it will take 1/120 seconds before a character written into SBUF appears in the serial window.

    An exception to this rule! If you set the STIME VTREG to a value of 0, accurate serial port timing is thrown out the window and characters written to the serial port are immediately output to the serial window. Refer to the following knowledgebase article for more information:

    http://www.keil.com/support/docs/1943.htm

    Jon

Children