Shop OBEX P1 Docs P2 Docs Learn Events
UPDATED: Propeller On-chip Debugger — Parallax Forums

UPDATED: Propeller On-chip Debugger

KaioKaio Posts: 253
edited 2007-10-21 20:51 in Propeller 1
Hi all,

since I did develop assembly code for the Propeller I have missed an easy way to debug my code. Debugging using toggle such LED is very difficult and to use a terminal via serial line is also not very practical in my opinion. Who has developed assembly code does know what I mean.

What you need is a possibility to debug your code on the chip so that your code can run at real speed until a breakpoint occur or you execute only a single instruction and you could see what's up.
So I had the idea to build a debugging tool that runs on the Propeller itself. I could connect my tv and keyboard to the Propeller, load my program and then I could debug it on the Propeller.

After some days of hard work I will present you the first version of POD turn.gif - the Propeller On-chip Debugger. It is currently not finished but you can use it to debug your code in a easy manner of course.

Thomas


Here you will find always the latest version of POD.

Post Edited (Kaio) : 5/16/2007 11:33:31 PM GMT
«1

Comments

  • scottascotta Posts: 168
    edited 2007-03-18 15:53
    Very cool work Kaio !
  • fred2fred2 Posts: 47
    edited 2007-03-18 20:04
    Excellent! Excellent!

    One of the best learning tools I have used for the propellor...



    fred2
  • KaioKaio Posts: 253
    edited 2007-03-19 14:08
    Hi scotta,
    Hi fred2,

    I'm glad to hear that.


    @all
    I have some ideas that I want to implement in the next version. But before I will start the development of the next release I want to invite you to say any kind of disadvantage that you have found as you "played" with POD.

    I'm also interested to hear what kind of feature you want to see in a further release. Please feel free to help me to make POD a valuable developer tool and/or a learning tool for assembly beginners.

    Thomas
  • fred2fred2 Posts: 47
    edited 2007-03-19 15:19
    This is a valuable asset to an 'old time' programmer like myself. Reminds me of the 6502 and z80 days when
    i spent hours poring over assembly listings, loading patches to try things out, sometimes writing completely in
    machine code, etc.

    My LCD screen is not the best quality and does get a lot of peripheral lignt, so I changed the background color
    to white which helped tremendously. Very easy to do with your extensive documentation on the listings.

    I will be utilizing your program extensively in the next few days when I have a replacement computer coming
    to rescue my current non-operable monster.

    Great work!!!

    Fred2
  • KaioKaio Posts: 253
    edited 2007-03-19 17:33
    fred2,

    thank you for your advice. I have it only tested on my tube, because it can also show NTSC norm.

    My first programming language was assembly for the Z80, but at the begin I had not a development system to create and test my programs. So I have used machine code tables to pick up the required codes corresponding to my assembly listing, which I had written on a typewriter. Later then I have used an assembler and a debugger running on a pc.
    Now the time came back with the Propeller on which a byte have importance.

    I look forward to your assistance.
  • Jim ColemanJim Coleman Posts: 52
    edited 2007-03-21 03:16
    Thomas

    Very, very good effort. I am using your debugger to analyse Chip's VGA.spin routine.
    So far, so good. I use your program everyday. You write excellent code. Keep up the good work.

    Jim
  • KaioKaio Posts: 253
    edited 2007-03-21 18:16
    Thank you, Jim.

    I'm really happy that you cannot work without POD anymore. smilewinkgrin.gif
  • Jim ColemanJim Coleman Posts: 52
    edited 2007-03-22 23:41
    Thomas

    Help...I can not get the "jmpret" instruction to work properly. POD will not step into the
    destination of the "jmpret" instruction with F5, it returns immediately to the instruction above the
    "jmpret". It might be a good idea to include "jmpret" in your demo progran so we can see
    how this instruction works with POD.

    Jim
  • KaioKaio Posts: 253
    edited 2007-03-23 10:55
    Jim,

    you has found the first bug, thank you. roll.gif


    @all
    I have updated the ZIP archive on top of this thread with the fixed version.

    Go ahead
    Thomas

    Post Edited (Kaio) : 3/23/2007 12:32:41 PM GMT
  • Jim ColemanJim Coleman Posts: 52
    edited 2007-03-23 14:38
    Thomas

    Thanks for the software correction.

    I have a special favor to ask of you. Would it be possible for you to create a version of POD that
    uses PC_Debug/FullDuplex to be used with the Stamp v2.2 Debug window instead of a TV set.
    I have experimented with converting your software and I can produce some proper output using
    this new arrangement so I know it is possible. There are two good reasons why this would be
    very helpful. I enjoy developing prop software in many different locations and it is not possible
    to have a TV monitor available. Also, I can not experiment with developing VGA software because
    the output conflicts with the TV monitor. If you should agree to do this, please do not use Hyper
    Terminal, I hate that program.

    Thanks in advance.

    Jim
  • KaioKaio Posts: 253
    edited 2007-03-24 01:36
    Jim,

    I'm not familiar with the Stamp and Debug window. So I have searched in the BASIC Stamp forum but I have not found useful informations about that.

    Can you provide me with some informations about the Debug window?
    Is this a terminal program running on the pc?
  • Jim ColemanJim Coleman Posts: 52
    edited 2007-03-24 03:24
    Thomas

    Parallax Home Page
    Downloads
    Basic Stamp Software
    Assuming your running windows……Basic Stamp Windows Editor version 2.2.6 (~6.0 MB)
    Download Basic Stamp Windows Editor
    Install Basic Stamp Windows Editor
    Plug Prop Demo Board into your computer
    It does not have to be powered up with a power supply at this time, only connected
    Run Basic Stamp Windows Editor
    Depress “Identify” icon
    Depress "refresh" icon
    Editor should find your demo board and indicate a COM Port. My computer says COM 10
    Depress “New Debug” icon
    Enlarge Debug Terminal #1
    Select Com Port = COM 10 (This may be different on your computer)
    Baud Rate = 9600
    We are now ready to load software into the demo board
    When everything is working properly you will be running BOTH the prop editor and the stamp editor
    Switching back and forth between the two
    Let me know who this works, I will send more later

    Jim
  • KaioKaio Posts: 253
    edited 2007-03-24 22:51
    Jim,

    I have the Basic Stamp Software installed and running. I can send data from the Propeller via serial connection to the Debug window.

    This is a nice idea to use the Debug window instead a tv. It should be possible to use it as output device for the POD, but I must made some modifications because the Debug window can not show colors. I will try to make a version using the Debug window as output.

    Thomas
  • Jim ColemanJim Coleman Posts: 52
    edited 2007-03-25 01:53
    Thomas

    Very good progress. I think this will result in a better product. I found another of Chip’s
    instructions with the dira register which blew away the TV set and I am sure the waitvid
    command would also be messy. I think it would be a better idea to enter (or remove) the
    breakpoints by keyboard entry, rather then an F9 toggle. It is much faster by keyboard,
    then stepping through the listing and toggling the current line. Another important
    improvement idea: Do away with the keyboard connected to the demo board. Use
    keyboard entry with Stamp DebugIn command which utilizes your computer keyboard.
    This will mean that all that is needed is a demo board and a computer and we are in
    business.

    Jim

    PS: I realize this is a lot of new work for you: but remember, this baby was your creation.
  • KaioKaio Posts: 253
    edited 2007-03-25 20:03
    Jim,

    firstly many thanks for pointing out such improvements.
    Jim Coleman said...
    I found another of Chip’s
    instructions with the dira register which blew away the TV set and I am sure the waitvid
    command would also be messy.
    This should be only occur if you debug a code which use the same pins as the TV or keyboard driver you use for the POD. Then you must modify the code you want to debug, so that it's using other pins.

    Jim Coleman said...
    I think it would be a better idea to enter (or remove) the
    breakpoints by keyboard entry, rather then an F9 toggle. It is much faster by keyboard,
    then stepping through the listing and toggling the current line.
    How you want do that? By enter an address? I think it could be an additional way which I did plan to implement later.
    Why do you think it's a faster way? I do set a breakpoint, when I has stepped in a region of code where I think I need a breakpoint now. I can also look forward some lines of code and then set a breakpoint. For this I must of course make the line I want to have a breakpoint to the current line.
    You know that you must not then scroll back to the pc related line? If you want to do that you can hit HOME (POS1) key, but you can also hit any debug key to perform the next instruction (F5 or F6) or to start code execution at realtime (F8). After that POD will automatically scroll to the right position.

    Jim Coleman said...
    Do away with the keyboard connected to the demo board. Use
    keyboard entry with Stamp DebugIn command which utilizes your computer keyboard.
    This is possible but you would have to type in a command because hot keys does not work while they will received from the BASIC Stamp program. The handling on debugging would be not so fast as it is currently.

    Jim Coleman said...
    This will mean that all that is needed is a demo board and a computer and we are in
    business.
    This could be an argument to do debugging only via two serial connections as you have mentioned.

    Jim Coleman said...
    PS: I realize this is a lot of new work for you: but remember, this baby was your creation.
    I'm very happy about your advises and I know that I have to spend some more weeks of my spare time for this project. But I like to do that in order that other Propeller guys which are not familiar with assembler programming can have an easier entry to learn this.

    Thomas
  • Jim ColemanJim Coleman Posts: 52
    edited 2007-03-25 22:13
    Thomas

    I can sense we are reaching our final exchange for your first submission of POD. I think it is important to realize that I am speaking as the potential customer and you as the developer. Naturally, I would like to get as much of what I want as possible. My experience with debugger’s goes back to the Heathkit Microprocessor Trainer using the Moto 6800 and has been continuous every since with many different devices. The years I have spent with BUFFALO…….(for those of you who understand).

    All of these debugger programs used a keyboard to enter breakpoints. One reason this is handy depends on your style of debugging. As I explore new software, I tend to constantly experiment by running in real-time as well as single stepping. For this reason, I am constantly losing control of the program. This happened with your program as well. I have to reset it, to get it back, which means I must reenter the breakpoints again. After a section of code is debugged, I always move the initial breakpoint to a new a new location and run in realtime to that first location and do single stepping thereafter. As you can see, entering breakpoints is a big deal to me.

    Regarding the extra keyboard, keep this in mind: I like to study computer code in varied locations from campgrounds to truck-stops. If I can reduce, my hardware I will try. As it is now when I am in a restaurant using my computer, battery operated demo board and computer printouts, the waitress cannot find any space on the table for the food. Why would I work in a truck-stop: I love to watch the Big-Rigs and eat steak and beans.

    Think about this: if I knew enough to modify Chip’s code so it does not interfere with your program then I would not need your program to start with. For this reason I would like all pins to be clear and not used except 28..31, i.e. Debug, DebugIn should be used.

    Finally, I realize that there are many others who will enjoy exactly what you have developed so far and for this reason POD is fine effort as it stands, so please do not become depressed by my comments.

    Over and Out for now

    Jim
  • tekochiptekochip Posts: 56
    edited 2007-03-25 23:55
    Wonderful product, I'd like to thank you for your work.

    How can I send you a donation?
  • KaioKaio Posts: 253
    edited 2007-03-26 16:43
    Jim,
    Jim Coleman said...
    I think it is important to realize that I am speaking as the potential customer and you as the developer. Naturally, I would like to get as much of what I want as possible.
    You are right in thinking of that. I have not said that I will not implement improvements which you have mentioned. But it takes some time to collect all informations what the customers are dreaming.

    Jim Coleman said...
    For this reason, I am constantly losing control of the program. This happened with your program as well. I have to reset it, to get it back, which means I must reenter the breakpoints again.
    When I have you understood right, you mean with 'losing control' that your debugged code is running in realtime and the debugger is waiting to catch the next breakpoint. If this occur you can hit the ESC key to stop the debugged Cog and restart it again without losing your breakpoints.

    Jim Coleman said...
    Think about this: if I knew enough to modify Chip’s code so it does not interfere with your program then I would not need your program to start with. For this reason I would like all pins to be clear and not used except 28..31, i.e. Debug, DebugIn should be used.
    You are right, this is the easiest way. I have it on my mind.

    Thomas
  • KaioKaio Posts: 253
    edited 2007-03-26 17:04
    tekochip,

    I'm glad to hear that. I have sent you a PM.

    Thomas
  • Jim ColemanJim Coleman Posts: 52
    edited 2007-03-26 17:32
    Thomas

    You are back, good for you. I was not certain you would recover after our last exchange. What I mean about losing control of the program has to do with debugging code that is either not complete or contains an error in some way or another. These programs will not travel nicely to the next breakpoint and stop. They either hang up or hide in some continuous loop. For this reason, I just hit reset and start over which means I must enter the breakpoints again. I often want to change the breakpoints any way because the point I selected was beyond some error in the code and I must back up and precede the error with a new breakpoint so I can slowly single step into the error. Then I will be able to detect the exact location where the problem occurs. Thomas, I want your effort to succeed because writing assembly code without a debugger is definitely not a fun thing.

    I am trying to get to get you to remove all extraneous hardware, and free up the pins so that there will be no conflicts with the code being debugged. This will elevate your POD from a good effort to a great one. Please keep trying. Remember you have the rest of your life to complete this, so I think you have time.

    Jim
  • Jim ColemanJim Coleman Posts: 52
    edited 2007-03-28 11:39
    Thomas, Thomas, Thomas……where is the new POD software. I notice that you have been busy solving other prop problems around the form, instead of concentrating on POD. So I am encouraging you to stay focused and finish POD. And really, whoever heard of a debugger with a mouse. I may have detected a discrepancy in your current version, but I need more time to confirm this. In any event, forward march …. please.

    Waiting patiently, Jim
  • KaioKaio Posts: 253
    edited 2007-03-28 15:45
    Jim,

    the new version should be well tested, before I make it public. And the documentation must be also updated. But I'm sure that I can it publish shortly.

    Please hang in there! cool.gif
  • Jim ColemanJim Coleman Posts: 52
    edited 2007-03-28 17:46
    Thomas

    Good news from you. When I saw you spreading your expertise throughout the form, I was afraid you were losing interest in POD.

    NEW BUSINESS: I will use (Andre&#8217[noparse];)[/noparse]’s text as a reference [noparse][[/noparse]181.183]. I have verified this problem throughout the listings and will use one example from AsmDebugDemo.spin, namely the instruction
    if_nc jmp #wait which you convert to NZ&C jmp #$007 using POD based on a listing of $5C4C0007 or |0101|1100|0100|1100|0000|0000|0000|0111| which in turn converts to |010111|0001|0011|000000000|000000111|
    |cccc| and from Table 13.4 page 182, stands for IF_NC or IF_AE which
    in turn should have produced only NC jmp #$007. Please check and see if this might be a problem.

    Jim
  • KaioKaio Posts: 253
    edited 2007-03-29 12:26
    Jim,

    you are right, thank you for pointing out this problem. I have it also found yesterday (or was it last night? tongue.gif) while testing the new version.
  • KaioKaio Posts: 253
    edited 2007-03-29 12:43
    Hi all,

    I have release a new version of POD. You can find this on top of this thread.
    Please have a look at the readme.txt about the new features, which is contained in the ZIP archive.

    @Jim
    Sorry, this version requires also a tv and keyboard connected at your Prop board. I will try to change this with the next version.

    Have fun, Thomas
  • KaioKaio Posts: 253
    edited 2007-04-05 08:23
    Hi all,

    I'm wondering that here is no response since I have published the latest version a few days ago. I'm thinking, there could be 2 reasons for that.
    1. It could be that you has expected more functionality to have working.
    2. All works fine and you have no any questions or requests for a next version.

    If statement two is true then I could be starting the next project. Otherwise it would be helpfully if I would have feedback from you.

    I'm pleased to hear from somebody. rolleyes.gif
  • tekochiptekochip Posts: 56
    edited 2007-04-05 13:15
    I'm sorry, you're right, I should have responded.

    I haven't had a chance to try it out because·I've been working on another project.· I'll see if I can try it out today.

    -Chip
  • Martin_mechMartin_mech Posts: 5
    edited 2007-04-18 16:19
    Can't wait to POD up and running!

    If you could put in the serial port interface in, I would be using this program already. I am using the proto board and need to modify it for the kbd, and video inputs and the hardedst part, find a monitor to bring to the office.

    The proto board hasthe vga plug (arrived today) if I change TV_text to VGA_text would there be a problem?

    Martin
  • LeonLeon Posts: 7,620
    edited 2007-04-18 17:32
    Should be OK. I've changed several programs from VGA_text to TV_text and they worked.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • KaioKaio Posts: 253
    edited 2007-04-18 17:56
    Martin,

    I'm currently working on the next version of POD, which will also provide debugging via serial connection. I know that many guys are using a proto board and this supports keyboard and VGA only with an additional kit.

    Sorry, you can not use any VGA driver as replacement for the TV driver. Either they have not the required methods to print out the debugger informations like on the TV driver or the supported screen size is to small.

    Please keep up! I'm still testing the new version.
Sign In or Register to comment.