Closed agatti closed 7 years ago
@USBEprom - can you please try out the version that is in the spi_extra branch? To switch to the "spi_extra" branch, check out the code from GitHub to a new directory (just to be sure), and then once you are inside the new source code directory, please run this command: git checkout spi_extra
, then please rebuild as normal and see if it works as intended with the extended bus speeds.
Or, if you get confused with Git and such, download one of the sample firmware builds from here:
bpv3_extra_spi.zip bpv4_extra_spi.zip
Caveat Emptor: those builds have not been tested on real hardware besides making sure that speeds can be chosen correctly. I still strongly suggest you to rebuild from source and flash that code instead.
Seems to work on v3 according to https://github.com/BusPirate/Bus_Pirate/issues/7#issuecomment-252505235
@agatti agatti wrote: Caveat Emptor: those builds have not been tested on real hardware besides making sure that speeds can be chosen correctly. I still strongly suggest you to rebuild from source and flash that code instead.
Sorry to keep bothering you, seems I did a kinda mess by replying in the wrong place. The test firmware you wrote is functioning well, I reconfirm here in the right place. However I want to do what you wrote, only I need the new repository. I am searching it, just I find it I will compile a new firmware from myself. Where exactly is it? Apologize and many thanks
If you don't know how to switch branch, then you can take a look at the zip file I attached: extra-spi-source.zip
However I was wondering about the real usefulness of such a thing. Ultimately, the effective data rate you can achieve is limited by the speed of the serial interface you connect with. On v3 it's through a FT232 chip, which means that it can more or less handle 1Mbps or so, on v4 it's built in the PIC24F chip and I guess it will not go as quickly as that.
So, if you generate the clock signal yourself, then you are still bound by the serial chip limitations and therefore going anything faster than 1Mhz is not really that useful, or if you are sniffing SPI traffic using an external clock that is faster than what the Bus Pirate can effectively send to the serial port maybe you're better off with a dedicated logic analyzer.
Please correct me if I'm wrong on this, as I just made some quick calculations off the back of my head without any real physical evidence of faster data transfers over SPI with a Bus Pirate.
@USBEprom can you please let me know about the higher SPI speeds concerns expressed in https://github.com/BusPirate/Bus_Pirate/issues/25#issuecomment-252830924 so I can either drop the branch or merge it in?
@agatti Really sorry my bad. I could not figure out where the new files were. I am really babo, thank you agatti for them! Now that I have your modified spi.c I built some new version up 256 characters command line and all the features but no BASIC and up 32 characters command line and all the features, BASIC too. For what I can see your improvements work well, any problem from my point of view. I believe you can merge all them into standard release. Still apologize me for the late, fault of mine as I just said. Many thanks
@agatti
A friend of mine has just checked with his logic analyzer the correctness of the new speeds in SPI menu. Seems that from 1 to 7 all it is OK, but starting from 8 until 12 do not work. Briefly:
Set speed:
Perhaps I was wrong to calculate the values for the prescalers, I must check. The logic analyzer is in the position to acquire up 24MHz so it should not have problem with those speed. However that friend of mine said me he will check with an oscilloscope. Sorry.
Duty cycle is not always 50% or near, but I guess that is pretty normal, even because using the FLASHROM program 8MHz speed behaves in the same way.
@agatti
The usual friend of mine has rechecked with an oscilloscope and actually them all are functioning well. It has been a fault of his cheap logic analyzer which can manage only 5V and 3,3V levels while moving up in frequency the amplitude of the signal generated by the Bus Pirate is below its acquisition threshold. So in the end all the entries into the menu are working in the correct way as expected.
Set speed:
Duty cycle works correctly too. In some ranges it is far from 50% but that is pretty normal. It behaves exactly as is to be expected, no problem. One more time I repeat your improvement is 100% good and functioning. Thanks!
@USBEprom Ok, thank you for checking - I'll merge this soon!
Closed with cf293ece66ff76cf9cb6edceae0f3a5ad28bc579
As mentioned in https://github.com/BusPirate/Bus_Pirate/issues/7#issuecomment-252490400 - the Bus Pirate can, in theory, have more than just the four SPI speeds it supports at the moment. This task is supposed to track development for such a thing.