Connect with us

8051 on-chip debugging

Discussion in 'Electronic Design' started by Schueler, Mar 25, 2011.

Scroll to continue with content
  1. Schueler

    Schueler Guest


    I would like to use the 8051 derivate MAXIM DS89C4xx in one of my
    experiments regaring motor controlling but I am worried about the on-chip
    debugging capabilites. I could not find any material on this topic. Does
    anybody know whether the DS89C4xx series support debugging or not? Any other
    known 8051 derivate which features on-chip debugging and which offers an
    evaluation board?

    Thanks in advance.

    Regards B. Schueler
  2. Chris H

    Chris H Guest

    This is because most MCU don't have on chip debugging capabilities.
    Over the last 5 -10 years JTAG has become more common. The 8051 family
    which is much older does not have it on the majority of parts.
    What sort of on chip debugging are you looking for? The Atmel and NXP
    parts have on chip debug capability when used with an Ice (they use the
    Hooks and Enhanced Hooks system that does nto require a bondout part)

    Others such as Sylabs do have JTAG.

    Had you asked last month I had two 8061 ICE to give away (a Nohau and a
    Hitex) but they have gone now. Might be worth a punt on ebay for
    Emulators as both iSystem and Signum did Ice for the Dallas/Maxim part
    you are interested in.
  3. TTman

    TTman Guest

    Not easily/cheaply... see the other post.... Closest you will get is to
    write your own on board 'traps' that dump CPU status/important bits over the
    com port... or use simple diagnostic LEDs on spare port pins to identify
    various program points.
    It's a good processor :)
  4. Chris H

    Chris H Guest

    Or..... If you are using the Keil compiler there is a Monitor system
    that works well (for a monitor :)

    This is a small piece of SW that will let you put in break points and
    single step the code on the board etc. It works though the serial port
    and talks to the Keil uVision simulator debugger.

    There are several versions of the monitor depending on the chip and the
  5. Rich Webb

    Rich Webb Guest

    Which reminds me that there is a version of the NoICE monitor/debugger
    for the 8051. I use their ARM debugger with a Segger J-Link quite a lot
    and their MSP430 on those few occasions lately when I use a 430.

    I have not used any of their offerings for the smaller processor
    families but NoICE has been around for a long time and their lead guy,
    John Hartman, is pretty fanatical about customer support. If it fits the
    OP's requirements, I'd definitely recommend it for consideration.
  6. Chris H

    Chris H Guest

    Looks interesting and something to consider if you can't get the Keil
  7. Nico Coesel

    Nico Coesel Guest

    I'd skip any 8051 CPU. Move to ARM and save yourself a couple of
    headaches. Most ARM controllers have full debugging capabilities.
    But... you should realise you can't debug realtime processes anyway.

    If you want to build a motor controller I'd first calculate the
    minimum and maximum PWM limits and hardcode these in software. The
    next step is to prototype the control loop using dummy input values.
    This can be done on a PC (and debug on a PC) since you are far better
    of writing complex pieces of software on a PC first and then compile
    them for your embedded platform.

    There should be very little use for a debugger on microcontrollers. In
    other words: avoid having to use a debugger on a microcontroller.
  8. Guest

    Got a suggestion for an 8051 derivative with I2C, USB, and complete x51 ports?
    I have a project coming up that's essentially a rehash of a product that's
    been shipping for a decade. I need to add a bunch of crap to it but the boss
    wants to salvage the code in the original device (he doesn't trust
    programmers' schedules). If I were starting from a clean slate, I'd probably
    go with a Cortex M0 and throw the thing over the wall to the programmers. If
    it stays with an 8051 I might do the whole thing myself.

    The current widget uses an Atmel 8051 but it's lacking I2C. I see the SiLabs
    parts have I2C but it appears they don't have full 8051 ports. SiLabs is
    interesting anyway. Thanks.
  9. Nico Coesel

    Nico Coesel Guest

    Headaches: no real stack (7 levels deep is not a stack and you must
    keep some locations free for interrupts) so the compiler must use
    overlays for function calls. 3 different memory areas. Very cumbersome
    (=slow) access to external memory with different instructions to get
    data from ROM or RAM. The real problem is that even though you program
    in C, you still can't really port the code due to all the pragmas,
    language extensions and the inability to really use pointers (which
    clutters your program because you'll make all variables global).

    Which leads me to a point which IMHO is often overlooked. When
    deciding to use a platform you'll also invest time to write specific
    libraries for that platform. For some reason the decision never seems
    to include calculating the loss when moving to a different platform.
    In the end the price counts and ARMs are (getting) cheaper due to the
    heavy competition.
    YMMV. For ARM you can use GCC + Eclipse which is completely free.
    Since GCC and Eclipse support a very wide range of platforms and
    programming languages chances are that you don't need to learn a new
    toolchain if you already use GCC + Eclipse. Most compiler vendors have
    or are switching to Eclipse anyway.

    I admit I have spend quite some time to understand GCC and binutils
    but since its the same for every platform the time is not wasted when
    moving to a different platform. Recently I had to write some firmware
    for a PIC controller. For that purpose I wrote a wrapper around the
    PIC C compiler so it behaves like GCC and so I could use Eclipse
    instead of Microchip's IDE.
  10. Arlet Ottens

    Arlet Ottens Guest

    What's the problem with "overkill", if it doesn't come at any extra cost
    ? The small ARM controllers are very easy to use.

    ARM tool chain (free for small projects), trivial to set up:
  11. TTman

    TTman Guest

    Sorry, but what headaches ?. You can't equate modern gen risc core 8051

    how do you arrive a 7 level stack on a 51 ???? Or did I misunderstand ?
  12. Pardon the French, but you don't know what you're talking about.
    That it does, for lack of stack size. But no, the limit is _not_ 7 levels.
    None involved.
    The few ones involved are pretty standard in the embedded world, being
    nothing more but expansions of the traditional __far/__near pattern, and
    can be ported just fine. You just have to follow standard practice and
    put a macro as a delimiter between your code and the compiler. Redefine
    the macro and all the language extensions are gone.
    The majority of any such inability would be in the users' head.

    Yes, it really doesn't like function pointers. But there's a huge step
    from that to what you claim.
  13. Nico Coesel

    Nico Coesel Guest

    Its something like 7 levels. Maybe its 5 maybe its 10. Anyway, it is
    not much. It has been too long since I bothered to look at it.
    xram xrom iram?
    Its not just function pointers but also pointers to variables and
    structs lead to extremely bulky & slow code. Making all variables and
    structs global is the only solution to keep your code running fast.

    And then try to have a pointer point to a string which can be in
    internal ram, external ram or rom and use standard string functions
    like strcpy, printf, etc, etc.

    No, the 8051 sucks you down into an abyss of archaic programming
    methods, limits and workarounds.
  14. Guest

    I just ran their search tool. With async, I2C, and USB, the best they can do
    is 25 bits of I/O in a 32 pin package. That might work, depending on what's
    left off, but I need to replace an existing (Atmel) part.
    This product is designed by management to be a kludge. There is already an
    FTDI async-to-USB bridge, but that's reserved for existing functions. The new
    functions are to be tied in through a USB bridge.
  15. Chris H

    Chris H Guest

    And for the 8051 there is no better system than Keil
  16. Chris H

    Chris H Guest

    No it isn't and never has been. IF may be free to download but that is
    not the same thing. Ask you project manager.
    SO you spent a lot of money converting a compiler...
  17. Nico Coesel

    Nico Coesel Guest

    GCC + Eclipse are completely free. Nobody is charging you for using
    them. Yes it takes time to learn to use Eclipse as does any IDE. The
    real beauty of Eclipse is that you only need to learn it once and you
    can use it with almost any language on any platform. I've used Eclipse
    to debug C/C++ code and PHP. It works exactly the same.
    Nope, just translating the command line options. Most C compilers do
    the same thing: source in - object out.
  18. Nico Coesel

    Nico Coesel Guest

    You're be right about that. That's PIC stuff.
    The stack in the 8051 grows up, not down. Since the SFRs and the
    registers are also in SRAM space you actually have less than 256 bytes
    of SRAM. And the stack has limited room as well because the SFRs start
    at 128.
    Just look at the machine code. You'll see that a lot of the 8051's CPU
    power is wasted on juggling with memory. The Keil compiler truly is a
    work of art but it can't change the laws of the 8051 physics. And I
    doubt your function pointers where in RAM. AFAIK even the Keil
    compiler can't handle that because it can't determine how and when to
    I've actually worked on a 8051 project a short while ago and I have
    done a lot of 8051 projects in the past. I know why I'm avoiding 8051.
  19. Chris H

    Chris H Guest

    That is not correct. JTAG and ICE are different. The Majority of MCU
    don't have JTAG.
  20. Chris H

    Chris H Guest

    IF may be free to download but that is not the same thing. Ask you
    project manager.
    Oh dear....
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day