Hey, I've been thinking about this and the more I think about it, the more I think I can actually do this. My idea is basically this: Make a functional computer out of an Arduino Uno microcontroller.
My only goal for this computer is the ability to edit and execute BASIC programs. That's all. I only want it for the programming, as that's just about the only thing I'm interested in right now
So the way I see it, I'll need three main hardware components: 1) some form of a display (VGA screen or something), 2) some way to register keyboard input, and 3) some way to store data to external memory. Does anyone know of any way to do this? I kind of know of some ways to display to a screen, but I don't know a good API/hardware component to register keyboard input or to store external memory.
I'm going to need a lot of help on this. Can anyone help me out and offer ideas and useful tips and suggestions for good hardware / a good open source library, or two, or three, or ten?
Basically what I want is the ability to program without having to write code on a computer first, compile it, and then send it to the Arduino Uno. What I want is the ability to type in programs in my room, where's there's no "real" computer. Pretty much I want to build my own computer based on the Arduino Uno but being able to program directly onto the Arduino. Does that make sense?
Also, I didn't necessarily mean a direct port of BASIC. I would write my own version, and make it as powerful and as fast as possible.
you could probably make something where you could write code and store it on to some extranal mem but do you want the arduino to serve as a compiler? because that i am assuming would be difficult
For displays, use a character display or dot matrix display. I've designed a serial LCD keypad panel. You can directly serial.print on it and it understands \n and \t plus a lot more. It runs multi-tap so needs no external keyboard Would be nice terminal for a basic computer.
The Bitlash interpreter has been used in such standalone computer projects. See http://bitlash.net for downloads and doc. PS-2 in and TellyMate out and you're basically done.
I cut my teeth on BASIC at Dartmouth back in the day. While Bitlash is not BASIC, it is a simple language that is intended to be a stepping stone to procedural C/C++ as supported by the IDE.
2K of RAM is too few for BASIC. Typical 8-bit BASIC-computer of 80's was a 16K ROM + 16-48K RAM machine. We are waiting for Arduino Due =)
Even maybe some floppy drive =)))
Thanks to everyone here except for KE7GKP. Come on KE7GKP, if you don't have anything nice to say, you shouldn't say anything at all. And no offense KE7GKP, but your post was pretty much useless. I also don't really like how much you're discouraging programming and hardware projects, what's up with that?
Anyways, billroy, thanks for your info, it was really good. Bitlash looks like something I'm probably going to use and I think I might take your other suggestions as well, after some investigation.
2K of RAM is too few for BASIC. Typical 8-bit BASIC-computer of 80's was a 16K ROM + 16-48K RAM machine. We are waiting for Arduino Due =)
Even maybe some floppy drive =)))
My opinion is : Yes it is possible to "make" a BASIC computer using the Ardiuino. You can program the Arduino ( it contain max 32 K for your BASIC operating software program ) , use RAM chips like 4114 or 6116 <-- use PORT to access (needs a few of those RAMS chips ) to put the BASIC program in , use assemby and C++ in your BASIC operating program , maybe use the TellyMate for display or a LCD display like a TI-74 ( a BASIC / Calculator ), use a PC keyboard ( using soft serial ), and maybe use a SD card to save your BASIC files or your own tape drive using a cassette player ( may need external electronics ) and use soft serial to save/load the files. Again , it is possible. But a lot of work and it not going to be easy, a challenging project ? YES
Using a floppy drive ( 3 1/2 ) with an arduino.. That is an interesting project... I need to learn the pinout of a typical IDE floppy drive and use PORT to save/load the data. ... Possible
Bar this project being an exercise in itself I would set a definition of what you mean by "functional". Start with what you want the finished project to be capable of. The chip at the heart of the Arduino is designed as a simple micro-controller it isn't a particularly fast chip but usually with the remotely compiled code its fast enough for the types of physical computing it was designed for.
A general purpose computer of the type you describe may be possible (Not sure about a Hard Drive as FAT I understand isn't the simplest of things to implement) but with an interpreter and HUI running it's going to be a case of what you could realistically do with it when it's finished. Will you be happy just flashing LEDS? When using the Arduino in it's intended place people still resort to external computers for heavy processing/number crunching using Processing or something similar.
Now I'm not being negative but when you are designing a project you should start by defining the objectives. That way you can make the right choices along the way and not be disappointed with the result.
I would first break down the project into reasonable tasks. This reduces complexity and the chance of getting disheartened on progress.
interface with a display (LCD, GLCD, VGA)
interface with a keyboard
have the text output on the display when you type
interface with a variety of storage devices (EEPROM, Flash etc)
research interpreters (specifically any targeting embedded devices or older systems) - don't get hung up on BASIC tho' there are some very good other languages that are easier to interpret and more dense. Do this off the Arduino first as the tools will be far better for debugging. Start with a limited subset of the language.
bring the parts together one by one.
You'll find Arduino tutorials in the Playground and elsewhere for a lot of these bar 5.
If I were looking at doing this then I'd be looking at something like the Fez Panda 2 board. http://proto-pic.co.uk/fez-panda-2-net-framework-compatible-board/. This is much more powerful and has libraries for FAT, USB etc. It's pin compatible with most Arduino shields. However it is a slightly more complex system and if you are a beginner to micro-electronics then I'd still suggest doing some simpler yet rewarding projects with the Arduino first.
"YES! YES! YES!" =)
I think you guys didn't try to measure these little bytes of mega328's RAM. A line of BASIC program is the reference:
< line no (1 byte) >< line address (2 bytes) >
and the byte-code:
< operator (1 byte) >< operand (many bytes) >
Also it requires RAM for user variables. I don't try to say that's impossible to make BASIC interpretator for Uno but it doesn't became a useful thing. =)