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

Propeller Application: Logic Analyzer

2

Comments

  • HarleyHarley Posts: 997
    edited 2006-09-21 15:58
    Sid,

    I changed only entry 2 to the suggested $07 and $04 which gave me a satisfactory visual marker; not too bold, but noticable.

    It is the 3rd one under 'tv_palette' (near bottom of page 12 on my printout) commented as 'highlight'.

    If you find a better setting, or any others for the tv/non-VGA let us know. Lots of experimenting going on before baby Prop is 1 year old.

    Here's a quick shot of the result (brightness too high and reflections).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
    640 x 480 - 47K
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-21 16:22
    I think the thin line is an artifact, you can see it is the leading edge of the vertical grey stripe. My best guess of why this is occuring is that there is ringing of the signal due to improper impedance matching on the transmission line, which the TV is interpreting as a brighter color. TVs were designed to receive broadcast transmissions where the antenna and TV are impedance matched to 75Ω. In composite TV input, it is the signal generator's responsibility to match it's output to the TV's composite input. I would venture that if you enabled the broadcast bit in the TV.spin object and transmitted via airwave, this brighter line would disappear.

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

    Parallax, Inc.
  • NewzedNewzed Posts: 2,503
    edited 2006-09-21 16:28
    Thanks, Harley.· I'm running VGA so I'll have to look around and see if I can find a suitable change for VGA.· Maybe Paul can tell me.

    Sid
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-21 16:29
    Sid, I dont think so for the reason I stated in the previous post. However, I forgot about something that Chip told me a few days ago: you can define your own custom charactors, so it is possible to create special high+vertical line and low+vertical line characters. I'll look into this when I get around to working on the next version.



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

    Parallax, Inc.
  • HarleyHarley Posts: 997
    edited 2006-09-21 16:56
    Thanks, Paul, for that info.

    I may try that later; at the moment too much to move around to place it to another room with a TV.

    The 'highlighting' of the horzontal traces is sufficient for my comfort for the visual indication of the time marker. Looks much better on-screen that my 'quick 'n dirty' picture; digital cameras sure see more than our eyes observe at times.

    Thanks for making the analyzer demo for both VGA and TV-mode.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • HarleyHarley Posts: 997
    edited 2006-09-21 18:53
    Paul said...
    (from a much earlier post)
    I originally started using the graphics version on the TV for this project..... But using the graphics version consumed most of the propeller's memory.
    It appears that about twice as many transitions could be shown; that would be desirable. Of course, that does use up more memory.
    I commented out that 'startpin := 0' statement. YES!! jumpin.gif That works great. Let's one capture other events and still view the same pins. Would be aggravating to try to view the higher pins each new capture. Ssccrroooooooooll each time! Glad it was so simple to accomplish that feature; delete, rather than add.

    One other question; is there a way to also keep the same 'time' position on recapture as previous? Another lazy. When the point of interest is way to the right, and do a 'F' or 'S' to view the same point after the trigger. Would that be by commenting out 'time := -XCenter' only? Seems to work OK, but don't know if anything else might be screwed up I haven't yet caught. One never knows.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-21 19:42
    That should work, though it doesn't have the same meaning, theres no guarentee that the region of interest time-wise will be the same from aquisition to aquisition.

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

    Parallax, Inc.
  • HarleyHarley Posts: 997
    edited 2006-09-22 16:06
    For those using the TV rather than the VGA i/f for the Logic Analyzer demo, here's a list of a few changes made to 'improve' the display and operation:

    line 24
    FrameLeft = 2 ' this moves the vertical 'bar' left one position to gain more i/o trace length.

    line 119
    time := -XCenter + 9 ' this moves the whole trace display to the left margin on initial display.

    line 164
    time #>+ -XCenter + 9 ' to restore to left on PageDown key

    line 171
    time :+ -XCenter + 9 ' to restore to left on Home key also

    line 434
    ' time := -XCenter ' comment out this line; to not start at center

    line 435
    ' startpin := 0 ' comment out this line; seems to retain last pin# at top

    line 587
    byte $07, $04 ' removes the 'bright' bar in center; now highlights the trace only; may produce artifact thin vertical line, which is a nice marker; YMMV

    One esample: Set Mask = 0000C000 and Value = 00004000, ensure Home position and you should see the TV waveform transitions most of the time (first press Down Arrow key enough times to place pins 12-14 on-screen).

    Again, many thanks to Paul Baker for this very usable debugging tool.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • HarleyHarley Posts: 997
    edited 2006-09-23 18:14
    Chip, Paul, anyone.....

    Is there a way to create a few (4 right now) 'symbols' which the TV/VGA could pickup and display?_______

    The need for this is to increase the number of 'bit times' displayed via the Logic Analyzer demo program; it uses one character space for where a transition might occur. I'd like to NOT display the transitions as separate character positions (although they look 'prettier'), but to have the 4 symbols represent a HI, LO, and transition (vertical segment) connected to a HI or LO levels. This would DOUBLE the displayed info guys. yeah.gif

    I've done this using character LCDs with HD-nnnnn controller which allows 8 user defined symbols. I used all 8 to represent two 'bits' per character space. Worked great. Each half symbol occupied a two dot wide x n height space; with the second half separated by one dot. Gave a dashed appearance; sometime one has to compromise; was worth it. Wish I could find pics of it.

    Any guidance to any code which allows user defined characters would be appreciated.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-09-23 20:06
    Harley,

    I'm working on a VGA text and graphics object in Assembly that MIGHT be applicable here.· It uses the ROM table
    to display the characters, but you just reminded me to add an option to display a character from a user defined
    RAM location instead.

    I've got most of the difficult stuff ironed out, but there are still a few things I need to work on with it.



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

    IC Layout Engineer
    Parallax, Inc.
  • HarleyHarley Posts: 997
    edited 2006-09-23 23:31
    Thanks Beau,

    I was hoping someone was working on such a feature to allow one to expand the available symbols.

    Will keep my eyes open for when this is available. I've been wondering if such was built-in; appears not, but with a little (sometimes lot) additional s/w much can be done. I'm too new to the Prop; would probably take a long time an effort for Prop-newbie to tackle such a project.

    Beau said...
    I'm working on a VGA text and graphics object in Assembly that MIGHT be applicable here.· It uses the ROM table
    to display the characters, but you just reminded me to add an option to display a character from a user defined
    RAM location instead.

    I've got most of the difficult stuff ironed out, but there are still a few things I need to work on with it.

    This Propeller is the most interesting IC that I've seen in decades. I love the PIC for some things, but WOW! pleasantly surprising what all the Propeller can provide.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-09-26 00:35
    Harley,

    Here is a link to the VGA text and graphics object

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

    IC Layout Engineer
    Parallax, Inc.
  • HarleyHarley Posts: 997
    edited 2006-10-05 01:03
    Paul Baker,

    When you have the time to do so, I could use a bit of explanation about a few details in the Logic Analyzer program.

    1. I included the 'Wiggle' feature; was surprised how long the period was. So changed the #511 value to lesser and lesser values. Around #20 seems to be the limit. At that setting it appears about 18 counts from one transition to another. But at times it is high or low for two periods. Why is that?____

    But to see any transitions, seems I must set the mask to 00000001. Didn't seem to have to set the mask to see changes with the larger count settings.

    2. The Time preference cannot be set lower than 12. Set it lower, hit Return, hit 'p' and it is back to 12. Is that a lower limit for this s/w analyzer?____

    3. Is there a way to actually make an assembly instruction toggle every 50 nsec?___ Seems not. I have a need to do this in a project; was hoping the Prop could do so.

    Looking at the OUTA instruction, it seems awkward to toggle one pin. I'm used to the 'bsf/bcf' PIC instructions. Doesn't seem to be a really fast way with the Propeller. Read SPIN vs assembly but doesn't seem to be a quick way to set a level HI or LO immediately following a 'waitpeq' instruction. That is, the next instruction.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-05 01:18
    Harley,
    If you have a long with a single bit set for the pin you want to control (say "mask"), you do an "or outa,mask" to set a level high and an "andn outa,mask" to set the level low. If you want to toggle the current setting, you do an "xor outa,mask". These all assume that the pin direction is already set to output. If not, it does take two instructions, the first is an "or dira,mask" and the second is one of the others mentioned. If the I/O pin is 0 through 8, you can use an immediate bitmask instead.

    If you have a sequence of "xor outa,mask" instructions, the I/O pin will toggle every 50ns with a cycle time of 100ns. Once you include a jump instruction or any other control instructions, it does get slower. The best you can do for a controlled loop would be an XOR followed by a DJNZ instruction to provide a specific length loop. That would toggle every 100ns with a cycle time of 200ns. You can use cog counters to output a pulse sequence much faster than that. I believe the upper limit is 128MHz.
    Mike
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-10-05 04:38
    Harley said...
    Paul Baker,

    When you have the time to do so, I could use a bit of explanation about a few details in the Logic Analyzer program.

    1. I included the 'Wiggle' feature; was surprised how long the period was. So changed the #511 value to lesser and lesser values. Around #20 seems to be the limit. At that setting it appears about 18 counts from one transition to another. But at times it is high or low for two periods. Why is that?____

    But to see any transitions, seems I must set the mask to 00000001. Didn't seem to have to set the mask to see changes with the larger count settings.

    Every instruction takes 4 clock cycles to execute, and the waitcnt takes a minimum of 5, if you specify a time span that is shorter than you can get to, the cog will wait until the count rolls all the way around again which is about a minute.

    You dont need to enable the trigger mask, it takes a little while on start up for the pin to start toggling.

    2. The Time preference cannot be set lower than 12. Set it lower, hit Return, hit 'p' and it is back to 12. Is that a lower limit for this s/w analyzer?____

    The floor of the Time is 12 for the same reason above, the code cant execute fast enough and you end up with samples about 57 seconds apart. I hard coded it to prevent setting it less than this so people wouldn't· assume the code was working improperly. For all captures this fast the <F>ast capture mode must be used.



    3. Is there a way to actually make an assembly instruction toggle every 50 nsec?___ Seems not. I have a need to do this in a project; was hoping the Prop could do so.

    There is no means to directly toggle the pin every 50ns, unless you just want a few pulses. Every instruction takes 50ns to execute. Put a loop instruction in there (jmp or djnz) and you now have 100ns between transitions. For oscillations this fast, use the NCO/PWM mode of the counter. It will do this automatically while leaving the cog to perform other operations.


    Looking at the OUTA instruction, it seems awkward to toggle one pin. I'm used to the 'bsf/bcf' PIC instructions. Doesn't seem to be a really fast way with the Propeller. Read SPIN vs assembly but doesn't seem to be a quick way to set a level HI or LO immediately following a 'waitpeq' instruction. That is, the next instruction.

    Mike gave excellent information on how to manipulate pins.

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

    Parallax, Inc.

    Post Edited (Paul Baker (Parallax)) : 10/5/2006 4:41:56 AM GMT
  • HarleyHarley Posts: 997
    edited 2006-10-05 06:14
    Thanks, Mike and Paul, for the clarification.

    A bit of explanation make a subject so much clearer. I need to look and study more of the demos to clarify things.

    Even though Propeller assembly doesn't have the bit set/clr instructions, I now see a positive or negative pulse of 50 nsec is available using both the 'and' or 'or' outa,mask instruction (with 16x 5 MHz clock).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-05 06:19
    Harley,
    Note there is a difference between the "and" and the "andn" instructions. It's the "andn" instruction that's the most useful here because you can use the same bitmask for all three instructions ("andn","or","xor").
  • HarleyHarley Posts: 997
    edited 2006-10-05 17:12
    Mike said...
    Harley,
    Note there is a difference between the "and" and the "andn" instructions. It's the "andn" instruction that's the most useful here because you can use the same bitmask for all three instructions ("andn","or","xor").

    Thanks for reminding me. Last night I reviewed those instructions, and realized it wasn't a type for 'andn'. Now I recall someone, Beau maybe, months ago mentioning about using a single mask value to set, clear, or toggle an output pin. Cool instruction 'andn' cool.gif

    Exactly what is needed; the quickest turnaround time to set a pin LO (or HI), then later return it to its 'inactive' state. Too bad it couldn't be combined with a 'waitpeq' so as to set it LO as one met a match condition, without the extra 50 nsec delay. That would be highly desirable.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-05 17:43
    There are all kind of things that would be nice to combine with a WAITPxx instruction including a WAITCNT-like timeout. The hardware and instruction set isn't set up to provide enough operands for a more complex instruction. The 2nd generation Propeller will be faster which will help with more complex decision making on I/O transitions, but there is a need for a WAITPxx with a timeout since these are not properly done when a separate time-out cog is used. If we're constrained to use only two long operands, an I/O pin bitmask could be one and a CNT value could be the other. Carry would be true if CNT == source was the trigger. Zero would be true if INA & mask was zero/non-zero (two variants of the instruction like WAITPxx). This would not have quite the utility of having a state value to compare INA & mask against, but zero is far and away the most useful value given the two variants (PEQ and PNE). Another option might be to use the zero flag as the state to compare against.
  • starduststardust Posts: 2
    edited 2006-11-07 20:27
    Hello all,

    Can someone direct me to the schematic and code for the Logic Analyer? I can't seem to find it anywhere.

    Thanks much,

    Terry
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-11-07 20:43
    The code is an attachment to the first post in this thread. There is no specific schematic for the application, it works on any Propeller that has either a TV or VGA monitor attached to it. Refer to the circuit diagram for both circuits on the Propeller Demo Board here: http://www.parallax.com/dl/docs/prod/prop/PropDemoDschem.pdf

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

    Parallax, Inc.
  • milwmilw Posts: 12
    edited 2007-05-29 13:57
    Hey Paul, this is perfectly great! this is the exact reason I got the Prop Proto board (came in 4 days ago, just got TV_Terminal output working yesterday...)! jumpin.gif
    I had a couple of comments for the Example 04 code, where would be the best place to post those comments?
    thx & cheers!
    -Scott
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-06-04 20:43
    Example 04 from where? The counter docs?

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

    Parallax, Inc.
  • milwmilw Posts: 12
    edited 2007-06-04 21:30
    Oh sorry, I should have made that a link- it is #4 of Spin Code Examples for Beginners in this thread
    http://forums.parallax.com/forums/default.aspx?f=25&m=113109
    Showing text on TV Terminal
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-06-04 23:02
    Go ahead and ask in that thread. Haven't seen Dave around for a while, but there are alot of folks that would help try to answer your question.

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

    Parallax, Inc.
  • rokickirokicki Posts: 1,000
    edited 2007-06-18 18:16
    Paul,

    Did you think of providing a 20MHz routine? It would work by initializing a cog with a small loop. This small loop would fill the
    cog with a chain of mov xx,ina instructions, where xx is the address of the very same instruction. At the end of the loop would
    be code to copy the contents to main memory. You could probably get about 450 samples at 20MHz which would be only
    22 microseconds of capture, but it would be relatively simple to do. Then interleave four of these and you are sampling at
    80MHz. Howza!

    (And this is self-modifying code at a horrifying level; first we write out the "unrolled loop" which, when run, overwrites itself.
    Hehehe. Only on the prop.)

    -tom
  • LawsonLawson Posts: 870
    edited 2007-06-18 18:38
    OR! several cogs like Rokicki describes could be started one after another. Possibly giving 20MHz capture until the hub is full. Might want to add some semi-smart triggering code to the cogs too. With a 22 microsecond capture window, it'd be easy to miss something.

    My 2 cents
    Marty
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-06-18 18:52
    Yeah there is definitely 2 different ways of going with this, one is to achieve higher speeds upto the clock frequency itself, the other would be to slow down each cog so that the hub memory can be updated on the fly. I see more benefit to the former, since I dont think many people would want to sort through 10s of thousands of samples.

    Yeah there is some real strangeness in the code, when you are optimizing for space and it's a run-once-and-die routine, you can end up with some pretty peculiar code. But I agree one of my favorites is intializing a variable by using the initialization instruction in the variable location itself.

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

    Parallax, Inc.

    Post Edited (Paul Baker (Parallax)) : 6/18/2007 7:00:02 PM GMT
  • HannoHanno Posts: 1,130
    edited 2007-06-20 14:17
    Thanks for a great thread. We have implemented the interleaved, self-modifying code as discussed above to achieve an 80Mhz sampling rate. We've also improved the trigger and take 1600 samples. All of this is packaged in Viewport v1.1, a Windows application which provides a full featured GUI for measurements, datalogging, and data driven debugging. Viewport combines fast buffer sampling with 2Mbps streaming from memory to allow both very quick measurements, as well as monitoring much data over time. Please check it out!
    Thread:http://forums.parallax.com/showthread.php?p=657255
    Download:http://mydancebot.com/products/viewport/11
    Hanno
    myDanceBot.com
  • mikedivmikediv Posts: 825
    edited 2009-08-28 01:13
    Guys I have been following this thread trying to understand , The program looks great and I made the mods spoken of but my question is this is there way to use this program to monitor pins on another prop
    I want to be able to connect the main prop running this program to a second prop chip and be able to watch the I/O lines toggle back and forth like a real logic analyzer??? I wish there was some type of documents to go with this program it looks like it has so much to offer
    Thanks
Sign In or Register to comment.