FPGA "Pokitto"


#1

While I love these little “retro” gaming systems, I’m really outside their target market, in that I’m not going to learn much about programming from them. I buy/back them because they’re fun little gadgets and I’m all for things that help get kids into STEM fields.

Lately, I’ve been thinking about one where I would learn new programming skills: one built around an FPGA chip/board instead of a microcontroller. I don’t know the second thing about FPGA (I know that it’s a Field Programmable Gate Array, so that’s the first thing), so would definitely learn something from such a device. But it also means I have no idea how feasible that would be.

Could such be used to create interesting games? I know some old arcade boxes were hardware, so maybe? Is creating such games a reasonable undertaking for one person? Got me. Is there a “friendly” IDE ala Arduino or EMBED available for any of the FPGA hardware? Looking at Kickstarter, the answer seems to be “maybe”.

Anyone know a bit more about FPGA that care to answer these questions, or comment on the idea?


#2

If you ever want to make a FPGA Pokitto project, I will support it. I’ve decided that one day I too will dip my toes into the amazing world of FPGA’s


#3

I’ve looked into Verilog and VHDL before.
Never actually got round to writing anything because I inevitably found another project to do.

For making games I’d say go down the ‘hardware description language’ root since it’s probably easier, cheaper and has more tools (e.g. simulators, HDL to board definition translators) available than other routes.


It’s not exactly the same but I’ve attempted to design and build a CPU in one or two sandbox games that have built in logic gates, but I only ever succeeded in making individual parts, I always fell down at the control logic phase (getting the bits to flow around the board in the correct sequence). On the bright side, my ALU worked almost perfectly.


#4

There are plenty of FPGA-based games consoles around, and FPGA implementations of older consoles like the NES / GameBoy, just a couple of examples:


So it is definitely a rabbit-hole worth falling in to if you have the curiosity and enthusiasm for it, and you won’t be alone when you get there! :smiley:


#5

Based on far more time than I should have spent looking into this, I don’t think the FPGA world is ready for something like this. The issue is that the FPGA chip makers are stuck in the proprietary tool world. You pretty much have to use their tools, talking to their hardware connector, though they are starting to build those into the boards, but they still aren’t documenting the protocols the way the MCU folks do. And how the chips are programmed varies from vendor to vendor if not chip to chip. So there’s nothing like avrdude or dfuse or mbed or … for programming them, and no cross-vendor connector like the j-link or bmp for connecting to them. Given that VHDLs are unlike any other programming language, there isn’t even a common compiler like GCC to use with them. There are some open source tools that have reverse engineered bits of the some protocols, but they don’t seem ready for prime time yet. Amazon failed to crack this, their “FPGA on aws” offering is built on top of the vendors proprietary tool set.

There does seem to be regular attempts to create an “Arduino” like FPGA board, but they all seem to depend on the vendor tools, and fall by the wayside in short order. Simon Monk did a book on FPGA programming last year, and it used three different such boards.

That said, i can see some interesting projects that I could do with some of the $30-$60 boards, so I’ll probably get one.


#6

One interesting project could be to take up the challenge posed by @spinal’s thread here:

And create a sort of hardware middle-man between the microcontroller and an off-the-shelf LCD, allowing data to be sent from the microcontroller in a more compact 2 or 4 bit-per-pixel format, and then translated by the FPGA into the LCD’s 16 or 18 bits-per-pixel?

If you could achieve this with a small / cheap enough FPGA or CPLD then the cost vs benefit could be well worth it?


#7

I don’t think so, because you wind up back at the “why are you using such a primitive CPU?” question.

I can get data into an 8 or 16 bit LCD as fast as I can get it into a 1 bit LCD if I’m willing to use 8 or 16 gpio pins and do it in parallel. That’s a real burden on a 32u4 or similar, so you could use an FPGA that does some kind of 2/4 to 8/16 bit mapping to get that speed.

But 8 gpios is no big deal on an stm32f405 or some such. 16 may be a bit much, but in the real world you use the dma hardware in the chip to get a significant performance boost (on top of a180MHz, 32 bit CPU). Based on the cost of the dev boards, the STM chip is cheaper than the FPGA, so why not just use the STM chip?


#8

I am trying to look but can’t find. Aren’t there any hybrid chips with MCU core & FPGA peripherals?

If I was to be interested in this topic, it would be to do a custom Audio/GFX peripheral to a MCU core. I think the main problem here is the cost. FPGAs are still an order of magnitude more expensive than MCUs


