Shop OBEX P1 Docs P2 Docs Learn Events
TV problem — Parallax Forums

TV problem

Lee MarshallLee Marshall Posts: 106
edited 2007-10-08 00:55 in Propeller 1
I am now trying to run the tv text demo, but all i get is that black/white dot pattern like when you are tuning to an off-air signal.(except when the prop is off/booting, then i just get black)
i am using an RCA jack, plugged into my TVs composite input with the DAC provided in the prop manual except im using pins 16 and upwards rather than 12 upwards.
I am now using a 4 mhz SMD oscillator, my scope says it is producing a stable square wave.

here is my TV_Text_Demo.spin(exactly the same except for clock settings and the start pin)
CON

  _clkmode = XINPUT + PLL16X
  _xinfreq = 4_000_000


OBJ

  text : "tv_text"
  

PUB start | i

  'start term
  text.start(16)
  text.str(string(13,"   TV Text Demo...",13,13,$C,5," OBJ and VAR require only 2.8KB ",$C,1))
  repeat 14
    text.out(" ")
  repeat i from $0E to $FF
    text.out(i)
  text.str(string($C,6,"     Uses internal ROM font     ",$C,2))
  repeat
    text.str(string($A,16,$B,12))
    text.hex(i++, 8)



also, at the bottom of TV_Text.spin, i have changed the LSB of mode from 0 to 1(for PAL):
tv_params               long    0               'status
                        long    1               'enable
                        long    0               'pins
                        long    %10011          'mode
                        long    0               'screen
                        long    0               'colors
                        long    cols            'hc
                        long    rows            'vc
                        long    4               'hx
                        long    1               'vx
                        long    0               'ho
                        long    0               'vo
                        long    0               'broadcast
                        long    0               'auralcog



Is there some setting i havent changed for PAL?

Can anyone help with this?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Holy parallel processing, Batman!

Post Edited (Mr Crowley) : 10/6/2007 4:24:34 PM GMT

