Propeller 2 Logic Analyzer
ozpropdev
Posts: 2,792
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.
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.
zip
271K
Comments
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.
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.
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.
All chips these days are designed by committees ....
..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.
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.
This looks to be very straightforward and relatively simple.
This is what lets new PC's BIOS use keyboards and mice for setup...
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.
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
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
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.
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
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.
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
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)
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!
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.
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....
I'm keen to use the PC rather than VGA/buttons.
I am home tomorrow so I'll have a go as I need to test some SD code.
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.
Good pick up Peter.
Edit: Font file added above.
btw - excellent work!!!
It include the use of a pins selector capability to read an nearby pins state.
Also the use of a marker signal.
Insert the above code into the "test code" section to produce the included capture.
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 ?
Working nicely after a few finger problems
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
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.