I am using an EPM900 emulator to debug a LPC935 application that uses serial output. However, I get nothing in any of the serial windows of uV4 when I run it. I decided to start at the very beginning and loaded the "Hello" example project. Under simulation it works fine and I get the "Hello World" message repeated ad infinitum in the UART#1 window. Under EPM900 emulation it downloads fine and the LEDs flash correctly and the printf(..) instruction is being executed. However, I get nothing in any of the UART windows, including the Debug (printf) viewer. As an aside issue, why does uV4 need 3 UART windows PLUS a Debug (printf) window?
that you are mixing simulation and emulation. They are totally separate entities.
Erik
Of course they are totally separate entities. That is something I teach to my undergraduate students. I was just making the point that it worked when run in a virtual processor, but not in a physical one. If I had not included that information someone would probably have asked if I had tried it under simulation.
A question here is if the simulator would care about incorrect baudrate configuration.
Next thing - what is the route used to get the characters from a physical processor into the UART windows of the IDE?
The answer to your first question is "I doubt it". I doubt if the simulator actually does a parallel to serial (async) to parallel conversion. It probably just passes the data in the TX buffer to the UART window handler - but I'm not sure. When I first tried the example under simulation the CPU clock was set to 7.373MHz, but the baud rate generator was set of 9600 baud, but with values for a 12MHz CPU clock and it worked fine. Also there is no facility to select the baud rate for the simulator. As for the second question, I can't answer that as I don't have the design for the bond out chip.I assume the serial to USB is carried out by the bond out chip I simply took an example program provided by Keil. It has three targets: - Simulation, MCB900-Run and EPM900-Emulator. The example code assumed a system clock of 12MHz, but since I am using the on-board clock of 7.373MHz I changed BRG0 and BRG1 register values to give me a Baud rate of 9600 baud
I just wanted to point out the issues with baudrate.
Have you tried an oscilloscope to verify what serial data the chip sends out from the UART, before you transfer the serial data to your PC?
A question here is if the simulator would care about incorrect baudrate configuration. numerous threads have been "it works in simulator, but not in real life" and resolved by fixing the baudrate.
Eric, your comment is well-found. Some years ago I did an investigation into RS232 to USB adaptors. The early ones simply divided down the USB clock to get the baud rate clock - some with questionable accuracy - the lower the CPU clock frequency, the bigger the problem. Some worked and some didn't. Of course, things are much better now, but it did highlight the necessity of getting the baud rate correct. Back to the subject. Do we actually KNOW if the EPM900 even supports serial comms? There is no mention of it anywhere in the documentation and nothing anywhere on the Keil web site. We (actually, I) assume that as the EPM900 only has a USB socket and Keil provide an example program that is designed for the EPM900 and uses serial comms in the form of a "printf()" statement and includes <serial.h> that the serial data goes via the USB connection. A reasonable assumption, but that's all it is - an assumption.