Shop OBEX P1 Docs P2 Docs Learn Events
Color NTSC with the SX48 - Page 2 — Parallax Forums

Color NTSC with the SX48

2

Comments

  • BeanBean Posts: 8,129
    edited 2006-09-07 00:12
    Did you try adjusting the TIMER value by +/- 1 ? That helped my monitor lock onto the color when using the SX-Key.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.


    Post Edited (Bean (Hitt Consulting)) : 9/7/2006 2:35:41 PM GMT
  • cbmeekscbmeeks Posts: 634
    edited 2006-09-07 00:48
    Increasing to 4561 did the trick!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Coders' Hangout
    A place for programmers to hangout!
    http://www.codershangout.com

    METROID?
    Metroid Classic
  • BeanBean Posts: 8,129
    edited 2006-09-07 01:23
    Try this.

    Same program, but moves the colorbars to the left with wraparound. SMOOTH....

    Bean.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
  • cbmeekscbmeeks Posts: 634
    edited 2006-09-07 01:26
    Very nice and very smooooooooth. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Coders' Hangout
    A place for programmers to hangout!
    http://www.codershangout.com

    METROID?
    Metroid Classic
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-09-07 14:32
    cbmeeks said...
    It worked!
    However, I did get the problems you described. It only works when I turn off the monitor (1084GS) and turn it back on. And I get the lines going down the screen.
    Great work though!
    1084GS...Wasn't that a monitor made for C=64/Amiga applications?· My memory isn't what it used to be, but I seem to recall having a couple of 1084S monitors...Trying to remember GS...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • cbmeekscbmeeks Posts: 634
    edited 2006-09-07 16:06
    Oh yeah, the 1084GS was made by Commodore (well, Commodore's name on it) and it is the BEST monitor ever made (in the 80s/90s at least).

    It hase VGA for the Amiga/C128 and composite with stereo inputs/speakers. PLUS, it has S-Video!! In the form of RCA jack. On some of my circuits, I pass the chroma directly to that S-Video and it looks MUCH better than composite.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Coders' Hangout
    A place for programmers to hangout!
    http://www.codershangout.com

    METROID?
    Metroid Classic
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-09-07 16:12
    Thanks!· That's what I thought...What I would give to have some of my old C= Monitors back...<sigh>· With all the projects for video on the SX, and of course the Propeller...


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • cbmeekscbmeeks Posts: 634
    edited 2006-09-07 17:00
    You can still find them on eBay for cheap...but the shipping is usually more than a 19" TV with S-Video

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Coders' Hangout
    A place for programmers to hangout!
    http://www.codershangout.com

    METROID?
    Metroid Classic
  • Basic JimBasic Jim Posts: 106
    edited 2006-09-07 19:33
    Just Wondering...
    Couldn't you just use an old VGA 8 bit (or 16 bit card) and use an SX to control the lines to do what you want? Then you could use a VGA monitor to write the games. You would have the ram on the card to use.

    Thanks,
    Jim W.
  • BeanBean Posts: 8,129
    edited 2006-09-07 22:18
    Jim,
    Generating VGA is simple compared to NTSC.
    I could be wrong, but I would assume most people want NTSC video output.
    I mean how many people have a spare VGA monitor laying around ?
    Pretty much everyone has a color TV.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
    ·
  • cbmeekscbmeeks Posts: 634
    edited 2006-09-08 01:25
    I have several VGA monitors and tv's. I like both....hehehe

    But for retro, you have to go NTSC. VGA is easier...but not by much. However, it is SUPER simple to generate the color you want but the timing is a little difficult to master.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Coders' Hangout
    A place for programmers to hangout!
    http://www.codershangout.com

    METROID?
    Metroid Classic
  • TransistorToasterTransistorToaster Posts: 149
    edited 2006-09-09 17:15
    Hello Bean,
    I did some analysis on the 4 bits rotated out for color. I thought I'd share it with you.
    Frank

    ANGLES WORK ON I Q PLANE, NOT ON R-Y B-Y PLANE

    (The angle is obtained from the second entry of the fft)

    fft([noparse][[/noparse]0 0 0 0]) nothing at 3.57Mhz

    fft([noparse][[/noparse]0 0 0 1])= 1 i -1 -i =90degrees = DARK RED

    fft([noparse][[/noparse]0 0 1 0])= 1 -1 1 -1 = 180 degrees = GREEN

    fft([noparse][[/noparse]0 0 1 1] = 2 -1+i 0+0 -1-i = 135degrees BRIGHT GREEN (yellow??)

    fft([noparse][[/noparse]0 1 0 0])= 1 -i -1 i = -90degrees BLUE (DARK CYAN)

    fft([noparse][[/noparse]0 1 0 1])= 2 0 -2 0 nothing at 3.57Mhz=GREY

    fft([noparse][[/noparse]0 1 1 0])= 2 -1-i 0+0 -1+i = -135 degrees GREENISH CYAN

    fft([noparse][[/noparse]0 1 1 1])= 3 -1 -1 -1 =180degrees GREEN

    fft([noparse][[/noparse]1 0 0 0])= 1 1 1 1 = 0 degrees VIOLET

    fft([noparse][[/noparse]1 0 0 1])= 2 1+i 0+0 1-i = 45 degrees RED

    fft([noparse][[/noparse]1 0 1 0])= 2 0 2 0 nothing at 3.57Mhz=GREY

    fft([noparse][[/noparse]1 0 1 1])= 3 i 1 -i = 90degrees BRIGHT ORANGE

    fft([noparse][[/noparse]1 1 0 0])= 2 1-i 0+0 1+i = -45 degrees BLUE-VIOLET

    fft([noparse][[/noparse]1 1 0 1])= 3 1 -1 1 = 0 degrees VIOLET

    fft([noparse][[/noparse]1 1 1 0])= 3 -i +1 +i = -90 degrees BLUEISH CYAN

    fft([noparse][[/noparse]1 1 1 1])= 4 0 0 0 nothing at 3.57Mhz
  • BeanBean Posts: 8,129
    edited 2006-09-10 00:46
    Frank,
    Thanks that is interesting.
    I've got one prototype with the SRAM, but I've got some problem with the video generation ISR not "playing nice" with the main code when they both access the SRAM.
    I want to have the ISR so that it saves the state of the SRAM ports so the main codes doesn't need to restrict access to the SRAM to only the blanking times.

    I'd say it's 90% there. One change though is that the bits are rotated the opposite way (RR instead of RL) so the colors are mixed around.

    I should be able to get it working next week, then make a tile engine for it (cbmeeks your module is probably 2 weeks away).

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
    ·
  • cbmeekscbmeeks Posts: 634
    edited 2006-09-10 01:17
    hahaha bean. Thanks. I look forward to seeing what you produce since my time is so thin I may not get mine in 2 weeks. I am ordering some more protoboards this weekend though.

    You certainly are the master over hardware but I would love to get together with you and maybe produce a stand alone "video card" for NTSC. maybe something like the PropStick but with an SX48 and some pins for SRAM and video? What do you think?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Coders' Hangout
    A place for programmers to hangout!
    http://www.codershangout.com

    METROID?
    Metroid Classic
  • BeanBean Posts: 8,129
    edited 2006-09-15 16:46
    I'm about 90% sure my problem (well code's problem) is the old read-modify-write gottcha.

    In reading the datasheet it says:
    "For operating frequencies of 50 MHz or lower, if bit 7 of the T2CNTB (PORTRD) is set, the port reads data from the data register instead of port pins. In this case, the NOP instructions are not required."

    But it doesn't say if the frequency is above 50MHz ? I'm not sure why it would matter ? Does anyone know ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
    ·
  • cbmeekscbmeeks Posts: 634
    edited 2006-09-15 17:15
    would three nops be too much?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Coders' Hangout
    A place for programmers to hangout!
    http://www.codershangout.com

    METROID?
    Metroid Classic
  • BeanBean Posts: 8,129
    edited 2006-09-17 20:47
    Okay,
    · I'm getting there.
    · Here is the latest image. It shows all 16 colors used as background and foreground.
    · As you can see some combinations don't work too well.
    · I was surprised to see the nice range of colors considering how the color is generated.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.


    Post Edited (Bean (Hitt Consulting)) : 9/17/2006 8:51:23 PM GMT
    1031 x 681 - 241K
  • ForrestForrest Posts: 1,341
    edited 2006-09-17 21:47
    Bean,
    Looks very good. Keep us updated on when you think the color video kit will be available. Thanks
  • BeanBean Posts: 8,129
    edited 2006-09-18 01:03
    Here is a picture that shows blocks of each color.
    The second picture is each of the 16 colors mixed with each of the 16 colors.

    P.S. I'd like some suggestion for color names.

    Bean.
    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.


    Post Edited (Bean (Hitt Consulting)) : 9/18/2006 1:46:55 AM GMT
    1152 x 864 - 207K
    1152 x 864 - 344K
  • James NewtonJames Newton Posts: 329
    edited 2006-09-18 18:25
    In some dim foggy part of my brain I remember someone (was it Woz with the Apple II?) had a hardware mod that converted one of the grays into another color. It may have been a selective pulse extender (count and feed back one of the outputs back into the pulse train) but that is just me guessing. My memory seems to be telling me it was an analog circuit, but I can't imagine how that could possibly be. I also seem to remember that it slightly modified all the other colors as well.

    If the loop that sends out the pulses was unrolled, and the middle pulse was made slightly longer with some nop's, what effect would that have on the colors?

    Probably useless, I just thought it might spark something.

    Naming the colors? Real men don't name colors.

    Re: Your sig line about wealth. I'll be passing that on to my wife and kids.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ---
    James Newton, Host of SXList.com
    james at sxlist,com 1-619-652-0593 fax:1-208-279-8767
    SX FAQ / Code / Tutorials / Documentation:
    http://www.sxlist.com Pick faster!



  • Lord SteveLord Steve Posts: 206
    edited 2006-09-18 21:45
    Black, Fuchsia, Blue, Purple (maybe Blue Purple)
    Dark Green, Dark Gray, Aquamarine, Cerulean(maybe Cornflower)
    Dark Red (Brown?), Red, Light Gray, Magenta,
    (Dark)Teal, Yellow, Green, White
  • TransistorToasterTransistorToaster Posts: 149
    edited 2006-09-18 22:52
    >Frank,
    >Thanks that is interesting.
    >I've got one prototype with the SRAM, but I've got some problem with the video generation ISR not "playing nice" with >the main code when they both access the SRAM.


    >I got the interrupt routine to co-operate by remembering the SRAM status
    >and returning it when it's done.
    >So the main code can write to SRAM anytime (much faster).
    >But I still have the startup problem...
    >Bean.

    Bean,
    I have a leftover question back from the original black and white mere mortal engin, which I suppose has been triggered when you talk about the SRAM access shared by two threads.

    You used __PARAM1 in your ISR at NextTile: and PrimeTileDots:. Exactly why did you use that register? If a function is called in the main code and it gets interrupted, isn't there a problem? I know you made a subroutine to wait for the non-active video phase of the screen display, but is it necessary considering 1) that the worse case scenario is a few pixels that get updated 1/60 seconds later and 2) there are no writes to the shared memory in the ISR?


    >As you can see some combinations don't work too well.
    ...
    >I was surprised to see the nice range of colors considering how the color is generated.
    The large gamut of colors is perfectly logical because the TV demodulator circuit is continuous in time plus has memory.

    Let
    y()= +-1 generated by SX
    K=4,
    T = 1/3.57MHz
    n1=time

    y(n1 *K *T)-> BP filter h1(t) -> c(t) : color signal before phase demodulation
    y(n1 *K *T) -> notch filter h2(t) -> l(t) : luminance

    It is originally designed for each pixel to last a timespan of T as expressed in y(n2 * T). where , n2=n1*K. However the output is not taken at discrete time intervals c(n2 * T). It can only be written as c(t) where the phase and magnitude change continuously in time. Also, the filter impulse response h(t) cannot be expressed as a constant scaling factor which implies it has memory.


    We could only minimize the interference. I'd like to think about that a bit. Maybe some tricks can be done considering we have 20 clock cycles per colorburst. The easiest technique for consistency I see is to precede each color by at least one pixel of black. Could you please five and equation that relates for a given (x,y) coordinate, what bit pattern you intended to shift out?

    Frank
  • BeanBean Posts: 8,129
    edited 2006-09-18 23:16
    transistortoaster said...
    You used __PARAM1 in your ISR at NextTile: and PrimeTileDots:. Exactly why did you use that register? If a function is called in the main code and it gets interrupted, isn't there a problem? I know you made a subroutine to wait for the non-active video phase of the screen display, but is it necessary considering 1) that the worse case scenario is a few pixels that get updated 1/60 seconds later and 2) there are no writes to the shared memory in the ISR?
    Frank,

    · By default (unless you specify NOPRESERVE or NOCODE) SX/B saves all the __PARAMx variables at the start of the interrupt and restores them at the RETURNINT. Otherwise you would be VERY limited as to what SX/B commands you could use in an interrupt. Since many of the SX/B commands use the __PARAMx variables.

    · All of the __PARAMx variables are really handy in assembly code because they are guarenteed (sp?) to be in the global memory area. So you can adjust FSR and still have access to them.

    · Actually I would like to get the clock frequency down to 16x colorburst, or 57.272727MHz. The spec sheet says the SX48 cannot run above 50MHz at 3.3volts. I would like to make the color video circuit low power, so I want to run the SX at the slowest clock and lowest voltage I possibly can.

    · I'm right now writing a Bresenham line code so I can draw lines on the screen. Fun fun fun...

    Bean.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
    ·
  • cbmeekscbmeeks Posts: 634
    edited 2006-09-19 00:22
    Awesome work Bean...as always.

    Is this going to be an open project? smile.gif

    I am very excited to see what can be done with this driver.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Coders' Hangout
    A place for programmers to hangout!
    http://www.codershangout.com

    METROID?
    Metroid Classic
  • BeanBean Posts: 8,129
    edited 2006-09-19 00:40
    cbmeeks,
    It will have to be open for people to use it [noparse];)[/noparse]
    I will probably make a serial or I2C or SPI module for use with the BS2 or other controllers. That probably won't be open source.

    Actually this whole project started out because I kept seeing the propeller color video and I was thinking, "damn it, if the propeller can do it, the SX can do it.". Of course extra memory is needed, but the prop needs an external EEPROM so there you are.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
    ·
  • cbmeekscbmeeks Posts: 634
    edited 2006-09-19 01:26
    Bean (Hitt Consulting) said...
    cbmeeks,
    It will have to be open for people to use it [noparse];)[/noparse]
    I will probably make a serial or I2C or SPI module for use with the BS2 or other controllers. That probably won't be open source.

    Actually this whole project started out because I kept seeing the propeller color video and I was thinking, "damn it, if the propeller can do it, the SX can do it.". Of course extra memory is needed, but the prop needs an external EEPROM so there you are.

    Bean.

    You got that right...those Propeller folks are cheating...using that fancy spin language and multiple cogs....back in my day, we used ONE cog and liked it! lol

    Seriously, my VGA circuit is coming along pretty well. Got it up to 256x240 resolution with 64 colors...could easily be 256 colors but one of the colors would only be 2 bit and the other 2 would be 3 bit... :-/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Coders' Hangout
    A place for programmers to hangout!
    http://www.codershangout.com

    METROID?
    Metroid Classic
  • cbmeekscbmeeks Posts: 634
    edited 2006-09-19 14:54
    hey bean, are you storing those fonts in the SX memory or are you pulling them from SRAM?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Coders' Hangout
    A place for programmers to hangout!
    http://www.codershangout.com

    METROID?
    Metroid Classic
  • BeanBean Posts: 8,129
    edited 2006-09-19 15:02
    They are stored in the SX memory. The SRAM is volitile so all contents are lost when power is lost.
    Maybe I should look into FRAM ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
    ·
  • cbmeekscbmeeks Posts: 634
    edited 2006-09-19 15:11
    well, that's what I am thinking...FRAM is great for fonts but aren't they usually slow? I have some at home but can't remember their speed. I *THINK* around 60-70ns. I have some SRAM that is 15ns so much better for video streaming.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Coders' Hangout
    A place for programmers to hangout!
    http://www.codershangout.com

    METROID?
    Metroid Classic
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-09-19 17:51
    Even though SRAM is volatile you could always copy the FONT table into SRAM at startup.· This trick was frequently used by·BIOS manufacturers to increase access time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.