|
Post by kaos116 on Apr 22, 2008 16:55:51 GMT -5
Hello everyone, This is a little project I started on a few months ago. It's the Kaos 6502 computer... This project started out as a want to learn more about PIC microcontrollers. All of the interconnecting of the periphrials is internal and I wanted a better understanding of how all this connected and interacted. I had thought about going down the FPGA road, but I am a retro fan, so I went with the 6502 instead. The computer as it is designed now has 48k Ram 8-512 blocks for I/O and 12k of ROM. The ROM chip is missing in the picture because I wanted to use a ZIF socket for updating the ROM while I tried to get it 100% right. Well, the board layout was for a regular .6 wide 28 pin socket. There wasn't enough physical space for the ZIF. And as luck would have it, I am out of regular sockets. The Headers on either side are complete breakouts of the 6502 and I/O !CS lines. This board is useless as it stands, there is no I/O to get information in or out of it. The Headers are meant to be stackthrough connectors (used in PC104 boards). This would allow stacking addon boards as they are developed. I have a main I/O board designed that will allow a keyboard connection (PS2) and has NTSC 40x24 Video out. And as luck would have it, when I went to order the stackthrough connectors from Mouser, they are backordered for a couple more weeks. For the ROM chip, I am hoping to get a version of EHBASIC running. Which is why I have left 12K space. From what I have read you need atleast 10K of rom space for it. The circuit board was designed on ExpressPCB software and manufactured by them. Ordered on a Tuesday night, received them Friday afternoon. Three boards ~$60. This being the first attempt at such a project and the waiting for the connectors I have been playing around with putting the keyboard and video circuits on the same board. I have it down to the size of 3.5 floppy, but I am thinking of having expansion slots instead of the stackthrough connections so it's about 3.5x5". Anything specific you would like to know, please ask!
|
|
|
Post by David Murray on Apr 24, 2008 9:32:55 GMT -5
Wow.. this is really cool. I looked into building something like this a few years ago but eventually gave up. I think something like this would be great if it were as easy to program as a Commodore 8-bit. (both in BASIC and ML) Unfortunately, for that you'd need a BASIC interpreter and some form of loading/saving to non-volatile media. That makes it a bit more complex.
I've always wondered how hard it might be to get the Vic-20's Kernel and BASIC v.20 up and running on another 6502 computer. Then you might be able to get IEC disk drives to work and a variety of software to run. BASIC programs that didn't do any PEEKs and POKEs would run as-is. Other software could be modified.
What kind of video circuit are you using, BTW?
|
|
|
Post by kaos116 on Apr 24, 2008 10:45:23 GMT -5
The video circuit is text only at the moment. It's using a dsPIC30F3012 to create a black and white 40x24 NTSC screen. It uses a 9600 8n1 TTL level rs-232 input. It's based on the standard ASCII chart for upper/lower case letters, numbers and other normal characters. I also added some simple graphic characters that would allow creating boxes. There are hearts, diamonds, spades and club characters. All this uses just the lower 128 spaces. There is another 128 spaces for any character you can fit in an 8x9 pixel block.
The display will place the next character it receives through the rs232 into the next spot. I have implemented the CR, LF and back spaces to work as you would think. There is also a special character that will clear the screen and the 'esc' will put the invisible cursor back to the top right position.
The chip I have programmed now does a screen scroll. When you get to spot 40 on line 24 the next character will scroll the whole text screen up one line. Just as most retros do. Because the chip is doing a bunch of data moving it loses video sync for 1/30 second. Not enough to be overly annoying, just slightly annoying. That is why I like the second version which will place the invisible cursor back at spot 1,1. It looks more stable, but the scroll version is what I am using for this project,.
The video ram is on the chip, so you just need to feed it the characer and it will hold it on the chip. This is the major limitation of the video circuit at the moment. I was thinking of implementing some sort of simple drawing routines, but with the limited ram on the chip, I think I was only able to get 100x80 low res graphics. Microchip is releasing a line of dsPICS that have 16k ram on the chip. With this I should be able to squeeze in a 320x240 graphic screen, but still only black and white.
This was one of the reasons I originally went with the stackable design. If I created a better video display I could remove the video board from the stack and add the better/upgraded version. I have been looking into one of the video chips from the retros (mc6847). This chip would allow color and graphics and all the stuff we love, but at the cost of using ram space for video ram. There has been a thought of using the wasted RAM as video RAM. The board is using 2 32kSRAM chips but only using 48K of the 64k available. I am thinking there has to be a way of accessing the wasted 16k for VRAM.
The video is the weak spot in the system. The fact it is only text and B/W, It could not emulate any system that has 'real' graphics or color..... YET... ;D
The stackable design allows for as many addon boards as you have !cs lines to access them. Currently that's 8. I do have an address decoder circuit that will give 16-256 block I/O's in the same 4K I/O block as the original design. The one chip that would be replaced is one of the 74LS128, but the chip replacing it is much larger in physical size and I couldn't get it to fit on the board in the picture.
There is an SD card board in the design stage. I find the SD cards much easier to interface to a PICmicro than the CF cards. Fewer tracks to run on the circuit board too. I would like it to be readable and writable on a PC. This way you can write and assemble a program on a PC and just load the HEX file in a .txt format onto the card and the Kaos 6502 would be able to execute it. I would also like to be able to get BASIC programs to be stored in a .txt file. This way it can be viewed/changed/e-mailed... whatever, on a PC.
It's been a very fun project. I've learned so much and I now have a great appreciation for all the technology that is stuffed into any microcontroller.
Todd
|
|
|
Post by David Murray on Apr 24, 2008 14:21:05 GMT -5
Yes.. I really like the idea of the SD card. That would really simplify the ability to cross-compile from the PC and test the code very quickly.
I like the concept as a microcontroller alternative. So in that case, the text output would actually be fine. One of the things I've mentioned around here before that I don't like about current microcontrollers is that they are much more difficult to write and test programs than old 8-bit microcomputers. I like the idea of being able to whip up a small BASIC program in minutes to test if a certain input our output is working. Then code the final product in ML. Of course a microcontroller is smaller and more power efficient.
As for a replacement for retro-computers. I think you'd need to get a little better video display, but not too much better. We don't need 1280x1024 resolution with millions of colors. A 320x240 resolution with 16 colors would be good. Maybe a high-res mode for 80-column text. Yet, even these aren't necessary. Just look at the VIC-20. It was successful and its video is pathetic.
Your particular computer is poised to be better than a Vic-20 if it has decent video, since it would have a lot more RAM and obviously better storage capacity. I would venture to say the RAM would be more organized than a C64, which would also be great for programmers.
If you could get all of that into a single board, with PS/2 keyboard input, and video output, then this would be a really good little system.
|
|
|
Post by kaos116 on Apr 26, 2008 21:41:54 GMT -5
The memory map is pretty simple.
0x0000 - 0xBFFF 48K Ram
0xC000 - 0xC1FF I/O #1 0xC200 - 0xC3FF I/O #2 0xC400 - 0xC5FF I/O #3 0xC600 - 0xC7FF I/O #4 0xC800 - 0xC9FF I/O #5 0xCA00 - 0xCBFF I/O #6 0xCC00 - 0xCDFF I/O #7 0XCE00 - 0xCFFF I/O #8
0xD000 - 0xFFFF ROM
The keyboard and video are presently using I/O#1
I have been thinking about the video circuit and with how limited it is at the moment. I am going to try and work on that before I go with an all in one circuit board. I'm going to keep working with my stackable design for the moment. It's much quicker for circuit changes. I'll revisit the all in one board once I have a 'good' working sytem.
|
|
|
Post by David Murray on Apr 27, 2008 21:32:41 GMT -5
I have been thinking about the video circuit and with how limited it is at the moment. I am going to try and work on that before I go with an all in one circuit board. Well, if you wanted to make it versatile, you could always allow various types of video and use a common vector for the video write routine (such as charout) and have a possibility of several types of video display. Here are some ideas. 1) A simple CPU driven black & white display similar to the timex-sinclair 1000. That way you'd only need one I/O pin to drive the display and really wouldn't need any extra chips or boards. 2) A video chip of some kind (not sure what is currently available) 3) another microcontroller which would be a slave video system 4) an LCD module 5) A video circuit designed for use with microcontrollers with a VGA output (I've seen these before, but can't think of a specific name of one right now) 6) an RS232 output for use with a serial terminal. Anyway.. if you were dealing primarily with BASIC or some other text console, this would be easy to accomplish and allow different people to use different video methods. Obviously, if you wanted graphics modes and everybody's system to be compatible with each other, you'd need to standardize on something.
|
|
|
Post by iamdenteddisk on May 5, 2008 14:48:48 GMT -5
I played with this kind of thing a bit ,I was useing the BS2 board of education ,the project started out as a simple robot but soon after adding a few this&thats motion sensors and things I got to the point where the main board just didnt have the ramspace to do the complex things I required this is what turned me back to the commodore64 ,"the new dtv chip possibility's bell rang",I could not find the asm support I needed or the hardware modability to do what i wanted with the stamp though I did find some bit of success with the addition of a sansdisk flash drive 20$ at wallmart- it added 2gig's of basic space ,now if I can do the same with something like you got "simi-developed" here ,I might just be in business, have you blogged your finding's? ifso can I peek? im into moding hrdware recreating roms currently working on ai,anitomitons,microcontrolers,muscle wire, in jist I would love to see more on this as it might help eliminate some prototypeing for me and I might just be able to help you out too, iamdenteddisk@yahoo.com
|
|
|
Post by iamdenteddisk on May 5, 2008 15:28:33 GMT -5
An idea on the video, though im sure you would prefer the vga output suggested above, the faux color used in an old ti86 modification listed on ticalc.org as ticolor or tici color I think. The mod used the oem b/w LCD in an inverse mode meaning to color black all but the sprite and the mod also used a mirror placed behind the lcd and color LED's and a simple asm routine was implimented along with instructions on installation but the ti86 had inboard support for greyscale graphics wich was part of the implementation useing the known pin/on for each shade to power the chosen color LED wich was reflected by the mirror through the unshaded sprite this mod was quiet cool and made the b/w calculator apear to have as good of graphix capabilitys as a "PSP or Game boy advane color" ,ofcorse framerate is important as we see in 13-30 frames per second coherently any faster the picture is seamless,any slower it becomes flickery if it is distinguishable at all. good luck! oh my question have you planned its application ? if its a micricontroler you probably want onboard video of some sort , if its a stand alone vga will do.
|
|
|
Post by kaos116 on May 8, 2008 10:56:54 GMT -5
I don't have a blog of it's status. I should put something together on here. The project has been put on hold untill I received the stackthrough connectors from Mouser. They should be here by the weekend.
As for the video, Microchip has released chips in DIP packages that have 8K of ram. I am going to try getting monochrome graphics at a resolution of 280x192. I also had a thought of using a propeller chip just for video. They have both an NTSC and VGA output. But for the moment I am going to continue with just the text version. An LCD would make a compact design.
This is where the stackable design is going to come in handy. As the video portion evolves, I can just keep swapping out the video layer.
I'll keep you posted on the progress!
|
|
|
Post by kaos116 on Feb 26, 2011 21:28:16 GMT -5
Time for a thread resurection! ;D Life got busy the past three years. Job promotion, moved and built a house. I got my workshop back together and made a little progress on the Kaos 6502 Computer. Basically I got it up and running. Because I am not a professional engineer there were a couple mistakes on the board. 3 to be exact. 1. If you look at the picture you will notice the oscillator seems to be missing. Some how I mirrored it when I drew it up. So for the pinout to be correct it had to be mounted on the bottom of the board. 2. The /OE lines for the RAM were floating. I didn't connect them to ground. Easy fix as the bottom has a ground plane. I just bent the pin over and soldered it to it. 3. I/O - 8 is not wired to the correct /CS pin out of the second 74LS138. I didn't fix this as I still have 7 other I/Os to play with. Here is a picture from my logic analyzer showing the A0-A7 lines. I have the ROM program the jmp commands in the two RAM chips. The first RAM chip (which is the 00-02) jumps to the second RAM chip (03-05) and that jumps to the ROM chip which starts the cycle all over again. F300 LDX #$4C A2 4C F302 STX $3000 8E 00 30 F305 LDX #$00 A2 00 F307 STX $3001 8E 01 30 F30A LDX #$90 A2 90 F30C STX $3002 8E 02 30
F30F LDX #$4C A2 4C F311 STX $9003 8E 03 90 F314 LDX #$1E A2 1E F316 STX $9004 8E 04 90 F319 LDX #$F3 A2 F3 F31B STX $9005 8E 05 90
F31E JMP $3000 4C 00 30
I am going to work on the I/O next to be able to get data in and out of it with out having to pull the EEPROM everytime and reprogram it. Sorry for the delay in an update. Hopefully the next one isn't in three years!
|
|