Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
Any Arduino enthusiasts out there?

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 Smile

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 know of 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?
Welcome to Cemetech!

I used an ATmega644P as an I/O controller in a Z80 computer, so if there's some code I could provide you I'd be glad to do so. I used a dsPIC33 for video output (graphical LCD, PAL TV or VGA monitor), but if you want to stick to an AVR I also have a tvText library for outputting text on a PAL TV.

The PS/2 keyboard protocol (same as the AT protocol) is pretty straightforwards to implement yourself - see this website for example.

When you talk about memory, do you mean storage or scratch RAM? SD cards provide huge amounts of storage at a very low cost and can be accessed over SPI, which is very easy on an AVR (I have code for that too if you're interested). You can also get inexpensive RAM ICs that can be accessed over SPI or I²C if you're looking for additional RAM.

For a completed project similar to what you're after, Jörg Wolfram's AVR computer may be of interest.

(Unfortunately, I haven't been able to document my project properly yet so have not formally released any code, but would be more than happy to provide you with specific pieces of code if you ask).

Which dialect of BASIC did you have in mind?
benryves wrote:
Welcome to Cemetech!


Thanks!

benryves wrote:

I used an ATmega644P as an I/O controller in a Z80 computer, so if there's some code I could provide you I'd be glad to do so. I used a dsPIC33 for video output (graphical LCD, PAL TV or VGA monitor), but if you want to stick to an AVR I also have a tvText library for outputting text on a PAL TV.


Oh, so you did a similar project, but instead of using an Arduino base, you used a Z80 processor?


benryves wrote:

The PS/2 keyboard protocol (same as the AT protocol) is pretty straightforwards to implement yourself - see this website for example.


Looks very interesting. How might I modify or purchase a new component to work with an Arduino?

benryves wrote:

For a completed project similar to what you're after, Jörg Wolfram's AVR computer may be of interest.


Did you make that? That looks cool, I'll have to check that out soon.

benryves wrote:

Which dialect of BASIC did you have in mind?


I was thinking I would write my own version, making it as fast and powerful as possible, because I'm currently unsatisfied with any version I've come across, any suggestions?
No, he made a z80 processor out of discrete chips; he just used the ATmega for interfacing. Check out his writeup that he linked for the full details. For PS/2 <-> Arduino, you basically just need +5V (which you need for the Atmega anyway), ground, and two bidirectional data lines. The Arduino has data lines to spare, so you don't really need any extra components besides a 6-pin mini-DIN socket, aka a PS/2 socket. Regarding a BASIC variant, I'd personally feel you're best off starting with something simple and existing, then you can always tweak and expand it once you're happy that it works properly. Don't forget that you have limited program space to start with, and that input and output code are going to be taking a significant chunk of that.
KermMartian wrote:
No, he made a z80 processor out of discrete chips

I made a Z80 processor out of a Z80 processor. Wink

buttsfredkin wrote:
Oh, so you did a similar project, but instead of using an Arduino base, you used a Z80 processor?

I used an AVR to give a Z80 access to input and output devices (keyboard input, video output, SD card for storage). As such I may be able to lend a hand with those bits, but the main computer software runs on the Z80 in my case. My aim was to build a general-purpose computer supporting native development, which tends to require that you can load custom programs into RAM to execute them - something not practically possible on an AVR. (Admittedly you could write a bootloader that programmed the program to run into Flash, but limited write cycles would seem to make this not a very wise idea).

Quote:
How might I modify or purchase a new component to work with an Arduino?

All you'd need is a PS/2 connector (6-pin mini-DIN) that you could connect to your digital I/O pins. This site purports to supply source code suitable for an Ardunio, though it can be rewarding to write something like this yourself as it's not too complicated. I'm a cheapskate I'm afraid so have avoided the Arduino (preferring to buy regular AVRs and programming them in plain old C) so most of my links would be to projects using regular AVRs, sorry!

Quote:
Did you make that? That looks cool, I'll have to check that out soon.

Nope, that's not my project, but it is rather cool. Smile

Quote:
I was thinking I would write my own version, making it as fast and powerful as possible, because I'm currently unsatisfied with any version I've come across, any suggestions?

I'm a big fan of BBC BASIC though that's probably a little over the top for something running on an AVR (indirection operators, direct hardware access and an inline assembler being amongst its "fast and powerful" features). Tiny BASIC would seem the most obvious starting point, and you can always build up from there. (Alternatively you could avoid BASIC entirely and go for something easier to implement yet still powerful like FORTH).
Rats, apparently I don't remember your projects as well as I thought I did. Sad Thanks for the correction. That's the second time in less than a week that someone has recommended FORTH as something cool to play with, and the second time ever that I've heard more than the name of FORTH.
benryves wrote:

All you'd need is a PS/2 connector (6-pin mini-DIN) that you could connect to your digital I/O pins. This site purports to supply source code suitable for an Ardunio


Great, thanks! I don't really mind not writing my own code for this type of thing.

And also thanks Kerm, for your post a couple posts ago about a PS/2 connector, although I'm probably going to go with what benryves suggested, because I'm not very good at hardware modifications, stuff like that -- unless you want to explain more in depth, like a how-to type guide?


EDIT: http://hairbrainedprojects.blogspot.com/ is a blog address for anyone who's interested.
Buttsfred, actually, Benryves and I suggested the exact same option: a PS/2 (aka 6-pin mini-DIN) connector, two data lines pulled from the Arduino to the socket, and +5V and GND.
oh, oops. My bad.
buttsfredkin wrote:
oh, oops. My bad.
No problem. Does the solution make sense, though? Do you understand what you'll need to do, or should we elaborate further?
TBH, not really. I'm not much of a hardware guy. I thought what benryves linked me to was some kind of adapter. Could you elaborate further, possibly with screenshots or pictures?
This site provides additional information on how to connect the keyboard to your Arduino and sample code. Does that help?

You'll need to find a suitable connector to connect the keyboard to the Arduino (unless you cut the plug off the end of the cable, which I would not personally recommend doing). PS/2 keyboards use a standard type of connector called a 6-pin/way mini-DIN connector. These are widely available - do you have a soldering iron?
Yeah, I can solder. Thanks for all the info. I'll post more if I have more questions.
buttsfredkin wrote:
Yeah, I can solder. Thanks for all the info. I'll post more if I have more questions.
Please do, either on the hardware or software side. Smile Also, these two Hackaday projects just posted might be relevant in some way:

http://hackaday.com/2011/09/23/interfacing-with-a-ps2-keyboard
http://hackaday.com/2011/09/24/interfacing-with-a-ps2-mouse
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement