Hey.
I found a new way to code.
It's amazing.
I've been so productive over the last three days, it's just been unreal.
Um.
You're probably thinking "Charles found another language other than C." (mumbles) (glares
angrily).
No.
But what I did find is "Spite Coding" And I'm not talking about byte coding.
No.
Spite Coding.
Here, let me explain.
I generally don't think of myself as that spiteful of a person but it all began when
I went out to go by a logic analyzer.
Specifically the Saleae.
I've borrowed my friend's Saleae for years now.
Probably borrowed it 40 or 50 times.
And it was time.
It's a really great little box.
It gives you a great little picture of what's going on.
There's no live view.
Umm.
The actual specs on it aren't really what you'd expect.
Like even though it samples at a very high rate, you can't actually.
The analog bandwidth is like 5 MHz.
Well, little less than that really in practical cases.
But umm.
Regardless.
It was a great analyzer.
It was time for me to just go buy it and and all the things and everything.
So I was like "Ok, Amazon, how much is it?"
$699?
So maybe it was one of those things where it was high on Amazon for some reason?
Well I went and I looked and well.
See here?
Products?
Oh?
It said $699.
It actually says $699 on their site.
It did not say that before.
I googled it a little bit and sure enough, they talk about a price change in December,
2017.
Just in time for me not to buy it.
So, I say spiteful.
I'm a man who likes saving money.
This is the opposite of saving me money.
Umm you raise the price?
I have no interest to deal with this.
And yeah.
I might be able to get the contractor pricing.
But no.
I'm not going to do this.
Basically your rationale is you can get more money from me because we're the cheapest.
No.
You were going to get some money from me because you were the cheapest.
Now that you're trying to get closer to the less cheap...
It's not happening.
It's not happening at all.
And, I thought about it for a bit.
And, actually it was only a few days ago on hackaday I was reading about this little cypress
module, and it reminded me I actually have a Cypress uuh Cypress part.
And the Cypress part right here.
I actually had this in my basement for over a year now.
It was purchased in 5 Feb 2016.
You can see it right there.
From Digikey.
I just wanted to dink with it.
It's a little USB 3.0 device.
It's called the Cypress FX3.
It was $45.
You can still get it from Digikey for $45.
And it's this neat little thing here.
You get the dev board for $45.
The chip is cheaper.
It's not a cheap chip.
Don't get me wrong.
It is cheaper than $5.
You get the whole dev board.
USB cable included.
So, what is the Cypress FX3?
It's just this unusual chip that's got USB 3.0, a whole PHY, an ARM9 and a fair bit of
SRAM and this magical GPIF bus.
And you might be wondering what is the GPIF bus?
It's a totally configurable bus that can run at 100 MHz.
Actually first thing I did was see if I could overclock it.
And you can overclock it some.
But it's this fully configurable thing.
And you use this software, this GPIF designer to go kinda set up state machines.
So you can set up really complicated things where this can happen then switch into this
state, start reading this data out.
And you can then take the data and put it out over DMA to the bus.
And, honestly, the reason this didn't get used by me before, and the reason I pretty
much gave up on it before was it said it supported Linux... and then when I started to dig into
it, I found out it didn't.
Because this tool, the tool you need isn't supported in linux.
So, I was like why?
Why even bother porting it?
And I found out people were asking for it in Linux.
So.
it's not like I'm the only one.
But, whatever.
I have Windows now so I don't really care as much, but it's really annoying to have
to boot into Windows for something that feels like it should be in Linux.
Anyway.
All that aside.
I have a lot of spite.
I have a box and a rough idea.
And I was like "OK" I'm spiteful.
I'm willing to spend like months of my life on this now.
I'm gonna be on a rampage.
How long will it take me to go develop this thing which could which could read.
Like all I really wanna do right now, for the first part of this is I wanna go read
the data off of these bits here.
Preferably 8 bits or maybe 16 and dump it into the computer.
And originally, I started with their little example thing.
They have a little example tool where...
It's just they have tons of examples.
It's all done in Eclipse.
And they're just piled high.
It's just a wonderful environment.
Regardless.
They have an example with isochronous transfers.
I was able to use their little test tool for it.
I ended up have some time to rewrite... regardless.
The point is, through my Amazon basics USB hub, so not even plugged directly into the
computer or anything, I had no problems getting 294.
Sorry 229 Megabytes per second through the port and it's actually reading.
You see the FF FF right there.
If I take my hand and I put it over some of these pins like that.
It starts dragging them low, you can see that the value is changing.
So, it's actually taking the data off the GPIF bus, at the ridiculous 100 MHz rate.
It's actually slightly more than 100 cause I am overclocking it right now.
And.
Umm.
All 16 bits, I'm piping them through, to my computer, to my C application that's just
reading it out on the other end.
So now, how long did all this take?
So, I'm recording this video now, it's the 29th.
I started actually.
When I first started this, I started writing a complete log of everything that I did.
How long is this gonna take?
How much effort do people really put into making logic analyzers?
And, uuh.
I just logged it.
And it was about 20...
Maybe 24 hours of work.
And that did involve me completely rewriting the Cypress API for this CyAPI for how they
do it.
And specifically rewriting it to be geared around really fast isochronous transfers.
And I spent a while doing that, and it means it could be written in C now, you know, an
easier language for me to deal with.
You don't need Visual Studio.
You can just use TinyCC and it also means that it will be compatible with libusb very
easily.
Umm.
And I can read this data off and everything just works.
So, all in all this is.
I'm hoping someone from Sigrok is looking right now, cause if they are I'd really like
to talk a little bit and if they are maybe you can buy one of these and we'll be able
to go.
And, I could just use your software with this thing that's really easy.
The next part is it's 16 bits reading at over 100 MHz.
Let's go slap an ADC to this sucker.
Let's go slap two.
Turn it into an SDR or something.
That'll be fun.
Why not?
And like 100 MHz sampling, dual channel.
We can get some I and Q in there.
Or maybe we'll be able to get four ADCs.
I'll be able to have something better than the Saleae formy applications.
I really only need about 4 channels to analyze, and analog is great.
I think it'll be just grand.
Umm.
The source code for both the C side and the source code that goes onto the board.
All that's located in my github right here.
The board is under "testproject" which I'm going to go clean it up a little bit before
I give it out to everybody, but yeah.
This stuff works.
It's fun.
It's crazy.
Go forth.
Go buy some of these kits.
I hope to see this number this 273 start shrinking.
Cause this thing is pretty neat.
Really isn't that hard to use.
And, uuh.
And well, yeah.
Go for it.
I recorded the first cut of this video at about 4 AM last night.
And, at the time I thought there were some problems I didn't know if they would be show
stoppers.
There still might be show stoppers.
But, the community surrounding the FX3 is just amazing.
I was able to ask my question and ridiculously fast, people like MDDD came to my rescue being
able to offer this really in depth advice about how to handle a certain detail in the
design.
And being able to take that and then in a few hours take what he had and then go from
there to this is just awesome.
So, now I'm actually getting it with no dropped packets it seems.
So, maybe there is still problems but it looks really want to thank patrons.
Cause I can post my videos there and they see it and give feedback an just thanks.
It's really cool that some of you guys are willing to focus that much on what I'm doing
to support it.
And the last part is I wanted to mention is the reason this video is significant to me
isn't because I did this cool thing but it's because this thing I thought was going to
take months of time and effort, took days.
Took less than a week of effort.
And it's not done.
But being able to go from what I thought would take months that's why I didn't start.
I thought it would take way too long.
That's why I didn't even bother trying.
To just try.
And it was really cool to see all I had to was just try.
And, all this great stuff happened.
And I really encourage you guys don't let the things that seem scary or that I'm gonna
have to learn all this stuff.
Don't let that stop you from just trying.
Thanks, guys.