VGA to Prop Chip???
gamemaker90
Posts: 19
Hi,
OK, so what I am trying to do is build a video game console from scratch. For the most part I will be a lot like a PC and an NES had a baby in the respect that I want it to have a simple OS (that I write), controllers (that I make), and a way of displaying this information to either my bubble screen (I know it sounds crazy, but...) or computer monitor, as well as a cartridge loading mechanism. My problem however is not the aforementioned controller, cartridge loader or OS, instead I need to know if anybody knows of a safe place to get:
1. An SD card reader with one row of pins and doesn't require SMT components
2. A VGA adapter or a way to connect RCA to this thing.
The catch is, I've seen what the parallax store has and while I trust them and have more parallax components than I know what to do with, I don't feel like buying in bulk or paying ridiculous prices for shipping (plus I hate waiting). Is it A. possible to do a direct connection from the propeller chip to a VGA cable right into my monitor, B. possible to hard wire an RCA jack to the chip. If not does anybody know where I can get a compatible VGA or RCA adapter not on here? Would it just be easier to get an LCD and hook it up? The problem there is that I need the resolution to be at least between 800x600 and 1280x720. As far as other components I've got that covered.
Also about the SD card. I understand the pin out of SD cards rather well. I don't however know if there is a way to hard wire those either. If I can I could probably just use the one off my Seeedstudio SD card adapter for Arduino (since I don't use that old thing anymore). Someone please let me know and thanks.
OK, so what I am trying to do is build a video game console from scratch. For the most part I will be a lot like a PC and an NES had a baby in the respect that I want it to have a simple OS (that I write), controllers (that I make), and a way of displaying this information to either my bubble screen (I know it sounds crazy, but...) or computer monitor, as well as a cartridge loading mechanism. My problem however is not the aforementioned controller, cartridge loader or OS, instead I need to know if anybody knows of a safe place to get:
1. An SD card reader with one row of pins and doesn't require SMT components
2. A VGA adapter or a way to connect RCA to this thing.
The catch is, I've seen what the parallax store has and while I trust them and have more parallax components than I know what to do with, I don't feel like buying in bulk or paying ridiculous prices for shipping (plus I hate waiting). Is it A. possible to do a direct connection from the propeller chip to a VGA cable right into my monitor, B. possible to hard wire an RCA jack to the chip. If not does anybody know where I can get a compatible VGA or RCA adapter not on here? Would it just be easier to get an LCD and hook it up? The problem there is that I need the resolution to be at least between 800x600 and 1280x720. As far as other components I've got that covered.
Also about the SD card. I understand the pin out of SD cards rather well. I don't however know if there is a way to hard wire those either. If I can I could probably just use the one off my Seeedstudio SD card adapter for Arduino (since I don't use that old thing anymore). Someone please let me know and thanks.
Comments
Impatient? Oh, I see, you did say "I hate waiting". Even if everyone was in the same time zone it doesn't mean that we are all in front of the PC checking the forum and even if we were we might not even consider answering this and leave it to someone else who might like to reply.
I solder smd SD card sockets directly onto matrix board with just a normal iron and tip, nothing special. The Prop only has 32k RAM for both program and data including display data. In terms of graphics you could do mono graphics of say 512x384 on a 1024 by 768 timing which takes up 24.5k alone although you could use color tiles to set regions to different colors but don't expect even 256 color VGA as the Prop is not designed to do that. As for a VGA cable I would just put a 6 to 8 pin header on my PCB with the VGA signals and cut a VGA cable and wire a crimp-pin header plug onto that end of it. VGA only needs R,G,B, Vsyn, Hsyn, and ground(s).
Doesn't look like it's available any longer though.
Andre sold his last 4 in May:
http://forums.parallax.com/discussion/164193/the-last-hydra-blowout-sale-10-year-anniversary/p1
I was able to grab one.
There are two available on ebay right now:
http://www.ebay.com/itm/Parallax-Propeller-Hydra-Kit-Game-Microcontroller-programming-kit-/192016329839?hash=item2cb510ac6f:g:cnEAAOSwo4pYD~fh
http://www.ebay.com/itm/Parallax-HYDRA-Nintendo-NES-Video-Game-Dev-Kit-/322318549598?hash=item4b0baec25e:g:N7wAAOSwzaJX5GKk
My P8X Game System uses a VGA connector to do VGA and PAL/NTSC RGB video, all schematics, connections and source code is available here:
https://dev.maccasoft.com/propgame/
You can find a collection of drivers here:
https://github.com/konimaru/waitvid.2048
There is an 800x600 dual-cog driver, I don't know if it works as you need. Spin only, these drivers must be written in PASM for speed, interfacing with C is really easy.
If you want to build your own game console, remember also that you have to manage the graphics, the more high resolution you have, the more computing power and data space is needed to update it, these things may severely limit the complexity of the games you may create.
At the very least you have to add the resistors to the Propeller pins.
See the attached schematic for the Demo Board. It has VGA outputs and Composite (RCA).
OK, onto the next dilemma. So for the game card, I wanted to use a rom (not an eeprom, just a rom, flash rom, or prom of some kind). The problem here is that I can't find anything good. I've searched google for a couple of days now (with breaks of course) to no avail. Ideally I would like it to resemble something to that of a sega genesis cartridge, nes cartridge, or gba in the respect that I want a "mask rom" like chip for the game, one or two eeproms for the save data (or the onboard SD card).
Stand alone ROM chips (aka OTPROM) are probably not available or extremely hard to find these days. ROM was read only memory that was pre-programmed during the chip manufacturing, and OTPROM is one time programmable memory that is programmed by blowing fuses on the chip. It is an old technology that has been replaced by including it as part of a chip or as external eeprom or flash memory.
#include "example.spin"
that doesn't seem right as c only uses C header files.
Edit:
OK, has anybody ordered off parallax's website before?? I'm getting very frustrated with all of this and I am about ready to flip. About this vga plug: https://www.parallax.com/product/28076? Worth it? How long do they take to ship, what are the shipping costs?
Dispatch is fast, like sameday or next day (depending what time you order
Shipping cost will vary with weight. You can drop items in your basket and check the shipping cost online before needing to click the final commit button.
The driver I was referring to is under scanline/800x600, the demo program waitvid.800x600.demo.spin can be compiled and run on a propeller board with a VGA connected to pins 16-23 (if I'm not wrong) using the schematic given above by Publison.
You can't use it as is from a C program, you need to convert the source. There are various ways to do that, the simplest is to use spin2cpp that convert the whole spin demo program to a C++ source that can then be imported into SimpleIDE. Another way is to extract the PASM driver, put it in a .s assembler source and add the correct prefixes/definitions, and manually rewrite the spin source in C. Examples of the latter are in my source code where you can see the .s assembler files correctly formatted.
However before going into the details of all this, given your skills, my suggestion is to start learn how to program the Propeller with something more simple, your project is ambitious and complicated, without a good base knowlege of how the Propeller works, everything will look more difficult than it really is.
You don't have to have that part to do VGA. I've done VGA with PIC microcontrollers that were many times less powerful than the Propeller. I've even seen the ATtiny85 generate very good VGA with just a cable and some resistors.
That's what I did years ago. I bought a VGA d-sub connector and wired a few resistors to it to create an R-2R ladder. You don't need resistors on the sync pins. You just need to keep the voltages around 0-0.7v for RGB IIRC.
Anyway, if you're in that kind of hurry you're going to set yourself up for failure. I see VGA cables at the Goodwill all the time for a few bucks. Like someone else said, you could get one of those and cut it. Put a few resistors on it and use that.
There are lots of sites online that will tell you what values to use. But basically, you want to keep each R/G/B value within 0 to 0.7 volts. One such site is here: http://retroramblings.net/?p=190
Writing VGA drivers can be hard. Unless you're running a microcontroller 200+ MHz, you're not going to get good resolution without using assembly. That's not the Propeller's fault. That's just simple math. It takes X number of clock cycles for *any* CPU to perform functions. There are only so many cycles in the bandwidth of VGA. So assembly gives you the most bang for your buck.
Plus, out of the dozens of CPU's I've programmed in assembly, the Propeller is one of the easiest ones. Reminds me of programming a Z80 or maybe a 6502.
You have to remember that you can get VGA graphics from 555 timers. It won't be high-res for sure...but it can be done. It's all about compromise.
Anyway, my advise is to be patient and start a little smaller. Believe me, I know how you feel. I have really lofty goals too. But I've learned to back them down and finish smaller projects using pieces from other people (shoulders of giants thing)....then re-iterate and re-iterate again until it becomes mine.
I know you didn't ask for a long-winded opinion...but I thought I would chime in and, hopefully, help you out somehow.
Can the Propeller do what you want? Yes, but probably not as well or as easily as you would like. Yes, the Propeller can generate a 800x600 VGA signal, but only 64 colors. And the graphics driver is almost pure software, which you would have to either adapt or write yourself. (Nor is there enough RAM for a normal bitmap display.)
The same goes for any other hardware (i.e. controllers, SD card, audio) - you would either need to use code someone else has written (e.g. SD card), adapt (audio) or write yourself (controllers, OS, games).
The Propeller is a cool microcontroller, which many people have used to accomplish interesting things. However, there is a significant learning curve. And while the community can provide some assistance, you will need to learn a lot by yourself.
Also, I'd suggest reading about video game hardware and some emulation. Building an entire console from scratch is a daunting progress as you may have to write the game too. On the other hand, writing an emulator helps in understanding the architecture of the respective console, and at least you can have some sample game ROMs (please make sure to get the open source ones) to test your hardware/code with.
I've ported an NES emulator code somewhere I got from Google search (I'll check out the name once I'm back) to STM32F4 microcontroller, and will perform this stunt to another faster microcontroller. However, I have not added any sound drivers yet!
https://parallax.com/sites/default/files/downloads/32360-Hydra-Game-Dev-Manual-v1.0.1.pdf
If you are looking to learn how to create drivers for the Propeller, then perhaps the good place to begin is to modify that VGA.side code to adjust the text to fix what are looking for.
For C specific info, have a look at the Graphics examples in the Learn folder for the SimpleIDE:
https://github.com/parallaxinc/Simple-Libraries/tree/master/Propeller%20GCC%20Demos/graphics
Propeller NES Emulator
forums.parallax.com/discussion/119075
Here's where i'm at: I need VGA drivers, I want them in c or c++ only. I don't want spin. I have the vga all connected up from pins 16-23. And I absolutely need graphics and text to show on my monitor. Thanks.
Sorry for repeating, but my P8X Game System has everything you need to start. VGA is 640x480 (actual resolution is 320x240, for practical reasons). All C with PASM drivers. Take a look.
http://dev.maccasoft.com/propgame
The video drivers are in the vga (640x480 -> 320x240), svga (800x600 -> 400x300) and xga (1024x768 -> 256x192) folders and are all taken from Marko Lukat git repository I mentioned few posts above https://github.com/konimaru/waitvid.2048 with few changes needed by the project like the vsync signal line to synchronize the cpu. In addition on this site http://tinyvga.com/vga-timing you can find the timings needed for various resolutions.
The drivers supports paletted modes with 2 or 4 bits per pixels, the palette can be changed from within the editor (double click on a color cell to change the color) and 64 colors direct palette, this can't be changed because it is the palette that can be generated with the standard VGA wiring (2 bit per color = 64 colors).
Isn't a whole lot ? Well... you should compare that to the classic retro games, most of them are not capable of that much and are using hardware tricks. Anyway, that limit is just an arbitrary number I choose for the preferences page, I can set it to 64 if you want, the actual upper limit depends on the requirements and how much cog memory is left free, since the descriptors are loaded into cog ram. I don't know what game you have in mind but 32 sprites are a lot.
I believe that there is always a way to make things better, the current renderers are designed to be flexible enough to cover most of the basic requirements of a game, but nothing prevents to write a dedicated renderer with specific optimizations.