[quote author="jgovers"] I've got a question/suggestion.. Why do we need a timer inside the FPGA? We can configure everything we need from the client software, which has all the information at hand. A timer implemented in the FPGA will need to collect the necessary information to calculate from clock pulses to seconds. Why not let the software do that? This would remove the need for a 'second' counter.[/quote]
That is a good question. The answer is that we don't, it doesn't matter where the timer runs, but I don't code Java.
I'm going to add a "finish now" command. That command could be used to implement a "finish now" button in the client which would let you finish the recording right away instead of waiting for the timer. The command could also be used to implement a software timer in the client.
[quote author="jgovers"]And about the need for 'ringing': implementing a done signal should not be that hard. All we need to known is from which memory address actual data is stored. If the memory reaches the memory spot before that address it is full with good data. [/quote]
The ringing is just there as a hack that I used to fix a problem I had when I tested the module. I'm not sure if it's needed the way it works now. It's only a couple of lines of VHDL anyway.
Edit: Just to clarify what I mean by "the way it works now", the client sends a reset every time you start a new capture. So assuming the client always does that then it's fine to let a state machine in the FPGA get stuck in a final inescapable state, because as soon as you start a new capture the state machine will reset.
I've set the timer to receive its time by the command 90h followed by four bytes of time expressed in seconds. Feel free to change this if you want, but I've set it to that for now.
So for example to set the timer to 32 seconds you (or rather the software client) would send 90h 00h 00h 00h 20h.
If you don't send a 90h command the timer will default to 20 seconds. Also, please note that the set timer command will not work until there is a PIC firmware (and a client) that supports it.
I'm not sure I follow. I don't know much about how it works, but I imagine that the software client sends command over the serial port to the PIC. The PIC then sends that to the FPGA. Is that anywhere near how it works? If so, which of the PIC and the FPGA is the SPI master?
Thanks for the feedback. The code is still in progress, with some fixes being made to the RLE module.
A configurable timer would be extremely easy to add inside the RLE module, but I don't know enough about how SUMP protocol and the Client --> PIC --> Spartan chain works and I don't have time to look into it at the moment.
I'm releasing my code as it is now, version 0.0.4 of the RLE module. Beware that it's not fully optimized or beautified for easy reading...
It lacks a couple of features which would be nice to have, namely a user-configurable timeout and a better solution for how to reset the timer (get a signal when the memory is full).
FPGA --> SPI --> WiFi module could be pretty fast and reliable. The WiFi wing might potentially provide faster data rates than USB 1.1. That would be nice for a continuous mode.
Other nice perks would be that your OLS is never grounded and that you can access it from several meters away, although those obviously apply to bluetooth as well.
Thanks for the feedback David Francis. Did I say 60 seconds? The timer is actually set to 100 seconds, so that's normal behaviour. I must have confused it with 64 hex. :-)
About it not working on subsequent captures; it sounds like something doesn't go back to it's original state properly. Going to look into that.
jack.gassett: Sounds promising. 16-bit mode would be really useful for parallel bus captures if it was 16-channel and counted run-lengths all the way up to 65k.
Is there any harm done if the recording finishes before the timer? It could be useful to have a timeout when you're using sample rates in the sub-MHz range. (Why you would want to do that is a different question.)
I think it overflows correctly, but I have not spent a lot of time at testing the overflow behavior. How did you spot the overflow bug in 2.12?
I have a new version for you to test. Changes: Timer is now set to 100 seconds. Timer no longer interferes with triggered recordings.
I guess a lot of the user cases would involve 4-channel, 3-channel, 2-channel or even 1-channel communication data from unknown devices. Stuff that the Bus pirate is too slow to do. Sample rates and reliability would be important.
One obvious and simple solution would be to have 4-channel, 2-channel and 1-channel modes where the data ends up being packaged in 8-bit words. The 4-channel mode would allow sample rates to be twice as fast as the 8-channel mode. The 2-channel mode would be four times as fast and the 1-channel mode would be eight times as fast.
Yeah, that would be nice. I don't know much about how Java works and even less about where the relevant stuff is in the client. Otherwise I would have tried to modify it myself.
With regards to the RLE: it's not using anything that isn't used by the normal mode. The data path in the FPGA is 32 bits wide and the RLE module sits on that data path.
The 32-bit RLE module in firmware 2.12 throws away anything that comes in on channel 31 and replaces that with the RLE flag when RLE is enabled.