Shop OBEX P1 Docs P2 Docs Learn Events
Newbie.... quick question — Parallax Forums

Newbie.... quick question

Steve2381Steve2381 Posts: 94
edited 2008-01-09 02:18 in Propeller 1
Hello there

I am 'upgrading' from basic2 stamps to the Propeller chip, and so I am going to grab myself a development board and goodies to learn the ropes (any recommendations for a good starter kit?)

I kept on out-programming the stamps and I am building an Ipod controller.· Seeing as Propeller chips and Ipods are both 3.3v, it seems a good starting point.

My questions are...·· What size programs can you write for a Propeller, compared to a stamp?· I was always running out of variable space on the Stamps.

From a look around on here, the video function seems quite resource hungry, but what kind of video functions can be created with the Propeller.

Sorry for the questions, but I don't really want to jump into Propellers (so to speak) and they fall short of my requirements.

Thanks for your time

Steve

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-31 20:34
    The Propeller has 32K bytes of RAM (called HUB RAM) which is shared by all 8 cogs (processors). This is where your compiled Spin program resides while running. This same memory is where all Spin variables reside as well. The Propeller does all of its arithmetic internally as 32 bit integers, so a lot of the tricks that you have to do on the Stamps to get more than 16 bit arithmetic are not necessary. This 32K is also monolithic. You don't have to divide your program up into "slots".

    Each of the 8 cogs has its own 2K bytes of RAM. Normally this is occupied by the Spin interpreter or an I/O driver like one of the video drivers or a buffered serial I/O driver or a 32 servo controller or PS/2 keyboard controller.

    So, the "bottom line" is that you can have much much bigger programs on the Propeller than on any Stamp. You can also have relatively huge amounts of memory used for variables.

    The video buffers have to reside in this 32K byte area. If you want to do graphics, you can end up using most of the HUB memory just for the graphics buffers. If you want to do text only or text with some small areas of graphics, you can get by with a smaller video buffer. For VGA text, you'd typically use a 64 x 24 character screen which would be only about 1500 bytes. The video routines would take another 2K or so depending on how fancy you want to get. TV text takes less memory since the largest decent text display is about 40 x 16 characters.

    If you want to use graphics, you'd need 2 bits per pixel. It may not seem like much, but adds up quickly. A 320 x 240 pixel graphics screen would require a minimum of 20K bytes for a bitmap. Once you add another 4K or so of code for the video and graphics drivers, you're already taking up 3/4 of the available space. You can still get quite a bit of program in the remaining 6-8K.
  • Steve2381Steve2381 Posts: 94
    edited 2008-01-01 09:05
    Thanks Mike, that clears things up a lot.
    I read several reviews of the prop chip and many complained of lack of programming space.
    My application would be purely TV text (graphics would be nice, but too resource hungry).

    Thanks for your time
  • not2sixnot2six Posts: 7
    edited 2008-01-05 16:04
    Mike:
    You mentioned mixing text and graphics to save on the memory buffer. I have been working on this tact, but I'm knee deep in trying to figure out the code. Is there an example of something that I can look at?
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-05 17:36
    There is a Hires VGA driver with curser, e.g.
    Look at all the sprite activities of some people..
    Sorry, I am too lazy (or does one say: busy?) at the moment to look for the links myself smile.gif
  • not2sixnot2six Posts: 7
    edited 2008-01-05 22:59
    Sprite graphics is ok, but if you're trying to make plots etc, its not that practical.

    Back in the day when memory was scarce, the Apple II had a graphics mode where it has a split screen: half had graphics and the other had text. Seems to me that something like this could be done with the Prop. If anyone has a good understanding of how the graphics/text display drivers work perhaps they could comment.
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-05 23:14
    Yes they certainly will. I e.g.have an extremely good understanding of how graphics/text display drivers work smile.gif
    I pointed you to the HiRes Driver with Cursor as it shows the technique how to overlay tiles and bitmap graphics....
    If you had a Propeller running I could post a test program which showed exactly that splitting of text and pixels that you mentioned for a special case...

    Post Edited (deSilva) : 1/6/2008 1:15:41 AM GMT
  • not2sixnot2six Posts: 7
    edited 2008-01-06 02:32
    I have a Prop demo board up and running. I've had it for a while now, six or eight months. I've put it off to the side several times because of the memory limitations. I keep coming back to it because other than the memory its a really super chip for my project. I don't need tons of memory, I would really like to have some graphics and that chews up sooo much of the memory resources...

    Anyway, if you could take the time to post an example of a graphics compromise, I would be eternally grateful.
  • Goran (Sweden)Goran (Sweden) Posts: 68
    edited 2008-01-06 06:59
    deSilva, I am also interested.
    If you have a simple testprogram it would be great if you could mail it to me as well.
    gb@gblom.se
    Thanks in advance.
    Goran (Sweden)
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-06 09:06
    I am not at all happy with this...
    It is one of the pieces with which I planned to form a video tutorial...
    This MPE_GRATEX is not in a status you can easily understand what I am doing. But then... have a look and give me feedback please.
    It works somehow and you can use the basic routines, which are
    * start(videopin)
    * out, str, dec, hex, bin for text, including positioning ($a, $b) and 2 text colors ("$c,1" and "$c, 2")
    * having either a full non buffered graphics window (320x240) or a split screen with double-buffered graphics (160x240)

    Change videoPin and crystal setting before you start the demo (it's preset for Hydra).
    Eventually you should remove the demo part from the object and use it from your own program.
    3k free at the moment.

    Post Edited (deSilva) : 1/6/2008 7:07:28 PM GMT
  • Goran (Sweden)Goran (Sweden) Posts: 68
    edited 2008-01-06 15:32
    deSilva, Thanks
    It could be what I needed for my "Shooting target project" which is a project I intend to use myself. I am a hunter and needed some challenge to keep me busy. I am 64 years old and soon retired.
    If and when I have my project working I will notice you.
    Anyway the project now have been tested with real shooting and the accuacy is within 2 cm. For the moment I am using a PC with a VB program to present the result on a Graphic picture of the real target. But I want the presenting part to be a Prop with a small cheap videodisplay instead of a PC.
    Attached is a picture of the PC screen
    Regards, Goran
    820 x 555 - 82K
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-06 19:06
    Uploaded an improved version

    Post Edited (deSilva) : 1/6/2008 7:11:45 PM GMT
  • not2sixnot2six Posts: 7
    edited 2008-01-08 00:57
    The version 21 is a little nicer ...
    Many thanks for this. In looking at the code, the Prop graphics makes more sense and I think I have a good handle on how it works. Still would like more available RAM but then I'm hard to please ....
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-08 01:16
    There are two options:
    - Using the split screen WITHOUT double buffering: that will free 10kB
    - Using 2-color mode, however that will need a modification in GRAPHICS and TV. I wonder why there are so few B/W applications.. The first MAC worked B/W only and was fine...
  • not2sixnot2six Posts: 7
    edited 2008-01-08 03:54
    Hey, 10kB is 10kB ... whats the downside: speed ? , stability ?

    Do you think the two colors could be anything; white on blue perhaps ?? If this were the case it would be entirely acceptable. I'll look into the GRAPHICS/TV code to see what damage I can do there....
  • HarleyHarley Posts: 997
    edited 2008-01-08 17:15
    .
    deSilva said...
    - Using 2-color mode, however that will need a modification in GRAPHICS and TV. I wonder why there are so few B/W applications.. The first MAC worked B/W only and was fine...

    I agree with deSilva re: first Macintosh. I used one for years to do pcb layouts using Douglas layout tool (no schematic capture, router, etc.). For that only b/w worked fine, as did all the other apps like word processor. We're spoiled today with 'needing' thousands/millions of colors and GHz speeds, though nicer. But now with an Intel iMac, that pcb s/w is no longer usable; obsolete OS and micro it runs on. Technology is nice; obsolescence isn't. Blech!
    yeah.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-08 17:34
    not2six said...
    Do you think the two colors could be anything; white on blue perhaps ??
    Yes of course they can! They can also be anything else in each tile!
    [noparse][[/noparse]quote]I'll look into the GRAPHICS/TV code to see what damage I can do there[noparse][[/noparse]/code]
    Have fun! This is not such easy as you might think. It is one of the densest codes deSilva has seen, and it took him many evenings to understand it smile.gif

    TV has to be changed for the usage of the ROM font. As its allocation has been optimized for 4-color mode, each long containing glyph data has to be preprosessed in the display loop. I shortly had the idea to change between 4 and 2 color mode within a video line, but this is too tricky...
    It could be arranged though to have 2 and 4 color lines during the same frame...
  • not2sixnot2six Posts: 7
    edited 2008-01-09 01:18
    You could be on to something really good here...

    I briefly looked at the TV code and my hair started falling out, its quite a job. How much different is the VGA code from the TV ? Wouldn't it be easier ?
  • deSilvadeSilva Posts: 2,967
    edited 2008-01-09 02:18
    Yes the basic VGA driver is really simple smile.gif

    It might help you to firs look into the last chapter (I think it is the last..) of my Machine Language Tutorial which explains the working of VSCL, VCFG, and WAITVID
Sign In or Register to comment.