SPLAT - the logic analyser you can run in an ANSI Terminal
Peter Jakacki
Posts: 10,193
In developing MAGIC32 I needed an easy way to monitor up to 32 channels of serial transmit and receive data so I wrote a quick and dirty logic analyzer which is a work in progress but working now and will eventually be cleaned up so it won't be so "dirty". Sample time at present is only 7us or higher but this is sufficient for me to test SPLAT although today I will add the fast sample and trig module to it. All updates will be on the code document link and as a binary in the dropbox folder.
I've attached the current binary which also is accessible in the Tachyon binaries dropbox folder along with the readme text for it.
An early test of 32 channels transmitting is included, just run DEMO and don't forget to read the SPLATDEM.TXT file.
Have fun now while I dread catching up on my MAGIC32 thread from late last night!
(after which I might get some time to actually do some work on it!)
EDIT: <link to online manual> and <binary> and latest video.
LATEST: 150906 Added ASCII decode on cursor
I've attached the current binary which also is accessible in the Tachyon binaries dropbox folder along with the readme text for it.
An early test of 32 channels transmitting is included, just run DEMO and don't forget to read the SPLATDEM.TXT file.
Have fun now while I dread catching up on my MAGIC32 thread from late last night!
(after which I might get some time to actually do some work on it!)
EDIT: <link to online manual> and <binary> and latest video.
LATEST: 150906 Added ASCII decode on cursor
TXT
2K
Comments
You know I'm still steering clear of that other thread for the moment, just haven't had time plus I just had Tubular drop in on his way to the airport, first time we've met up, so he saw my "hackerspace" We all need to meet up sometime, down Melbourne I'd say if you are in the country that is.
I am back in Sydney (Wyong 100km north) after 4 1/2 weeks in S.Korea.
We should catch up in Melbourne - maybe after we've played with the P2 for a while
Meanwhile, I have some fast sampling done using multiple cogs. Need to dig it out again. I was experimenting with output to my 4" composite monitor using shrunk special font to get more on the screen.
played with it long time ago.
4 interleaved cogs
but that is not what we usually need bit slower in one COG is fine most of the time.
Personally I have avoid such logic analysers as I couldn't thiink of an actually need.
But that all changes when one begins to explore FPGA devices with P1V. This could become very handy.
Is splat written in forth or pasm? If pasm, I'd be interested in writing a c/c++ interface for use outside Tachyon.
it is writtten in Tachyon FORTH
only the fast sampling routine is a little PASM snipped.
I haven't seen it yet, but I think it will be a <18 instruction RUNtime MODule
If you need a PASM module to integrate with your C code
I'd recommend you have a look at the PROPALYZER capturing code.
Peter Splat looks really neat and I can see several uses for it. Look forward to playing very soon.
And if you guys are down this way be sure to let us know. Its a standing offer...
Just updated the binary and added some more features including the ability to set the scale to ns/us/ms or based on baud rate. The PASM capture is installed and it also does a quick pin load test to see if the pin is pulled up/down or floating as it may appear anyway and reports that next to the channel number. I expect to add SD logging so long term captures of up to 128kB/sec (at the moment) can be saved. Then again I have another method which stores CNT along with the capture so that we only need to save transitions.
Once I am happy enough with SPLAT and my macroassembler I will dive into the MAGIC32 interactive coding and testing, all on the one Prop!
EDIT: just realized why I'm only getting 128kBytes/sec write speed because I must be doing an automatic sector read before write which I don't have to do for this application. If I fix that up and maybe even give it its own cog to speed it up a bit I should be able to keep up with logging 32 I/O with 115k baud streams.
SPLAT may also get some frequency/period measurement enhancements too.
only the XADR@ needs to fetch the sector
and in the APPEND case the correct sector needs to be read before writing into it ...
open for append will do the job already
It seems the audio is out of synch so I will have to fix that or else do another video, maybe a bit wider anyway.
20MIP sampling rate in one cog for up to 480ish samples.
( Not saying this is new, I'm just not aware of it being used before, but perhaps it has).
What I wanted, and I worked on something similar for Phils browser project, was to do sampling at some lesser max rate using 2 alternating cogs, and filling up hub depending on available space. I was quite happy to plug an extra prop in parallel to achieve this.
The only other thing I thought of was if I cascaded these cogs in such a wait (counting cycles perhaps) that as soon as one cog had filled its memory then the next could take over and so on. That way although we are not increasing the sample rate from 20MIPs we are increasing the depth. Four cogs should give us over 1800 samples.
My 4 cogs start from the CNT plus an offset, so they can either interleaved for the fastest thru to running one after the other. Once you slow down enough it's possible to write out the cog to hub, and slower still to write directly to hub.
Once you are this slow it's possible to fill as much hub as is available.
If there is more time then extraction of the desired bits, then you can store even more.
Haven't tried writing out to SD card.
I've added a ton of new features and including an easy way to add labels and bear in mind too that even in a standard 32k EEPROM Prop system that you can save all the configuration with the normal Tachyon BACKUP command. The labels are entered from the shell command line in this manner with up to 4 characters per label:
19 LABEL TX20
25 LABEL REF
28 LABEL SCL
29 LABEL SDA
The labels will appear on the right and all you have to do to remove them is enter a blank name. You can even just keep these labels in a text file and copy and paste them into the command line. I've also tried to keep the format the same whether it is in SPLAT or on the command line so to change the width in SPLAT it is 150W or on the command line 150 W with whitespace. You can even set the number of channels from 8 to 32 so even a small screen will handle 16 channels easily.
There is also an online live manual that is being constantly updated.
When you want a timing diagram it is easy enough to do a screenshot of course but you can also just copy and paste the text itself like this:
Latest update now includes simple trigger for change of state on selected channels, a faster refresh rate, ASCII decode, division markers, extended key support (cursor and function keys) and many other little things.
There's still a bit on my to-do list but If you have some ideas or requests then please feel free to comment.
Dropbox binary has been updated. EDIT: Whoops, replaced binary with 115200 baud version
Should I be using the binary in the OP or the one in DropBox?
I tried the one in the OP, but couldn't get it working via putty. It looks like it's having trouble with the ANSI sequences. Has anyone else been able to use putty, or can suggest a better Windows terminal application that does work?
I use minicom on Linux or else TeraTerm on Windows as they both fully support ANSI modes. Minicom does require the -=color=on option though when launched.
Also, did you get trigger capabilities implemented? It occurs to me that I won't be able to properly time a sampling without it.
so you might try this patch
Here is a screenshot of SPLAT capturing I2C EEPROM activity but as you can see my I2C routines do clock a little too fast for SPLAT and that's where the capture cog would come in handy.
P0 is outputting a 250kHz reference.