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

Propeller 2 Logic Analyzer

ozpropdevozpropdev Posts: 2,792
edited 2018-11-13 03:26 in Propeller 2
Hi All
Here's my latest version of the P2 logic analyser I've been tinkering with.
I have found it very useful for testing and diagnosis of the smartpins.
Included is a Windows app for capturing the video images produced by the LA.
Just drop your code at the end of the source, configure the trace labels and run the code.
The demo includes some test code that runs a few smartpins in different modes.
The four pushbuttons on the A9 board are used to control pan, zoom etc.
The blue labels on the bottom left of screen show the current function.
Use the mode key to cycle through the available functions.
The LA currently only works with PortA P0-P31.
Take a Look at my "test code" at the end of the source to see how the LA is configured.
Hope you folks find it as useful as I have. :)
«1

Comments

  • RaymanRayman Posts: 14,646
    Looks nice. So the normal output is to VGA, but the app sends screenshots over to PC?
  • samuellsamuell Posts: 554
    edited 2016-04-08 22:42
    Nice feature! I can't wait for the P2 to be released.

    As an aside, I'm a bit saddened to see design by committee occurring here. I now see USB periphericals and support, and so on, to be added. All I want is a 16 core design like the P1, only more fast, with the specs as promissed. USB is a broken standard, anyway. Any micros that had USB, I had to give up using them. For instance, the Microchip USB stack is a pain to implement and won't fit in a 32KB micro without optimization. I just don't want to see the same occurring here. A bad, broken feature is worse than none. To finish, the Propeller, as is, is beautiful for its simplicity. At first, the only think I didn't like was the lack of interrupts. But that turned out to be a plus.
  • @Rayman
    Currently when the "test code" is started it's results are sent to the PC.
    You can send a "capture" to the PC at any time using the "GRAB" function.
    I modified the LA to send a screen grab on any button press.
    This way you can operate the LA without a VGA monitor connected.
    A slight delay from button press to PC update is the only downside.
    Hope that helps. :)
  • cgraceycgracey Posts: 14,152
    samuell wrote: »
    Nice feature! I can't wait for the P2 to be released.

    As an aside, I'm a bit saddened to see design by committee occurring here. I now see USB periphericals and support, and so on, to be added. All I want is a 16 core design like the P1, only more fast, with the specs as promissed. USB is a broken standard, anyway. Any micros that had USB, I had to give up using them. For instance, the Microchip USB stack is a pain to implement and won't fit in a 32KB micro without optimization. I just don't want to see the same occurring here. A bad, broken feature is worse than none. To finish, the Propeller, as is, is beautiful for its simplicity. At first, the only think I didn't like was the lack of interrupts. But that turned out to be a plus.

    What we implemented for USB is just the wire-level protocol without the CRC. It can be used as a communication link, without the USB baggage, if you wanted.
  • jmgjmg Posts: 15,173
    samuell wrote: »
    Nice feature! I can't wait for the P2 to be released.

    As an aside, I'm a bit saddened to see design by committee occurring here.

    All chips these days are designed by committees ....
    samuell wrote: »
    I now see USB periphericals and support, and so on, to be added. ... USB is a broken standard, anyway.
    ..and yet there are billions? of USB chips out there ?
    The level of perceived design elegance is immaterial - the fact it is a standard serial link, is what is important.
    samuell wrote: »
    Any micros that had USB, I had to give up using them. For instance, the Microchip USB stack is a pain to implement and won't fit in a 32KB micro without optimization. I just don't want to see the same occurring here. A bad, broken feature is worse than none.
    Yet others somehow manage to ship working products ?
    Silabs, for example, have a ~1.5kB USB Bootloader, so I would expect a P2 to do 'useful work', inside one COG.

  • RaymanRayman Posts: 14,646
    For keyboard and mice, I've read there is something called "boot protocol".
    This looks to be very straightforward and relatively simple.
    This is what lets new PC's BIOS use keyboards and mice for setup...
  • samuellsamuell Posts: 554
    edited 2016-04-09 19:43
    jmg wrote: »
    All chips these days are designed by committees ....
    Too bad. No wonder why most promising projects die before launch. Well, a camel is a horse designed my committee. The word "committee" is also designed by "committee". To many 'm's, and 't's, and 'e's.
    jmg wrote: »
    ..and yet there are billions? of USB chips out there ?
    The level of perceived design elegance is immaterial - the fact it is a standard serial link, is what is important.
    Within the "millions" you give, only an uncertain small percentage is USB compliant. The others don't make it. If you were manager of Parallax, were you willing to pay dozens of thousands for the compliance testing of a secondary feature? Stick a USB brigde on the PCB and it is done. Remember that the goal of the P2 is to have 16 cores working at 200MIPS. ADCs and DACs are welcome if you want to compete with PSOC chips, like cortex M0 and M4. Adding USB is a great step, but may be a disaster in the making. If you want more speed, just use a CP2130 SPI bridge, or some other SPI bridge capable of 20MBaud operation.
    jmg wrote: »
    Yet others somehow manage to ship working products ?
    Silabs, for example, have a ~1.5kB USB Bootloader, so I would expect a P2 to do 'useful work', inside one COG.
    So, you did referred a working example, but you didn't mentioned a chip at all. So, what would be the example of a micro-controller? Perhaps the Gecko, that has a Cortex-Mx in it, a design fully tested, a well paid IP, functional out of the box, that has native USB support?

    So, since I mentioned those points in quotes, and counter-argued them, my reasoning is that the P2 might not get out the design stage because of a vampiric little feature such as USB. Anyways, I would dispense USB from my applications. For instance, a PLC can live well without USB, but ADCs are necessary for reading sensors. I can't imagine an application where USB is indispensable, unless you are planning to build a PC or something.

    Kind regards, Samuel Lourenço
  • samuellsamuell Posts: 554
    edited 2016-04-09 19:14
    cgracey wrote: »
    samuell wrote: »
    Nice feature! I can't wait for the P2 to be released.

    As an aside, I'm a bit saddened to see design by committee occurring here. I now see USB periphericals and support, and so on, to be added. All I want is a 16 core design like the P1, only more fast, with the specs as promissed. USB is a broken standard, anyway. Any micros that had USB, I had to give up using them. For instance, the Microchip USB stack is a pain to implement and won't fit in a 32KB micro without optimization. I just don't want to see the same occurring here. A bad, broken feature is worse than none. To finish, the Propeller, as is, is beautiful for its simplicity. At first, the only think I didn't like was the lack of interrupts. But that turned out to be a plus.

    What we implemented for USB is just the wire-level protocol without the CRC. It can be used as a communication link, without the USB baggage, if you wanted.
    Hi Chip,

    Good to hear that USB is over with. It is always nice to keep it simple.

    I'm all interested in the sheer processing power of this micro. That and the ease of programming that makes it attractive. Added peripherals on board for those who wish will take care of custom specifications.

    Kind regards, Samuel Lourenço
  • jmgjmg Posts: 15,173
    samuell wrote: »
    jmg wrote: »
    Yet others somehow manage to ship working products ?
    Silabs, for example, have a ~1.5kB USB Bootloader, so I would expect a P2 to do 'useful work', inside one COG.
    So, you did referred a working example, but you didn't mentioned a chip at all. So, what would be the example of a micro-controller? Perhaps the Gecko, that has a Cortex-Mx in it, a design fully tested, a well paid IP, functional out of the box, that has native USB support?
    Sorry for the lack of detail, I was thinking of the EFM8UB1, an 8 bit MCU, ~ 60c/1k
    AN945 gives sizes on their UART/i2c/USB HID boot loaders. sub 512 bytes for each of UART & i2c choices and sub 1.5k for USB HID.

    Not sure what you mean by 'native' but yes, it has a USB peripheral, but note that still requires quite a lot of code, 3x relative to UART or i2c.
    The P2 USB in Pin-cell could also be called native, as it manages the bit level work, and stuff/destuff, leaving the byte level work to the user.
    There will be more timing care, but the COG nature of P2 makes that easier to manage.
  • And one interesting side effect of not being a 'full' USB device in HW is - we can tinker with it!

    Like using the video generator for fast SPI out on the P1 somebody will find some way to 'missuse' the USB wire-level protocol for something else.

    Sometime this will be a chip. Hopefully soon.

    Mike
  • jmgjmg Posts: 15,173
    msrobots wrote: »
    And one interesting side effect of not being a 'full' USB device in HW is - we can tinker with it!

    Like using the video generator for fast SPI out on the P1 somebody will find some way to 'missuse' the USB wire-level protocol for something else.

    A couple of obvious variants would be
    * Opto (or other isolators) isolated USB
    * Faster Control networks ( optionally using external Half Duplex transceivers )
    The latter would be a network of P2's

    Hopefully the Port IO mapping details for USB, can support such variants.
  • Cluso99Cluso99 Posts: 18,069
    ozpropdev wrote: »
    @Rayman
    Currently when the "test code" is started it's results are sent to the PC.
    You can send a "capture" to the PC at any time using the "GRAB" function.
    I modified the LA to send a screen grab on any button press.
    This way you can operate the LA without a VGA monitor connected.
    A slight delay from button press to PC update is the only downside.
    Hope that helps. :)

    Brian, I'd like to get this running to see what it can do. I don't have VGA on my P2D2, nor the buttons (at least not wired anyway).
    It might be better for me to extend this rather than build my own :smiley:

    How does the VGA screen capture work and what is sent to the PC? ie how do I display it on the PC?
    (there is a lot of code there and I am just being lazy in not delving into it deeply to understand what is happening)
  • Ray
    My TODO list includes updating this code to P2 silicon.
    It's been a while since I played with this code and I have a PC utility that goes with it too.
    I hope to revive this project tomorrow, I need it too! :)
  • Cluso99Cluso99 Posts: 18,069
    What switches, buttons, etc are required as I will build them?
    Also what will I need for the VGA connection (presume RGB + HS + VS = 5 pins + GND) and what order and preferred pins? Presume no external resistors required.
  • ozpropdevozpropdev Posts: 2,792
    edited 2018-11-07 04:10
    Update:
    The code has been hacked about as the FPGA images evolved.
    The button support broke when one of the buttons became a hardware reset.
    It also used to support rotary encoders for pan/zoom but that won't work on silicon Rev A.

    The PC utility for the LA gives remote control anyways so you can use it without buttons, VGA if you want to.
    I've got up and running now, just need to tidy up a few loose ends and we should be good to go.

    FYI my VGA connections currently are
    P0 Hsync
    P1 Blue
    P2 Green
    P3 Red
    P4 Vsync

    Edit: Hope to post some updates soon....

  • Cluso99Cluso99 Posts: 18,069
    Sounds good Brian. Looking forward to trying it out.
    I'm keen to use the PC rather than VGA/buttons.
  • Cluso99Cluso99 Posts: 18,069
    Any chance you can post the code on where you are up to?
    I am home tomorrow so I'll have a go as I need to test some SD code.
  • ozpropdevozpropdev Posts: 2,792
    edited 2018-11-13 11:38
    Here it is Ray.
    Still needs some cleaning up, but is very useful in its current state.
    I'm working on some more demos today.

    Unzip the files into a temp folder and run setup to install the LA control tool.(Windows)

    Edit: Added missing font file.
  • Cluso99Cluso99 Posts: 18,069
    Thanks Brian. I will check it out in the morning :)
  • I had a quick look at it earlier in the day but it was missing the ozfont file but I just commented that out so I could check the VGA mode.
    font		file "ozfont.dat"
    
  • ozpropdevozpropdev Posts: 2,792
    edited 2018-11-13 11:39
    Oops!
    Good pick up Peter.

    Edit: Font file added above.
  • ozpropdev wrote: »
    Oops!
    Good pick up Peter.

    Edit: Font file added above.

    :) btw - excellent work!!!
  • :) btw - excellent work!!!
    Right back at you Peter, appreciate your efforts on the SD/SPI shake down. :cool:


  • Here's a test code sample of exercising a smart pin in transition mode.
    It include the use of a pins selector capability to read an nearby pins state.
    Also the use of a marker signal.
    dat		orgh
    
    user_title	byte	"smartpin transition mode demo",0
    
    		org
    
    test_code	drvl	#12			'clear marker pin
    
    		wrpin	#_trans,#8		'stransition mode
    		wxpin	#8,#8			'8 clocks width
    		dirh	#8
    
    'Pin #8 INx now represents the smart pins status.
    'So we use a neighbor pin to look at the pin output state.
    
    		wrpin	##%0111 << 28,#9	'x111 = relative -1 pin’s read state 	'
    
    'start the capture
    
    		loc	ptrb,#@capcon
    		wrlong	#1,ptrb	
    
    		waitx	#80-2			'wait a bit,padding
    
    		rep	#1,#8			'toggle marker pin
    		outnot	#12
    
    		wypin	#13*2,#8		'start 26 transitions of 8 clocks long
    
    busy		testp	#8 wc			'wait while busy
    	if_nc	jmp	#busy
    
    		wxpin	#32,#8			'32 clocks width
    		wypin	#3*2,#8			'start 3 transitions of 32 clocks long
    
    		rep	#1,#8			'toggle marker pin
    		outnot	#12
    
    		waitx	##sys_clk / 5		'wait 1/5 sec
    
    		cogatn	#1			'plot results
    		cogid	pa
    		cogstop	pa
    
    '*********************************************************************
    
    		orgh
    {{
    Format of trace list (3 longs per trace)
    
    first long = pointer to zero terminated label string
    second long = bit number (0-31) P0-P31
    third long = trace color (0 - 15)
    }}
    
    trace_list	
    		long	@_p8,p8,bright_green
    		long	@_p9,p9,bright_cyan
    		long	@_blank_,-1,black
    		long	@marker1,12,yellow
    
    		long	0	'trace list end
    
    'zero terminated labels (max length 10 characters)
    
    _blank_		byte	"          ",0
    _p8		byte	"8 done    ",0
    _p9		byte	"9 state   ",0
    
    marker1		byte	"12 marker ",0
    

    Insert the above code into the "test code" section to produce the included capture.
    800 x 600 - 56K
  • jmgjmg Posts: 15,173
    ozpropdev wrote: »
    Here's a test code sample of exercising a smart pin in transition mode.

    Nice captures.
    That seems to show an edge gap at the change-over, that is neither frequencies period ?

    Suppose you make 64/65 clocks the 2 choices, is the change over SW or period related ?

  • Cluso99Cluso99 Posts: 18,069
    Brian,
    Working nicely after a few finger problems :smiley:
  • Cluso99Cluso99 Posts: 18,069
    Brian,

    I would like to put RGBHV on pins P0, P2, P4,P6 & P8 on the P2D2 as I want to use a 6 pin SIL connector for my VGA cable.
    Is it possible to use these pins???

    This looks like the code outputting to the VGA pins
      vsync         =       4
                    .....
    no_atn          dirh    #vsync                  'make vsync pin output
    
                    wrpin   dacmode_s,#0            'enable dac modes in pins 0..3
                    wrpin   dacmode_c,#1
                    wrpin   dacmode_c,#2
                    wrpin   dacmode_c,#3
                    setnib  dira,#$f,#0
                    .....
                    outnot  #vsync                  'sync on
    
  • Short answer No.
    DAC0 can drive the DAC's of all pins numbered %XXXX00.
    DAC1 can drive the DAC's of all pins numbered %XXXX01.
    DAC2 can drive the DAC's of all pins numbered %XXXX10.
    DAC3 can drive the DAC's of all pins numbered %XXXX11. 
    
  • Cluso99Cluso99 Posts: 18,069
    No worries.

    I just tried VGA and I am not getting anything displayed. PC is working with your code.
    I will need to check my wiring but not tonight :(
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-11-14 12:07
    Cluso99 wrote: »
    No worries.

    I just tried VGA and I am not getting anything displayed. PC is working with your code.
    I will need to check my wiring but not tonight :(

    VGA and Brian's LA work as I tried it already. This is my setup:
    P0-->HSYNC
    P1-->BLUE
    P2-->GREEN
    P3-->RED
    P4-->VSYNC

    Just wire up the grounds and connect to these pins directly and it will work, especially as Brian's code runs on a P2D2 like yours.

Sign In or Register to comment.