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

Example of MON51 use

Hello,

I am struggling to download and use the debugger with MON-51 on the cypress FX2 demo board.

I am using the mon-sio1-c0.hex that cypress ships, with one of it's demo programs.

I suspect that they both link the stack/ data into the low 256 bytes. And I loose the debugger around a subroutine call.

Am I just blind, Where is an example project that uses the debugger ?

Thanks

  • The monitor is a program that runs on the target board. It offers the following capabilities:

    * Download user programs
    * Set breakpoints
    * Watch memory
    * Stop program execution

    When the monitor is installed (it is actually downloaded via the USB port for the EZ-USB devices) it starts running and attempts to communicate with the uVision2 Debugger using the serial port.

    The monitor you mention mon-sio1-c0 loads itself at C000h (from what I recall) and uses sio1 for serial communication.

    So, once you have reset the EZ-USB board and the monitor downloads you are ready to download a program and debug it.

    So, to do that, you must create a program making sure you don't overwrite the serial port interrupt vector. This is easily done by configuring the tools so that CODE memory starts at address 0100h. The reset vector will still be located at address 0000h and vectors for interrupts in your program will be located at the correct locations, too. It's just that program code will be located at 0100h and higher.

    The first program you try should be something simple like:

    void main (void)
    {
    volatile unsigned char value = 0;
    
    while (1)
      {
      value++;
      }
    }

    When you create the project, under the debug tab, make sure to select "Use: Keil Monitor-51 Driver" and "Load Application At Startup". If you do not select "Go Til Main" you will get to step thru the startup code.

    Now, to the problems you are currently having:

    I suspect that they both link the stack/ data into the low 256 bytes.

    Yes. That's the only place the stack can go. When the monitor runs, it swaps out the entire 256 bytes of IDATA memory. When your program runs, it's IDATA memory is swapped back in.

    And I loose the debugger around a subroutine call.

    There are lots of things that could cause this.

    * Reprogramming the baud-rate generator timer for the monitor serial port.
    * Reprogramming the serial port.
    * Corrupting the monitor's data area.
    * A program crash.
    * Changing port configurations.

    There are numerous discussions of these kinds of things in the knowledgebase (http://www.keil.com/support/).

    Very few people have trouble with the EZ-USB kits so maybe it's worthwhile to go thru their beginning examples first.

    Hope this helps.

    Jon