With a BASIC interpreter and free run throughout their hardware, home computers like the ZX Spectrum and Commodore 64 used to be a pervasive way to light that hacker fire. With the advent of cheap single board computers like the Raspberry Pi, devices purpose built to emulate these classic systems have become fairly commonplace. [uli] built a device in this vein called the BASIC Engine which is driven by a microcontroller and a handful of hardware peripherals. Like other examples it can be attached to a keyboard, programmed in a BASIC, play video and sound, etc. But digging into the BASIC Engine reveals that it’s similarity to other devices is only skin deep.
The current version of the BASIC Engine (“rev2”) lives in a Raspberry Pi 3 case for convenience. It has RCA connectors for NTSC or PAL video output and mono audio, plus a bank of headers to tap into GPIOs, connectors for a keyboard, and more. [uli] wanted to aim for extreme low cost so a relatively beefy board like a Raspberry Pi didn’t fit the bill, and we expect it was an enjoyable challenge. Instead its interpreter runs atop an ESP8266 but with the networking stack removed. [uli] was disheartened by how bloated even a “Hello world” program was and ripped it out, discovering that hidden beneath was a very powerful and disproportionately inexpensive general purpose microcontroller. The video is driven by a VS23S010, sold as a 1 Mbit parallel SRAM with a neat trick; it also includes a composite video controller!
The real treat here is [uli]’s history writeup of how the BASIC Engine came to be. We’d recommend brewing a cup of coffee and sitting down for a full read-through. The first version was inspired by the PlayPower project, which was repurposing clones of Nintendo’s Famicom (NES to Americans) game console to make low cost home computers, complete with keyboard and gamepad input. [uli] started out by building a custom cartridge for a particular Famicom clone that ran a BASIC interpreter but after showing it to disinterested adults the project was left fallow. Years later, [uli] was encouraged to pick up the project again, leading down a twisted rabbit hole to where we are today.
If you want to build a BASIC Engine for yourself, Gerbers and build instructions are available on the pages linked above.
Thanks for the tip [antibyte]!
Please, please let BASIC die.
No. In fact, I’m actively reviving 8-bit systems running BASIC. So, :-P~~
Come on, it’s fun because it reminds us of The Old Days(TM), and nobody in their right minds uses it for serious work any more.
I work in a critical system which uses VB… I rather hate it.
D’oh, I only thought about VB after posting this. But I’ll use the opportunity to say:
… as I said.
;-)
FWIW, I am forced to work with VB at work sometimes, and I am firmly convinced that the people that thought Excel was the right tool for this particular job, had no clue about either Excel or the problem they were trying to solve. (Probably a case of “If your only tool is a hammer, every problem looks like a nail.”)
But nothing lasts as long than a shitty makeshift “solution”, I guess.
So, I know how you feel.
My brother is an Excel/VB pro. He was forced into retirement to save his group money, only to have them hire him back as a “consultant”, because no one else in his group bothered to learn how to write an Excel macro in the past 15 years… He often offered to show anyone how he did something…
It would be a case of either him doing it in a minute or two each time he was asked to “make/fix something”, with which he offered to show them how to do that particular task in ~15 minutes, so they could do it themselves. But they all turned him down every time for various “reasons”.
He was a Lotus 1-2-3 guru before they shoved Excel down his throat.
My brother did write a lot of macros for his cow-orkers to use, but every iteration of Excel (2000, 2003, etc.) would break a lot of the existing ones, and he’d have to re-do them.
I remember back in undergrad (for an internship) I wrote a macro in Excel that automatically performed a FFT on recorded data.
If Excel is the right tool for the job, you’re doing the wrong job.
I learned to program using BASIC on an Altair. I wrote a ton of stuff in VB 6 back in the day. When VB.net came along, I wasn’t programming (kids got in the way). Now, I can’t imagine using any version of Basic – if I need something like it, I’d use Python.
If I were to have a language die it would be Javascript.
People who hate Javascript don’t understand Javascript.
People who say “people who hate Javascript don’t understand Javascript”, don’t understand Javascript.
Replaced by what?
It needs to be replaced with static HTML pages
Static html oh how I miss your speedy pages and browsable via email proxys(browse via email forwarding) and high latency networks.
Javascript is a lovely language hobbled by a piss-poor execution environment (browsers) and the insanity of “truthiness” where the equality operator is not transitive. Stay away from mucking about with the DOM, take a little care with your types and religiously use === and !==, you’ll have a good time.
Someone scarred by GOTO.
And GOSUBs!
And GOSUB
Back in the 1980s, I ran BASIC on the Hewlett Packard HP-9836 desktop computers. It was great.
Basic is a great langugage.
Easy to read and learn.
Pity I cant use it at the moment since i’m so snowed in on C/C++.
It will nerver die.
The purpose of a good language.
I hated BASIC in the old days, and hate it even more now.
> It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.
–Edsger W. Dijkstra
just goes to show he really doesn’t know everything.
if you really believe you can’t write good programs in BASIC then you just aren’t a very good programmer.
Meh. Or maybe you forgot how the ugliness of a BASIC program tends to quadratically increase with every added line? :P
It’s nice for learning some of the concepts of a computer. But if you don’t leave BASIC behind, you will never build any large programs. Unless, maybe if you’re ‘rainman’. :P
Still use VB6 … there has been nothing … i have not been able to achieve (other than make it run on a mobile 😊 ) using VB6.
those who say Basic Creates bad programmers do not actually know VB6 or even VBnet
Typically language snob comment.
BASIC is probably the easiest language to get kids started with programming, without a lot of abstraction layers, or a huge framework with lots of dependencies, mumbo-jumbo classes etc, ending up in a 5MB “Hello world”.
Basic can be implemented extremely simple, eg. like the Olimex DuinoMite-Mini, which is ready to connect to a VGA monitor, a keyboard, and one can start playing, eg. in few instruction turn on and of leds etc.
And it get the user (kid) much closer to the metal, as it is not a wire disappearing into a big black box, or the internet, but a real device lying in front of one.
Later on, when the kid has a feeling of what’s up and down and having the basic idea of what programming is as a concept, then it can move on to other languages – instead of starting breaking the neck with case sensitive, odd commands, program a rubber band, dependant of a browser, horrible JavaScript.
This is a rather old article, but not much have actually changed, so it is still valid:
https://web.archive.org/web/20120710060613/http://www.salon.com/2006/09/14/basic_2/
I spend my childhood writing BASIC and now I write “proper” programming languages for money. I see the shit that passes for educational programming environments these days (your options are Scratch or Python? Please) and I wonder where we’ll get a generation of programmers from.
Now this looks like a neat little board.
I wonder if it be would powerful enough to run a convincing C64 emulator.
There’s already at least one C64 emulator that runs on an ESP8266 which sends the display to a web browser. https://github.com/NardJ/esp8266-C64 is one example.
So I’d say, unless the driver code for the VS23S010 adds a lot of overhead compared to the web interface, I’d say it was quite likely.
That is my C64 emulator written for the Arduino DUE.
It uses Mike’s 6502 emulator engine.
I already did that one on the esp8266.
With standalone composite video.
http://mcuhacker.wordpress.com
Dude! I’ve bookmarked you!
It aint that difficult.
Send me a PM and youll have the sketch.
That VLSI Solution VS23S010 chip is the weirdest thing I’ve heard of for a minute. Are there other bizarre chips like that floating around? Was it originally a video controller and then they decided to start selling it as external ram that just happened to have video stuff built in?
From the developer of the chip:
And at a meeting, our CEO asked if we had any other ideas for the product. And so I said that if we just add a couple of counters inside, we could make a pattern generator that could be useful for “various purposes”. He said that should be ok, if indeed it was “just a couple of counters” and didn’t make the chip a testing nightmare.
…
I actually came to the lab during the weekend and wrote the configuration for a minimalistic NTSC modulator on that tiny CPLD. When our CEO saw it, he asked if we could fit it inside our IC. And I said, sure, its something like 10 to 20 flip-flops. But with a little more, we could make it much better. He asked how much better, and I said full color (my demo had 14 colors – sync level, burst level and 14 indexed colors formed with VHDL combinatorial logic statements). Of course we would need to put a DAC inside, but no problem, our company is expert with DACs.
Source : https://basicengine.org/history.html
This link was already in the HaD article, and the discussed project’s “history” blog made that citation and mentionned the real source from Uzebox forums.
https://hackaday.com/2015/03/18/new-part-day-spi-ram-and-a-video-controller/
I think that chip could find use in a lot of retro style projects and some not so retro ones such as a HUD on a FPV drone.
I think that was my favorite part of the whole thing! Such a weird part….
And everybody can get in on the weirdness.
I thought the chip was pretty cool and made an Arduino Shield out of it :)
Featured here and for sale on your favourite weird HW store (disclaimer: shameless self plug).
https://hackaday.com/2017/10/30/hackaday-prize-entry-arduino-video-display-shield/
https://www.tindie.com/products/Wolfi/ntscpal-video-display-shield-for-arduino/
I just read the datasheets on the VS23S010D-L
Chip Summary – http://www.vlsi.fi/en/products/vs23s010.html
The interfacing requirements are in the Data Sheet –
[PDF] http://www.vlsi.fi/fileadmin/datasheets/vs23s010.pdf
and the nitty gritty of video generation are in the Guide –
[PDF] http://www.vlsi.fi/fileadmin/manuals_guides/vs23guide.pdf
It’s quite an incredible and versatile chip – perfect in many ways for retro style PAL/NTSC generation for retro computers.
There are some limitations though.
The chip has only one DAC so the output is limited to composite output. Though you can use a number of them to generate RGB. There is also an upgraded version that has 4 DACs but it is a tiny BGA.
The biggest limitation is that you must use SPI to configure the chip. You can also read/write SRAM via SPI so you can use SPI ‘only’ if you want. That makes it perfect for a modern micro-controller that has SPI.
You can also read/write the SRAM via a parallel bus. So it’s needs some support to work with older retro CPUs that don’t have SPI. At the price that it is it would be worth including an AVR like the Arduino atMEGA328P-pu to help the retro CPU interface to the VS23S010D-L.
The video generation is extremely versatile (in the GUIDE). Any imaginable video output layout any color depth are possible within the limitation of 128kB which is more than enough for a retro computer. The maximum color depth is 16 bit and there are ways to use color and brightness pallets.
It supports hardware scrolling and has a high speed block copy function that can be used for easy and fast software sprites. You could choose a resolution that leaves SRAM left over and store characters or sprites/tiles higher up in SRAM.
It supports sequential read and write operation to speed up data transfer.
If you know your HDL then you could use a very small CPLD to interface from the CPU parallel bus to the VS23S010D-L SPI. Then it would be only one port and not take up any significant CPU addressing space.
It supports 18 video standards including VGA 640×480 8 color, PAL 128 color, NTSC 512 color, QVGA 320×240 8192 color.
It would also make a perfect Arduino “video shield”. It would probably perform well enough right from the Arduino IDE’s sketch language.
Just right for an AVR retro environment or even a retro emulator.
It would be great if someone made a breakout for this chip to run it in SPI mode.
If you are OK using an Arduino Shield for a breakout board, there is one available.
https://www.tindie.com/products/Wolfi/ntscpal-video-display-shield-for-arduino/
Disclaimer, see the comment above yours. :)
BASIC needs to die. it’s slooow, just like C/C++ and ASSembly. Java is where it’s at. With just a few Gb of libraries and a few Gb of RAM, and as little as 4 cores, “hello world” compiles and runs in just a few minutes. It would be even faster if we had java running inside a java cpu, running a OS made in java, but nothing is perfect.
Plus, you get to pay money to lord Oracle!
If I didn’t know better, I would suspect sarcasm is involved here…
Powered by coffee that’s dripping from my screen.
nice… very nice… interesting approach using an ESP8266 to build a computer. Cool project!
“[uli] was disheartened by how bloated even a “Hello world” program was and ripped it out, discovering that hidden beneath was a very powerful and disproportionately inexpensive general purpose microcontroller.”
I infer from this sentence that “Hello world” was in the firmware. In reviewing the datasheet to erase “Hello World,” uli discovered the micro? Was that your intent. If not it appears to be two different sentences smashed together.
It sounds like a somewhat mumbled rewrite of a line in the original history writeup here: https://basicengine.org/history.html
Worth a read.
The ESP8266 (and ESP32 from what I’ve seen) dev environment includes everything that ‘might’ be needed. So even for a simple “hello world”, you get the whole networking stack etc in your binary. Which means it takes ages to compile, and ages to download, and (seemingly) you also need to call a bunch of functions from your simple code just to keep the networking stack (which you don’t care about…) happy. And regardless, it’s still sitting there chewing up processor time.
There is absolutely nothing wrong with basic. Compiled quality source is just as fast as any other compiled code. There is, however, no shortage of bad coders and bad implementations. I have seen as much junk java code as I have basic. I actively program both.
Amen to this ^^^ !
I write code mostly in C++, but occasionally write simple BASIC programs to solve equations (especially when doing analog designs and don’t feel like booting up my PC to run simulations).
But then again, I’m something of an old-timer (58 years young), and I remember using assembly language and a look-up table of op-codes, and then hard-coding microcontrollers one byte at a time; BASIC was/is a massive improvement, and still has its place. Now if I can only remember where I put my slide-rule!
I still love assembly code.
And i’m just 55 years young.
Congrats to [uli] for this very well documented project and its well told and informative story. And for once, provided links to the required components suppliers can give an idea of the REAL amount of money needed to build the board, which is infinitely more honest than the much systematic misleading clickbait’s approach like “$2 this” or “$4 that” :(
That said, while we could do without, the project story still focus a lot about its (presumably) low-cost, Sure, if you’re an electronic hobbyists already equipped for SMD soldering, you’d need around $100 of components and PCBs from China to make 10 boards with connectors, which is competitive with the $15 RPi Zero (not the bullshit price) and the likes, for a non-commercial-DIY small batch.
But for a single unit, the quantity-orders needed, while very cheap per parts, would easily be $30 + 14€ at the very minimum to get just one VS23S010 delivered (the “RAMDAC” specialized IC that brings the video capability), so the words “he wanted extreme low cost so a relatively beefy board like a Raspberry Pi didn’t fit the bill” from the Hackaday article (since the project’s author never made such an assertion) just don’t seem to fit the bill for the “people too poor to get a Raspberry Pi” you probably had in mind either… but otherwise, thanks for this report.
$15 Raspberry pi zero? I am lucky and can get it for that price (plus sales tax) at Microcenter. How do you get to $15 dollars? Is it that bad? I am legitimately curious.
I don’t know, that was the minimum price with sipping I could find last year (imported from UK, I’m in Europe), it’s more about the fact that it is limited to one unit per order, so you can’t get several and save on shipping price, Usually you have to pay 5 times the shipping if you want 5.
Though you can still purchase something else with it, like accessories, that’s the incentive for the sellers in a marketing strategy of the Raspberry Foundation to keep this highly symbolic price entry,I suppose.
I just checked and the price is better now, starting from $5 for the version 1, then your mileage may vary with taxes, import and delivery fees… This site could help you track the availability and offers : http://www.thepilocator.com
Anyone is going to build few? I want 2 of them…
It makes my heart sing to see people using the ESP8266 for just the processor. What a nice, cheap little 32 bit RISC processor. It can kick some butt, but few people realize the possibilities. Nicely enough, this person did!
Same here, curently working on a similar esp8266 thing, I could totally benefit of the I/O and RAM galore of its successor, but I like that chip and its story, it’s a classic now, and actually, I realized that trying to do a lot with less is more challenging and stimulating to me.
Constraints are generally good for creativity and sometimes can push you to think “out of the box” and even escape the ESP32 hype, for a change :)
This is so awesome! I really have been underestimating the power of the humble ESP8266. Makes it even funnier when I see people pairing them with arduinos now.
A network stack that doesn’t take 250kB would certainly be welcome. Where else would they hide the botnet, though…
Does anyone have any interest in splitting the shipping cost (to the US) to order some VS23S010D-L chips from VLSI? This does seem to be the biggest (cost) hurdle in building the BASIC Engine. The shipping cost seems to be about $40, regardless of how many chips you order from them. If interested, email me at dvanaria@gmail.com
Where are you? I have some here. (Australia).
I’m in Denver, Colorado.
OK, I went looking for them.
I have 7 chips marked VS23S010D and not “VS23S010D-L” as you refer to. I can’t find any package marking specification for these chips. I am left to assume that the “-L” is an order code for “tray” and “-S” is an order code for “tube” rather than being an actual package marking.
I can spare two or three.
They are LQFP-48 @ 0.4mm.
Postage from here is AUD$3 for a letter and AUD$17 for a parcel with 6 working day transit.
The chips probably wont make it there by themselves in an envelope.
I have breakouts that are about an inch square that I can put them on for protection –
https://images-na.ssl-images-amazon.com/images/I/71OCMuiK4%2BL._SL1000_.jpg
That would be awesome, thanks very much. I’ll PM you my shipping details and how to make a payment to you.
Could you email me at dvanaria@gmail.com