Shop OBEX P1 Docs P2 Docs Learn Events
Graphics demo problem — Parallax Forums

Graphics demo problem

LeonLeon Posts: 7,620
edited 2007-04-13 12:40 in Propeller 1
I'm trying to get the graphics demo working on my hardware, which includes the three resistors connected to P12, P13 and P14 as on the Demo board. I've modified the code slightly by removing the mouse stuff (I haven't got one interfaced), and putting the Spinning Triangles code into an infinite loop. The problem is that I'm not getting any output on pins P12, P13 and P14 when I check with my scope. I've assumed that the demo uses those three pins, is that assumption correct? I can't seem to find where they are defined in the code.


Also, I want to use it with a PAL TV, so I've changed this one line in the DAT statement:

DAT

tvparams long 0 'status
long 1 'enable
long %001_0101 'pins
long %0001 'PAL mode

Is this all I need to do to change from NTSC to PAL?

Leon

Comments

  • potatoheadpotatohead Posts: 10,260
    edited 2007-04-12 14:38
    To cut down on potential problems, don't worry about the mouse. The demo will run without one connected.

    The pins are defined in the TV.spin driver, found in your Parallax root directory.

    '' tv_pins
    ''
    '' bits 6..4 select pin group:
    '' %000: pins 7..0
    '' %001: pins 15..8
    '' %010: pins 23..16
    '' %011: pins 31..24
    '' %100: pins 39..32
    '' %101: pins 47..40
    '' %110: pins 55..48
    '' %111: pins 63..56
  • KaioKaio Posts: 253
    edited 2007-04-12 14:50
    Leon,

    you must not change the code if you have no mouse connected. It is also working without this. Your changes looking fine, so that it should be work properly. I have this working well. The pins for tv you mentioned are right.

    Did you have checked that the _xinfreq in CON section is set to the clock rate your crystal is running?
  • bambinobambino Posts: 789
    edited 2007-04-12 14:57
    Leon,

    I think potatohead sees your problem. The pin selector is 3 bits long. If you set those to long %001_0101 then you are useing pins(47..40) that will only be available on the next generation Prop that isn't out yet. Unless I've misread the TV object you should use % 001
  • KaioKaio Posts: 253
    edited 2007-04-12 15:21
    bambino,

    sorry, but that is not the problem. What Leon shows in his message is the default value from Graphics_Demo.
    Bits 6..4 selects pingroup 15..8 and bits 3..0 selects baseband mode for the top nibble of pingroup, which are pins 15..12.

    Post Edited (Kaio) : 4/12/2007 3:29:03 PM GMT
  • bambinobambino Posts: 789
    edited 2007-04-12 15:41
    Kaio,
    I can not view spin files on this machine so I will have to wait till later tonight to review the object. I don't see how you can apply 5 bit values to a three bit register.
    Leon,
    It is possible that I've misread the object.
  • simonlsimonl Posts: 866
    edited 2007-04-12 15:46
    Leon,

    What happens if you just run the graphics demo without any changes?

    My homebrew setup seems similar to yours -- with a PAL TV (unless the TV's recognising an NTSC input!) and no mouse -- and all seems to work fine smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,

    Simon

    BTW: I type as I'm thinking, so please don't take any offense at my writing style smile.gif

    www.norfolkhelicopterclub.co.uk
    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
  • LeonLeon Posts: 7,620
    edited 2007-04-12 15:59
    Thanks for the responses.

    I still can't find where the pins are defined, although I'd have thought that it would work straight "out of the box".

    The only pins I can find are in TV.spin:

    pins0 long %11110000_01110000_00001111_00000111
    pins1 long %11111111_11110111_01111111_01110111

    but the code can only be using three pins, as the schematic shows three outputs on P12, P13 and P14. Perhaps the values are buried in a mask somewhere in the assembler code. I'd have thought they would be defined in the top level file, but that seems too easy.

    Leon
  • simonlsimonl Posts: 866
    edited 2007-04-12 16:08
    Hi Leon,

    You'll need to understand TV.spin (I don't!)

    Looks like all the info you need is in the comments near the bottom of the file.

    Sorry if that's not very helpful!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,

    Simon

    BTW: I type as I'm thinking, so please don't take any offense at my writing style smile.gif

    www.norfolkhelicopterclub.co.uk
    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
  • LeonLeon Posts: 7,620
    edited 2007-04-12 16:09
    I tried the original code, Simon, but that didn't work, which is why I removed the mouse stuff. I've got a scope on the output with a 75R resistor as the load. I've checked that the output from P12-P14 is working, with a simple program to pulse them on and off, and can see them working.

    I've even checked all the pins for output, but there is no activity on any of them. I'm using a 5 MHz clock, I know that works OK.

    Leon

    Post Edited (Leon) : 4/12/2007 4:19:46 PM GMT
  • KaioKaio Posts: 253
    edited 2007-04-12 16:22
    Leon,

    it works out of the box, but only for NTSC. What you has found have nothing to do with configurating pins.

    As potatohead and I was mentioned above the pingroup will be configurated. The default value in Graphics_Demo.spin uses the pins 12 to 14. Please see my explanation above.
    long    %001_0101       'pins
    
    ''  tv_pins
    ''
    ''    bits 6..4 select pin group:
    ''      %000: pins 7..0
    ''      %001: pins 15..8
    ''      %010: pins 23..16
    ''      %011: pins 31..24
    ''      %100: pins 39..32
    ''      %101: pins 47..40
    ''      %110: pins 55..48
    ''      %111: pins 63..56
    ''
    ''    bits 3..0 select pin group mode:
    ''      %0000: %0000_0111    -                    baseband
    ''      %0001: %0000_0111    -                    broadcast
    ''      %0010: %0000_1111    -                    baseband + chroma
    ''      %0011: %0000_1111    -                    broadcast + aural
    ''      %0100: %0111_0000    broadcast            -
    ''      %0101: %0111_0000    baseband             -
    ''      %0110: %1111_0000    broadcast + aural    -
    ''      %0111: %1111_0000    baseband + chroma    -
    ''      %1000: %0111_0111    broadcast            baseband
    ''      %1001: %0111_0111    baseband             broadcast
    ''      %1010: %0111_1111    broadcast            baseband + chroma
    ''      %1011: %0111_1111    baseband             broadcast + aural
    ''      %1100: %1111_0111    broadcast + aural    baseband
    ''      %1101: %1111_0111    baseband + chroma    broadcast
    ''      %1110: %1111_1111    broadcast + aural    baseband + chroma
    ''      %1111: %1111_1111    baseband + chroma    broadcast + aural
    ''      -----------------------------------------------------------
    ''            active pins    top nibble           bottom nibble
    
    



    You can found this description in TV.spin.

    You have only to change the mode, you has done.

    What kind of board you are using?
  • LeonLeon Posts: 7,620
    edited 2007-04-12 16:33
    The board is one I designed myself. Everything else I've tried, such as the audio and speech synthesis works. I've left it as NTSC mode (code is exactly as downloaded) but the scope doesn't show anything on the output.

    Leon
  • LeonLeon Posts: 7,620
    edited 2007-04-12 16:43
    Just found the cause of the problem! A wire to one leg of the crystal had dropped off (I had to make some patches on the home-made PCB because of overetching). I should have checked that the crystal was actually oscillating. I normally do, but slipped up this time.

    It's outputting OK now (NTSC). I'll see what that looks like on my TV and then see if I can get PAL out of it.

    Thanks for the help.

    Leon
  • KaioKaio Posts: 253
    edited 2007-04-12 16:47
    Leon,

    please try if TV_Text_Demo is working for you. You have to change one line in TV_Text.spin to the following.
    long    %10011          'mode
    
    



    Hope, that this will work.
  • LeonLeon Posts: 7,620
    edited 2007-04-12 16:54
    Thanks, Kaio. The graphics demo is displaying OK on the TV, although it is still set to NTSC - display is monochrome. I'll go back to my original mouseless code and see if I can get that working with PAL output. I'll try the TV text demo later.

    Leon
  • KaioKaio Posts: 253
    edited 2007-04-12 16:57
    Leon,

    nice to hear that you have found the problem.

    If you would have the keyboard interface from Demo board on your Prop board you could be try POD, the on-chip debugger for assembly which I have made.
  • LeonLeon Posts: 7,620
    edited 2007-04-12 17:05
    One reason why I wanted the TV output was for debugging. I'll add the PS2 interface and try your debugger.

    It's generating PAL now (in colour).

    Leon
  • bambinobambino Posts: 789
    edited 2007-04-13 12:22
    Kaio,

    I finally got to look at the Parameters, Thanks for catching my mistake.
    I was not thinking it was a 7 bit register.
    Glad to hear your up and running Leon.

    Anyway, I hope no animals where harmed in the making of this thread!
  • LeonLeon Posts: 7,620
    edited 2007-04-13 12:26
    bambino said...

    Kaio,

    I finally got to look at the Parameters, Thanks for catching my mistake.
    I was not thinking it was a 7 bit register.
    Glad to hear your up and running Leon.

    Anyway, I hope no animals where harmed in the making of this thread!

    I did feel like kicking the cat yesterday! That's him, as my avatar, when he was a kitten.

    Leon
  • bambinobambino Posts: 789
    edited 2007-04-13 12:40
    Mine was raised with his mother and a huge white Cat till he was a year old.
    Now that there gone he has a problem with anything else·on 4 legs. I caught him yesterday trying to pull another dog(some stray after his food)·through his chain link fence by the nose!
Sign In or Register to comment.