Shop OBEX P1 Docs P2 Docs Learn Events
VGA to Prop Chip??? — Parallax Forums

VGA to Prop Chip???

gamemaker90gamemaker90 Posts: 19
edited 2016-11-06 19:14 in Propeller 1
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.

Comments

  • Anybody??
  • Anybody??

    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).




  • evanhevanh Posts: 15,916
    This reminded me of the Hydra. I did a search and got some history at - http://www.avalondreams.com/hydra/index.html

    Doesn't look like it's available any longer though.
  • Yeah I've heard of the hydra but that would defeat the purpose of building my own. :P
  • Moving this thread to propeller 1 category as you might get more users checking there.
  • gamemaker90gamemaker90 Posts: 19
    edited 2016-11-07 14:00
    If I got a female vga like the one in the picture: http://www.lightcast-store.com/HD15-vga-female-to-female-adapter-p/HD15-F-F.htm?gclid=CMOY25rqltACFUNafgodaX8L5w, is it possible to do a direct connection? If so is there a C library I can use for it?? I'm not well rounded on spin and the only tutorials I've come across are for development boards. I have the chip itself and I have it in my breadboard.
  • If I got a female vga like the one in the picture: http://www.lightcast-store.com/HD15-vga-female-to-female-adapter-p/HD15-F-F.htm?gclid=CMOY25rqltACFUNafgodaX8L5w, is it possible to do a direct connection? If so is there a C library I can use for it?? I'm not well rounded on spin and the only tutorials I've come across are for development boards. I have the chip itself and I have it in my breadboard.

    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/
    The problem there is that I need the resolution to be at least between 800x600 and 1280x720

    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.
  • MikeDYurMikeDYur Posts: 2,176
    edited 2016-11-07 15:09
    Another route is the Propeller Project Board USB, plenty of room for your circuit and VGA is already allocated for any pins you choose. For less than thirty bucks it cant be beat. This is not the current design though.
    3264 x 2448 - 1M
  • PublisonPublison Posts: 12,366
    edited 2016-11-07 15:02
    If I got a female vga like the one in the picture: http://www.lightcast-store.com/HD15-vga-female-to-female-adapter-p/HD15-F-F.htm?gclid=CMOY25rqltACFUNafgodaX8L5w, is it possible to do a direct connection? If so is there a C library I can use for it?? I'm not well rounded on spin and the only tutorials I've come across are for development boards. I have the chip itself and I have it in my breadboard.

    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).


  • gamemaker90gamemaker90 Posts: 19
    edited 2016-11-07 20:17
    OK, this is what I call helpful. macca, I was browsing on these forums and came across this a short while ago, I saved the schematic to my computer for easier access later on. And Publison, it looks like that part is what i'm looking for. Now to get those resistor values. And Mike, that might actually work if all else fails, you see, I want to design this thing entirely from scratch, but I do like how that board would match the color scheme. It kinda stinks though that the vga drivers have to be written in an assembly based language, but I can understand why. I'm going to give these a try.

    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).
  • kwinnkwinn Posts: 8,697
    OK, this is what I call helpful. macca, I was browsing on these forums and came across this a short while ago, I saved the schematic to my computer for easier access later on. And Publison, it looks like that part is what i'm looking for. Now to get those resistor values. And Mike, that might actually work if all else fails, you see, I want to design this thing entirely from scratch, but I do like how that board would match the color scheme. It kinda stinks though that the vga drivers have to be written in an assembly based language, but I can understand why. I'm going to give these a try.

    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.
  • kwinnkwinn Posts: 8,697
    edited 2016-11-07 22:15
    If you really want to make cartridges that hold one or more games then you could use eeproms, flash memory, or sd cards. With the high capacity and small size of those devices the cartridges would either be very small or have a lot of empty space in them. My suggestion would be to use an sd card or a small PCB with an eeprom/flash chip on it.
  • gamemaker90gamemaker90 Posts: 19
    edited 2016-11-08 20:45
    Hey macca, which file do I use?? None of them say anything about 800x600. I'm pretty much a noob to the propeller microcontroller. Here are my skills: Assembling circuits/understanding schematics, microcontrollers (not this one though), C, C++, Java (mostly), gml (game maker language), python, computer hardware and assembly. Anyway, how do I include the spin files into simpleIDE in C? Do I just do:
    #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?
  • @gamemaker90

    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.
  • Awesome, but what about my previous question about the spin code and drivers??
  • Hey macca, which file do I use?? None of them say anything about 800x600. I'm pretty much a noob to the propeller microcontroller. Here are my skills: Assembling circuits/understanding schematics, microcontrollers (not this one though), C, C++, Java (mostly), gml (game maker language), python, computer hardware and assembly. Anyway, how do I include the spin files into simpleIDE in C? Do I just do:
    #include "example.spin"
    that doesn't seem right as c only uses C header files.

    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.
  • 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?

    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.



  • ericballericball Posts: 774
    edited 2016-11-09 14:39
    My advice is to take on one challenge at a time. You're trying to create a hardware and software platform from scratch, without the knowledge and experience to make it easy and therefore fun.

    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.
  • Well, I am the type of person who believes that if there are 3 or more good reasons not to do something, it probably is a bad idea. Doing this without messing around with the chip is said idea. I agree with you guys 100%. Once my stubborn side lays off I may take a break from trying to build a super computer with a 32 bit microcontroller. Lately I've been continuing on the game I am making anyway (which btw I am planning to port to this console, but don't worry it's 2d and doesn't have the best of graphics). I'm not calling it quits on this project, as I've spent too much money and time on it, but hopefully by some miracle I can get this all to work.
  • You said earlier that you wanted the graphics to work like the "NES level" - you do know that the NES' PPU (picture processing unit) is a very complicated graphics chip? The chip handles tiles and sprites and the Propeller has not much of horsepower to effectively/accurately emulate that. Either you need to scale down your design, or you need to get a bigger, faster microcontroller to perform that trick. STM32/PIC32 are in this level if you want to try building a primitive graphics chip.

    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! :)
  • Thanks for the reply. I meant at minimum on the NES level, I assumed that was the max capabilities because of things I've seen on youtube. Regardless of that I honestly wouldn't want to work on an 8 bit level, with a 32 bit mcu. Most of my research lately has been video game console development and the like. I would rather not port existing games to this as I mainly deal with game making primarily. That part is easy for me. This is by no means an emulator project, as I am working on some games for the PC (as I stated above are 2d), and will make the conversions from PC to to my console. Emulator code would be fine however as I always find inspiration in unlikely places. As would be expected that would be most helpful. Also, the reason I think the VGA thing wasn't working is a short between two connectors, and I only connected one gnd pin. With all my experience, I suck at soldering (really I tried out a new soldering iron I'm about to return but...).
  • Good news for anybody following this post. Three chips later I got it working. Now, since November I have been filling in the gaps of where I fell short. As such, I think I'm finally ready to commit to this project. So my (hopefully) final question is this: where can I go to get/learn drivers for this chip in C. I will most likely learn spin at some point, but for now I just want to use what I know. What I am building is a stand alone computer system/video game console and need to know how to draw images and text to the screen. Hello VGA.side is OK, but the text is too large and according to the file has no way of changing it without modifying the code.
  • The Hydra board was mentioned, although written with Spin in mind, the Book that Andre wrote for the Hydra is an excellent place to start.
    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
  • ColeyColey Posts: 1,110
    You said earlier that you wanted the graphics to work like the "NES level" - you do know that the NES' PPU (picture processing unit) is a very complicated graphics chip? The chip handles tiles and sprites and the Propeller has not much of horsepower to effectively/accurately emulate that. Either you need to scale down your design, or you need to get a bigger, faster microcontroller to perform that trick. STM32/PIC32 are in this level if you want to try building a primitive graphics chip.

    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! :)

    Propeller NES Emulator

    forums.parallax.com/discussion/119075


  • Not quite what I was looking for... I'm not making an emulator. I simply have no interest in writing this in spin (or learning it for that matter). I just want to write drivers for a vga monitor in c or c++. The libraries you left jon are for a TV, and coley, I already disregarded that one because it isn't what i'm looking for.

    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.
  • 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
  • That's alright macca, I'm reviewing the files right now. Is there one in particular you'd recommend me to start with? In short I want to learn how to write drivers for vga. Also is there a way to change thecolor pallet in propeller game tool? I don't plan to actually use it, but it peaks my curiosity. Also, does this program use the chip to it's highest level? 32 sprite max isnt a whole lot...
  • That's alright macca, I'm reviewing the files right now. Is there one in particular you'd recommend me to start with? In short I want to learn how to write drivers for vga.

    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.
    Also is there a way to change thecolor pallet in propeller game tool? I don't plan to actually use it, but it peaks my curiosity.

    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).
    Also, does this program use the chip to it's highest level? 32 sprite max isnt a whole lot...

    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.
Sign In or Register to comment.