Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Application: Logic Analyzer — Parallax Forums

Propeller Application: Logic Analyzer

Paul BakerPaul Baker Posts: 6,351
edited 2010-10-06 18:35 in Propeller 1
This is a program which turns the Propeller into a Digital Storage Scope (Logic Analyser). It is capable of displaying the output to a VGA monitor or TV. Follow the instructions in dscope.spin to compile the TV version.
There are two modes of aquisition: the fast version which has a sample rate of 150ns when the Propeller is running at 80MHz, and the slow version which has a sample rate of 225ns or greater.

Please let me know of any bugs you encounter and your comments as well.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer

Parallax, Inc.
«13

Comments

  • kerrywkerryw Posts: 61
    edited 2006-09-19 18:44
    Would you mind posting some screenshots of the analyzer in action?

    Kerry
  • Ym2413aYm2413a Posts: 630
    edited 2006-09-19 19:02
    Now you can use the Propeller as a Testing/Debugging tool for another propeller. (lol)
    This is pretty cool.
  • NewzedNewzed Posts: 2,503
    edited 2006-09-19 19:29
    Paul, I downloaded the program, loaded it and got to the Scope Display screen.· I can't seem to make anything happen - what am I supposed to do next?

    I noted that the colored lines for 08 and 09 do not line up the way the others do.

    Sid
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-09-19 19:51
    Ym2413a,
    You said...

    Now you can use the Propeller as a Testing/Debugging tool for another propeller. (lol)
    This is pretty cool.

    Or the same propeller running another cog

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • nutsonnutson Posts: 242
    edited 2006-09-19 20:27
    Paul, great program.·Beau, I like the idea of a dedicated·Cog,·that after seeing a·start condition, could acquire·pin states and·memory values·for some time. It would be a great debugging tool,·as it would not·interfere with the running·applications·timing in any way.·Communication between this Cog and the user is the problem, that·takes chip resources. The minimum would be a few·pins to communicate with another prop that has·VGA, keyboard etc.



    Nico Hattink
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-19 21:33
    Kerry,
    I'll take my digital camera into work tomorrow and take a couple screen shots for you.

    Ym2413 and Nutson,
    This program was developed with the idea of working alongside other programs in development on the same Propeller. I have not worked in this mode yet, so this is likely where the bug reports will fall. The idea is that it can be run with or without the user interface display. As a top object it will start the user interface, however when this object is a sub-object, the data aquisistion function are accessible directly for those programs you want your own display and not the scope's user interface.·Like I said, I haven't tested this mode, I will likely need to insert a couple routines to help facilitate this mode of operation. I could also release a stripped down version that has no display within it for those instances if there is enough interested in a bare-bones version.

    Newzed,
    The Help screen (shown at startup and accessible via F1 thereafter), explains which keys run the program. On startup, a fast aquire is performed, this is the dataset shown at the begining. The arrow keys, Page Up/Down, Home and End navigate through the dataset. F performs another fast aquisistion, S performs a slow aquisisiton. P enters the Preferences dialog where you can set the time base for slow aquisistion and the start trigger function.
    The start trigger function instructs the aquisistion process to wait until a specified mask of pins achieves a specified state. This morning I added the last bit of code where if you specify a state which is never reached, you can press the Esc key to kill the aquisition process, before that you had to reset the propeller in that situation. The dialog for this is displayed only while aquisition occurs which is typically so fast you'll only see a quick blip of words in the upper left corner before the new waveforms are drawn.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-20 01:19
    Sid,
    Ive thought about your comments some more, what you are seeing is normal, most pins will be all 1 or all 0. The numbers in the lower left show the values for each waveform under the current time (the pink line down the center). If you want to see some interesting stuff, scroll down to the mid teens where the VGA signal is being generated, you'll see more interesting waveforms there. The waveforms generated for the TV when that driver is running are even more intersting.

    Also there is line commented in the start routine, that if you uncomment will toggle pin 0. If you change the time base to $0000_0100 then do a slow aquisition, you see a nice square waveform on pin 0.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • NewzedNewzed Posts: 2,503
    edited 2006-09-20 13:27
    Paul, I uncommented Line 90.· I loaded the program and hit Escape without pressing any other keys.· I scrolled the screen so that Pin 08 was at the top (Pin 8 is my vga.start pin).· The display showed Pins 0, 8 and 9 were high, all others were low - just levels, no wave forms.· Then I pressed "s" one time.· Pin 0 went low, 8 and 9 remained high.· I pressed "s" again, no change.· I pressed "f" one time, Pins 0, 8 and 9 went high.· I pressed "f" again, Pins 0 and 1 started low, then went high.· Pins 8 and 9 remained high.· Using the right hand arrow I scrolled until the pink line was at the point where 0 and 1 went high.· The numbers across the bottom of the screen said 1100000011000, which agreed with what I was seeing.· The number at the bottom of the pink line was 4 - does that mean I was 4us into the sweep?

    You mentioned changing the time base .· There are four in the CON block - are you talking about StatusIdle?

    Sid
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-20 14:09
    The number below the pink line is the sample # for fast aquire, and the clock cycle for slow aquire. I know this is confusing, it will be changed in the next Rev hopefully to a true time base. I didnt want to import floating point to calculate a single number. Ill have to sit down a bit to figure out how to do it in integer math using clkfreq.

    Time base is set in the program itself in the <P>reference dialog.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • NewzedNewzed Posts: 2,503
    edited 2006-09-20 14:32
    Thanks, Paul.· Now which time base do I set to 0000_0100?

    Sid
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-20 14:41
    Inside the running program, in the main (waveform) window, press P. Tab or arrow down to the 3rd number labeled "Time", set this number to 00000100 then press <Enter> to accept the changes. Once in the main window again, press S. If you dont see a nice waveform on P0, wait a few seconds and press S again.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • HarleyHarley Posts: 997
    edited 2006-09-20 15:50
    Paul Baker said...
    This is a program which turns the Propeller into a Digital Storage Scope (Logic Analyser).
    Wow! A logic analyzer w/o ANY other additional hardware. jumpin.gif I've helped design one before, for an Apple II. One huge board for those days; plus the i/f board plugged in the Apple II. Unfortunately, the project fell apart before it could go to market.

    I have a few questions.
    1. I don't have a VGA display, and am working with a b/w monitor. So for my situation I'm color blind. I did note every 4th line was 'thinner', so may be a different color?____ And the eleven 'zeros' (00000000000) below the left vertical line has some greying of the digits; what is the meaning of that?____

    2. Why is the vertical line down the 'center' so wide?____ It is quite distracting. It's the one, if you Home, has the single '0' below it.

    3. There is one item that seems not right. If you have a signal, like on pin 12, it goes off screen if you press S or F; it doesn't if Mask, Value or Time is changed. Means if you are trying to view pins 12 or higher, you have to scroll down quite a ways for the higher pins EACH TIME it is triggered.

    4. I'm guessing in time there may be write up on this neat program. Like include obvious details like Home and End keys move the display accordingly. Might there be others (I've not taken a 'trip' through the source yet)?_____

    Great project. yeah.gif Was something I was thinking of that MIGHT be workable; glad to know it is. By the way, what is the shortest time for sampling (in nanoseconds) possible?____

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-20 16:50
    Harley, glad you like it so much.

    1. The palette was chosen to help distinguish between the waveforms at a glance on a color display. If you are displaying on a B/W TV, you can choose the palette you think looks best. The data to change is the tv_palette values in the DAT section. Entry 0 is used for most text. Entry 1 is the inverse and used for text highlighting. Entry 2 is used for highlighting the current·nibble being edited in the preference dialog and the center line of the waveform. Entries 3-6 are used for the waveforms and entry 7 is used for the pin numbering and current time value. You can edit any/all of these entries to improve readability on a B/W TV. You may want to set entries 3-6 to be the same as entry 0, this will make all waveforms white. The binary number in the lower left is the value of the waveforms displayed at the centr line, these numbers are drawn using the same color as the waveform. Changing the waveform color in the TV_palette will change the color of the binary value display as well.

    2. The center line is is used to signify the locatation of the present time. Since a text-only display driver was used, this line can only be the width of a character. For your purpose, I would change entry 2 to be a white foreground with a dim grey background. This will de-emphasize this line and make it not as distracting, a value of 4 for the background should work well.

    Distilling the information I provided in the last two paragraphs, you may want to change you color palette to:
    tv_palette    byte      $07,   $02    '0    white / black       (white) 
                  byte      $02,   $07    '1    black / white       (inverse)
                  byte      $07,   $04    '2    white / d gray      (highlight)
                  byte      $07,   $02    '3    white / black       (white)
                  byte      $07,   $02    '4    white / black       (white)
                  byte      $07,   $02    '5    white / black       (white)
                  byte      $07,   $02    '6    white / black       (white)
                  byte      $06,   $02    '7     gray / black       (gray)
    
    

    3. I could change the program so the first pin displayed stays the same after an aquisition if most people feel this is a more intuitive behaviour for the program.

    4. I tried to make the program as intuitive as possible so a seperate write up wasn't nessesary. Since the VGA version is limited in the number of characters/line and number of lines. I had to limit what was shown on the help screen, besides the Home and End keys, there aren't really any other "hidden" functions. The exception to this is the manipulation of the program by another program, but I haven't tested this out yet and I know there are a few functions I need to add to make this possible.·I will release a new version with this functionality along with a demo program that illustrates how to use·it·in that capacity.

    ·· One of the design premises with the Propeller is that the documentation would be provided in the source code, this is to overcome the problem·that occurs when code revisions and documentation becomes out of sync. By incorporating the documentation into the code itself, these two parts should stay in agreement. As a·Parallax employee I am going to try to adhere to this model.

    The shortest sample time is 150ns which is through the <f>ast aquisition. This is the shortest possible loop achievable on a single cog (3 assembly instructions (12 clock cycles)). Using·4 cogs·and doing a synchronized interleaved aquisition, this could be reduced down to 37.5ns, using 6 cogs, this could be reduced down to 25ns.·This may be desirable for a stand alone application, but one of the design goals was to have this program co-exist with other programs.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.

    Post Edited (Paul Baker (Parallax)) : 9/20/2006 4:56:28 PM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-20 17:14
    Kerry,

    Here are the screenshots you requested. It was taken with line 90 uncommented (the pin toggler activated), slow aquisition with a time base of 0000_0100.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
    768 x 576 - 114K
    768 x 576 - 106K
  • Mike GreenMike Green Posts: 23,101
    edited 2006-09-20 17:17
    Just as an aside, you mentioned doing a synchronized interleaved aquisition. I assume that this would be done with a waitcnt or waitpxx with the same values in each of several cogs. The cogs would then be in sync and, since their timing is normally deterministic, each cog could delay a different number of instruction times so they'll be in sync, but slightly out of phase. Right?

    Mike
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-20 17:29
    Exactly, the easiest way would be to launch the same assembly routine with a different waitcnt value onto each cog you are using. It would take some tinkering to allow enough time for all cogs to launch, account for counter roll-over etc, but it is definitely possible to do. To help with the determinism aspect, it would be best if an assembly cog was spawning the aquisition cogs. In the 6 cog aquisition example, it may be nessesary to replace some of the driver cogs (keyboard, video) and the spawing cog with the last aquisition cogs, then restart drivers afterwards, though hopefully killing the video wouldn't be nessesary, since that may cause some headaches.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • HarleyHarley Posts: 997
    edited 2006-09-20 17:38
    Thanks for the info, Paul,


    Comments/questions:

    1. Could a character such as "|" (the up-shifted '\" key) be used for the vertical bar to make it thinner?___

    Ah, that was a binary value on the lower left (was wondering why the odd count; info overload!). Didn't note the corrolation; color might have shown it.

    2. Will try your suggestion on the center line 'coloring'.

    3. Having the first pin displayed stay the same would be 'user friendly'. That was the Macintosh mantra I learned back in '84, when I got the first Mac. Learned a lot from Apple's "Inside Macintosh" book, about the size of a thick phone book. I'll 'stuff the ballot box' on having this feature.

    4. Maybe reading the source through would have helped. Something to do yet. For some reason, the PgUp and PgDn seem opposite actions, where page up moves further to the RIGHT. Where, in a editor, scrolling up takes one to the top or beginning. Conventions, ha!

    I do like the Parallax model/approach in Spin with the documentation following the code. But when using a (demo) program, what's available only on-screen may NOT cover enough. The user might not desire to plough through the source.

    Thank you for the 'sample time' info. Looks like the fastest sample time could be about 40 MHz; good for many debugging applications. Not a glitch catcher, but very usable for a stand-along approach.

    I do appreciate that once the Prop is initialized, all 32 pins are available for this analyzer to capture. Works, since the capture is internal, on-chip. Really a amazing concept for this Propeller to have so much capability.

    Thanks again Paul.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-20 18:19
    The value must be displayed in the location as well, there are no characters which can display a vertical bar and a low or high value as well. I originally started using the graphics version on the TV for this project and had this look:

    attachment.php?attachmentid=41032
    But using the graphics version consumed most of the propeller's memory.
    In regards to the PgUp/PgDn, I took the view of the time value, if I reversed the two someone else would say it more intuitive to do it the other way. It just depends on how you view the dataset in your mind's eye.
    I'll change the startpin behaviour on the next version. In the interm, comment out line 434 (startpin := 0 in function new_dataset) and·your copy will·have this behaviour.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • NewzedNewzed Posts: 2,503
    edited 2006-09-20 19:06
    Paul, I commented out Line 434, loaded, scrolled to Pin 8, my VGA start pin, and here is the display I got.· Is there any way to slow down the sweep speed so I get more of the waveform?

    Sid
    525 x 406 - 16K
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-20 20:12
    No, the waveform uses the waveform characters of the Parallax Font, the way it is written each sample is surrounded by transition charactors, this is the same character if the adjacent value is the same, or the High2Low/Low2High character if the adjacent value is different. I would be possible to double the density of the waveform by not including the transition characters at the expense of readability. This however would not be a trival alteration since several code sections would need to be altered and the underpinning meaning of certain variables would need to be altered to support a compact and non-compact mode.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • HarleyHarley Posts: 997
    edited 2006-09-20 21:45
    Paul Baker said...
    No, the waveform uses the waveform characters of the Parallax Font, the way it is written each sample is surrounded by transition charactors, this is the same character if the adjacent value is the same, or the High2Low/Low2High character if the adjacent value is different. I would be possible to double the density of the waveform by not including the transition characters at the expense of readability. This however would not be a trival alteration since several code sections would need to be altered and the underpinning meaning of certain variables would need to be altered to support a compact and non-compact mode.
    Dumb me, of course, two 'characters' cannot occupy the same 'pew'. I need to play with the program for the non-VGA mode and set the 'color/shade' to a less bold value for a b/w display. It is too predominate for my likes. After seeing the VGA shots, color really does make the difference over b/w. I suppose the 'horseless carriages' are out these days. Just didn't want to spend more than necessary at this time.

    Looking forward to the more final version. Thanks Paul.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-20 22:01
    Harley, look into getting a KVM (keyboard/video/mouse) switch. I am using an IOGEAR model GCS62 for development at work, and can be bought online for about $30. Its a PS/2 version so it's compatible with the Propeller (but the computer you are developing on needs PS/2 sockets for the mouse and keyboard). By double hitting the Scroll Lock key in quick succession I reroute the keyboard mouse and monitor between the Propeller and computer, no plugging and unplugging cables required. One set of peripherals for both saves deskspace and the cost of the additional monitor. I also have a small TV sitting next to the monitor for the TV based apps and is also constantly plugged into the propeller. With the exception of audio apps (which I have yet to work on any), no swapping of any device is nessesary.

    In the interm, use Graphics_Palette.spin to pick out the values for greyscale shades you prefer. I agree that the contrast between white and black is a bit stark.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.

    Post Edited (Paul Baker (Parallax)) : 9/20/2006 10:09:45 PM GMT
  • HarleyHarley Posts: 997
    edited 2006-09-20 22:26
    Paul Baker said...
    Harley, look into getting a KVM (keyboard/video/mouse) switch. I am using an IOGEAR model GCS62 for development at work, and can be bought online for about $30. Its a PS/2 version so it's compatible with the Propeller (but the computer you are developing on needs PS/2 sockets for the mouse and keyboard).

    Thanks for the 'switch' suggestion. But don't think it will work for my setup. Besides the iMac (CRT in old/original iMac case) there's a ThinkPad laptop. Have a PS/2 mouse port, but no keyboard or VGA in, which I'd sure like. No VGA monitor here.

    May just have to breakdown and look for a bargain VGA monitor. Have seen some 17" for just around $100. And that would hog a lot of valuable desktop space. The Parallax LCD monitor is cute, but too small for these old eyes even with reading glasses.

    But, am sure enjoying all the work that has been done on the Propeller since it's come out. Lots of good coding.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • NewzedNewzed Posts: 2,503
    edited 2006-09-20 22:48
    Paul, I am fascinated by your KVM switch.· I have a Logitech wireless mouse, so could I leave the mouse receiver hooked up to my PC and just switch the keyboard and VGA?· I went the the IOGEAR site and it appears that I would connect·one DB15 on the KVM to my PC and the other to the Propeller VGA connector, and my monitor would plug into the "hub" of the KVM.· Same thing with the keyboard.· Have I got it right?· Then you hit Scroll Lock twice to switch between the PC and the Prop.

    Sid
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-20 23:15
    Sid, correct the only required device connected to the KVM switch is the keyboard so the switch knows when to toggle between outputs. The monitor and mouse are optional. The first couple of days I had two mice since the IBM desktop wouldn't recognize the Parallax mouse and the computer mouse is USB. I brought a USB to PS/2 adapter from home and I'm now sharing the USB mouse as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • HarleyHarley Posts: 997
    edited 2006-09-21 01:29
    Paul Baker,

    I changed only entry 2 to the suggested 07 and 04 for a first shot.

    That provided a neat thin vertical line, with the horizontal traces highlighted the normal width. smile.gif Very obvious, yet not distracting in b/w. The other was sort of like looking into a searchlight beam; joking, but it was not pleasant; maybe in color OK.

    Strange effect on the left pin numbers. It appears like 'noise' running up or down there, but not noticable any where else on the screen. Maybe those numbers need to be 'whitened' some. Because I see that 'noise' in the binary values at the bottom left, on the greyed ones. Don't know if I noticed that before. No real complaint; just will check out changing other palette values.

    I have printed out the source, so can now spend some time studying it and checking out other details for my b/w setup.

    Appreciate the help, Paul.... yeah.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-21 03:07
    No problem, the issue you have with the noise may be from the color burst/color information, but I am not positive about this. I think there is a way of disabling the color generation, though I don't know how to do this yet. I'll have to ask Chip tomorrow.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • NewzedNewzed Posts: 2,503
    edited 2006-09-21 12:02
    Harley, what changes did you make to decrease the width of the vertical line?

    Sid
  • NewzedNewzed Posts: 2,503
    edited 2006-09-21 15:22
    Paul, I sent the following e-mail to IOGEAR:

    Andre, all I want to do is switch the monitor and keyboard from my PC to another microprocessor that has keyboard and VGA inputs.· Will the GCS62 handle this?

    Their response was "No, it will not".

    I have asked for clarification based on the info on their site.

    Sid
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-21 15:37
    It may be a case of them playing conservative and not wanting to provide technical support for non standard platforms, or it could be that they saw "another microprocessor ... VGA input", which is incorrect. The VGA on the Propeller is an output.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
Sign In or Register to comment.