#9

There are, but I think they’re mostly the latest generation of fpgas. Look at some of the fpgas with hundreds of thousands of logic elements. The stuff on boards in the Pokitto price range uses multipliers and ADCs as hard circuits. Some of them have MCUs on the board to intermediate between the fpga and the outside world, using say a 32u4 so you can program the fpga via USB as well as JTAG.


#10

Well, I think that’s a matter of perspective - there are a lot of people who would look at the Pokitto and say the exact same thing: “why are you using such a primitive CPU?!”

Where do we draw the line? :confused:

Working within a set of limitations and then seeing how far you can push them in creative ways is what actually makes it interesting.


#11

I can see why they would ask that - when it arrives, the pokitto will be the slowest arm chip I have, including the ones on the st-link and bmp hardware debuggers.

I haven’t asked that question, because I expect Jonne chose the least expensive chip that would get the job done. An fpga costs more than many of the 32-bit ARM chips that can do this job, even before you factor in the cost of the 8-bit MCU. That’s why it’s on the wrong side of the line you draw in this case.

And while I enjoy solving the problems inherent in cramming 8 kgs of code into a 4kg CPU, for real world projects you draw the line at the point where the project becomes either late or over budget. And frankly, exploring the expanded capabilities of these newer CPUs is more fun than fighting the limits of the smaller ones, as getting 120kgs of code in a 40kg CPU is both harder and more rewarding.


#12

True!

But… you can get Lattice’s iCEstick Evaluation Kit for $21.86 (24 GPIOs broken out):

http://www.latticesemi.com/icestick

And the actual ICs themselves for the same cost as the Pokitto’s LPC11U68:

https://www.digikey.com.au/products/en/integrated-circuits-ics/embedded-fpgas-field-programmable-gate-array/696?k=iCE40HX-1k

https://www.digikey.com.au/products/en/integrated-circuits-ics/embedded-microcontrollers/685?k=LPC11U68

So it’s not too extravagant! :slight_smile:


#13

No. I chose the simplest chip that could get the job done. I could have easily used a more powerful chip but not without a layer of added complexity.

Edit: what I mean by this is that Pokitto is made to be an entry to the magnificent world of ARM chips. It is intended as the first stepping stone to more advanced stuff. Using the LPC11U68 makes the system so simple that anyone can (if they wish to do so) understand the entire Pokitto down to the smallest detail with relatively small effort.

This is not the case if you have a typical dev board with lets say a M0 target with a M4 debugger and intermediary flash chips. Just looking at the schematics of “simple” dev boards like that takes alot of studying.


#14

Actually, you can’t :frowning:. Lattice wants $17 shipping for the thing, and nobody else has them in stock. The ice40hx is about the only fpga that has a complete open source tool chain, so was my first choice for one to play with. The ice40hx1k is also fairly wimpy - 1k lus, as compared to 5 to 10k for all the other FPGAs I looked at, including the ice40hx8k.

As Jonne notes, cost wasn’t the driving expense (complexity is also an expense) for him. You can get an stm32f103 for about 75% of the cost of the lpc11u68 (I use Arrow.com pricing). But an FPGA + 8-bit CPU is even more complex than the stm32f103. Also, check the chip specs; some of the FPGA chips don’t have on chip flash, and will need an external flash chip to load the config from at power on, so you may need to have that - adding both cost and complexity - as well.


#15

Kilograms of code?


#16

Yeah. It’s from a folk saying I grew up with about trying to put 5 pounds in a 10 pound bag, of what never being specified. It was about trying to do too much with to little.

In college, it turned into “code”, and we used it to talk about coding on tightly constrained machines, so usually memory. The example that sticks with me was a guy who changed the page header for line printer output so the characters matched a code segment he needed, then branched into the character string to execute them.

I decided I should update to metric units for this community, even though kgs and lbs measure different things.


#17

If anyone is still thinking about getting an FPGA dev board to play with, this one on crowdsupply could be really interesting, depending on how they price it.


#18

If you will have perfect working FPGA pokitto core there are companies making ASIC from FPGA.That ASIC is than 40% faster.But they accept 100 000 chips or so.So price will be like new car (30 000euro).
Anyways you will be able than have few cent or 1euro system on chip.This should make Pokitto cheaper in future.Also you will be able to add blitter for sprites or soundchip (ym2151 for example) etc etc.This can be good for Pokitto 2.

Google: FPGA-to-ASIC conversion