Comments

  • hippyhippy Posts: 1,981
    edited 2007-10-06 16:23
    @ Mr Crowley : That matches what I did for UK PAL. I later changed 'rows' to 16 and 'hx' to 5. Works on both my Panasonic PAL/NTSC TV and a PAL-only hand held Citizen LCD TV.

    I used 5MHz and pins 12-16. perhaps the Start(pin) method of TV_Text doesn't set the pin grouping to select the lower four pin group ? You could have a peek into TV_Text.spin to check that ( or even force the 'pins' value to what it should be within Start ). TV.spin describes the 'pins' bit-mask values.

    If you don't get anywhere it may be worth going to 5MHz, pins 12-16 to ensure everything is working, then make the change to what you actually want one step at a time.
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-06 17:34
    Does deSilvas MPE_TEXT.SPIN run?
  • Lee MarshallLee Marshall Posts: 106
    edited 2007-10-06 17:53
    tv terminal works fine with tv terminal demo, thats odd

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Holy parallel processing, Batman!
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-06 19:13
    TvTerminal has completely different settings, e.g. it does not use interlacing.
    That's why I asked whether MPE_TEXT would run... It displays in both mode as a demo....
  • Lee MarshallLee Marshall Posts: 106
    edited 2007-10-06 19:19
    ah, i suspected it had something to do with interleave, or one of those other weird settings i dont completely understand.

    my new code is now misbehaving.
    Its meant to output characters from a keyboard to a TV,
    I get the:
    Keyboard Interface
    Please Connect a keyboard
    Keyboard Connected

    but as soon as i press a key, the screen blanks.
    CON
      _CLKMODE = XINPUT + PLL16X
      _XINFREQ = 4_000_000 
    
    OBJ
      Term : "tv_terminal"
      KB : "Keyboard"
    
    VAR
      Byte KeyCode
    PUB Main
      Term.Start(16)
      KB.start(26,27)
      Term.str(string("Keyboard Interface"))
      Term.out(13)
      
      if not KB.Present
        Term.str(string("Please connect a keyboard"))
        Term.out(13)
        repeat
        until KB.Present
      Term.str(string("Keyboard Connected"))
      Term.out(13)
      repeat
        repeat
          KeyCode := KB.key
        until KB.Key
        Term.out(KeyCode)
    



    Also: hippy, i cant see a parameter called rows, but there is a vx.(is changing this stuff to stop the tv from displaying everything squished?)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Holy parallel processing, Batman!

    Post Edited (Mr Crowley) : 10/6/2007 7:25:39 PM GMT
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-06 19:25
    There are many control characters with term.out. Try term.hex(keycode,2) for debugging.

    Also: Better write "UNTIL KeyCode" rather than "UNTIL KB.key"
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-06 19:33
    All right. The situation is as follows.
    0 is called "home" but in fact CLEARS the screen.

    While you wait for a character, zeroes are stored into keyCode.
    As soon as the first non-zero key is detected the loop breaks, but keycode still contains zero...

    So just follow my second advice, and the first one will be obsolete smile.gif
  • Lee MarshallLee Marshall Posts: 106
    edited 2007-10-06 19:42
    Yup, it works!
    I actually meant that to be keycode, i not sure how it ended up the other way. burger.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Holy parallel processing, Batman!
  • Lee MarshallLee Marshall Posts: 106
    edited 2007-10-07 00:16
    I actually have a lil question about the video generator:
    what exactly can it do when in composite mode? can it produce the color burst at the horizontal blanking interval, can it produce the sync pulses??? what does it do about vertical sync?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Holy parallel processing, Batman!
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-07 00:32
    The sync pulses are explicitly produced by the I/O driver by loading video data that produces a sync level signal including the color burst.
  • Lee MarshallLee Marshall Posts: 106
    edited 2007-10-07 22:02
    ive been looking down the tv.spin file, and i noticed what seems like an error in the notes at the end:

    ''  tv_screen
    ''
    ''    pointer to words which define screen contents (left-to-right, top-to-bottom)
    ''      number of words must be tv_ht * tv_vt
    ''      each word has two bitfields: a 6-bit colorset ptr and a 10-bit pixelgroup ptr
    ''        bits 15..10: select the colorset* for the associated pixel tile
    ''        bits 9..0: select the pixelgroup** address %ppppppppppcccc00 (p=address, c=0..15)
    
    



    pppppppppp is ten bits from 6..15, right?
    but it says p is from bits 0..9.

    cccc00 is six bits(whats with the 0s) from 0..5?
    it says c is from 10..15


    so, what is the real structure of the tv_screen word?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Holy parallel processing, Batman!
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-07 22:13
    Easy to get confused, but all is explained correctly!

    (a) You have the contents of the tv_screen which should better had been called tv_tiles... But it's too late now..
    It contains a COLOR NUMBER 0 to 63 in its upper 6 bits and a TILE NUMBER in its lower 10 bits.

    (b) The last two lines in the text you copied explain how this TILE NUMBER corresponds to a HUB address:
    When multiplied with 64 it points to a 16x16 tile, consisting of 16 LONGS each of them containing 16 pixels of 2 bits each for the four-color mode shift-out


    Hope this helped.

    Post Edited (deSilva) : 10/7/2007 10:21:59 PM GMT
  • hippyhippy Posts: 1,981
    edited 2007-10-07 22:42
    Mr Crowley said...
    pppppppppp is ten bits from 6..15, right?
    but it says p is from bits 0..9.

    cccc00 is six bits(whats with the 0s) from 0..5?
    it says c is from 10..15

    It took me while to get my head around that description. The bottom 10 bits 'pppppppppp' of screen[noparse]/noparse are used as the top 10 bits of the address the tile to display starts at. The character code value ( to select a particular tile ) is then added ( Or'd ) to that address, the tile is then a set of longs from that address.

    I know I've ducked "why are there just four bits for the character code 'cccc' , 16 characters". I'm not sure. The Spin method "PRI print(c)" where screen[noparse]/noparse is set shows how the pointer to the tile is setup. In a recent post I included details of how to switch TV_Text to using user defined characters. That will show how I did it there and may provide a little help and clarity.

    http://forums.parallax.com/forums/default.aspx?f=25&m=219325
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-08 00:30
    @hippy What are you writing about??? I explained everything nearly perfectly in my posting above - or didn't I ???
  • hippyhippy Posts: 1,981
    edited 2007-10-08 00:55
    @ deSilva : Well your original explanation didn't seem that clear to me, and I've often found it helps to have two or more perspectives.
Sign In or Register to comment.