Shop OBEX P1 Docs P2 Docs Learn Events
TV output at less than 80MHz !!NOW WORKING!! — Parallax Forums

TV output at less than 80MHz !!NOW WORKING!!

photomankcphotomankc Posts: 943
edited 2009-09-10 07:36 in Propeller 1
Hey all.· I was looking at using the TV text object to give some of my projects a plug-in display that could be added when needed via headers.· One issue is however my main project right now runs at 40Mhz to conserve power.· Reading the TV.spin object it looked like it supported various clock frequencies as long as they are over the threshold but when I compile and load it with a 40Mhz clock all I get is bursts of snow and garbage.· When I load it with 80Mhz then everything works wonderfully.· Is this one of those cases where the code has to be altered to run at a slower clock speed?· I'm a complete assembly moron so that would be an unpleasant undertaking.


Update:
After adjusting the output columns and using the following in the DAT section:
long    7               'hx


It is now working.· I can just barely get 24 columns but you can tell it's on the edge.· 23 columns gives me a strong picture and no jitter.· Still more real-estate than the serial LCD would give me and I only need 1 pin extra to get it.· It's also function-call compatible with the PC_Text object so if I want to go back to my serial display then a couple of comment/uncomment lines and everything just works.· Perfect!

Here's a photo of it all put together. (minus the polish of course).· Thanks to everyone for taking a look at this and helping me out!

Post Edited (photomankc) : 9/10/2009 2:50:45 AM GMT
634 x 480 - 45K

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-09-07 13:24
    TV.spin should be able to adjust itself for various system clock frequencies. When you change your program's clock frequency, how do you do it?
  • photomankcphotomankc Posts: 943
    edited 2009-09-07 15:56
    Using the constants declaration. I just drop the PLL16c to PLL8x and programming that into the chip. When I do that I just get occasional bursts of what looks like snow.

    CON
      _clkmode       = xtal1 + pll16x
      _xinfreq       = 5_000_000
    
    OBJ
      button:       "Button"
      heart:        "Heartbeat"
      vid:          "TV_Text"
    
    VAR
      long mSec  
    
    PUB Start | time
      
      dira[noparse][[/noparse]27..24] ~~
      dira[noparse][[/noparse]6..7] ~~
      dira[noparse][[/noparse]9..11] ~
    
      vid.Start(12)
      vid.str(String("I2C_Send_Demo.spin"))
    
    
  • ericballericball Posts: 774
    edited 2009-09-08 16:32
    My One Pin Text driver (see sig) will run down to 12MHz.· Note: you should be using the CLKSET function to change the frequency since that will update CLKFREQ (aka LONG[noparse][[/noparse]0]) which my driver polls every frame.· (I'm not certain about TV.spin, I think it does the same.)



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Composite NTSC sprite driver: Forum
    NTSC & PAL driver templates: ObEx Forum
    OnePinTVText driver: ObEx Forum
  • photomankcphotomankc Posts: 943
    edited 2009-09-08 20:31
    So I should set it to 80MHz with the constants and then switch to 40MHz using CLKSET?· I thought the constants generated the code for that behind the scenes for whatever freq was declared with the constants?· I can give that a try but I'm not changing the clock on the fly, I'm just compiling it with PLL16x replaced by PLL8x

    This gets me TV output:

    CON
      _clkmode       = xtal1 + pll16x
      _xinfreq       = 5_000_000
    



    This gets me snow and garbage:
    CON
      _clkmode       = xtal1 + pll8x
      _xinfreq       = 5_000_000
    
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-09-08 20:47
    The constants alone (in your top-level program) are adequate and will set the clock register correctly.

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-09-08 21:06
    As a followup, I tested the tv_text demo code from the Propeller library at 40MHz. It doesn't work, either. Looking at the comments in the TV.spin assembly code, though, it should work. So something is amiss with the driver.

    -Phil

    Update: Looking at the scope, I see that the vertical and horizontal frequencies are way off.

    Update 2: I tried forcing TV.spin's frqa to a value which yields the correct horizontal frequency, but the vertical frequency is still way off. I have a feeling that there are some critical code timings that just aren't happening fast enough at 40 MHz.

    Post Edited (Phil Pilgrim (PhiPi)) : 9/8/2009 10:16:11 PM GMT
  • rokickirokicki Posts: 1,000
    edited 2009-09-08 22:31
    I pointed this out years and years ago, and was met with pretty much stone silence.

    Glad to see it's getting looked at.

    I wonder if anyone's tried 100MHz (with a 6.25MHz crystal), and if that works, at
    50MHz? I agree with Phil; I think it was intended to work, but somewhere along the
    way, part of it broke.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-09-08 23:11
    rokicki said...
    Glad to see it's getting looked at.
    Well, that's about all it's getting — from me, at least. The TV.spin code is so tightly written that I'm afraid to dive into it like Yoda into Luke's provisions kit.

    -Phil
  • potatoheadpotatohead Posts: 10,261
    edited 2009-09-08 23:30
    I did look at this once.

    The problem appears to be tasks computed during the blanking periods.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
    Safety Tip: Life is as good as YOU think it is!
  • photomankcphotomankc Posts: 943
    edited 2009-09-09 03:30
    ericball said...

    My One Pin Text driver (see sig) will run down to 12MHz.· Note: you should be using the CLKSET function to change the frequency since that will update CLKFREQ (aka LONG[noparse][[/noparse]0]) which my driver polls every frame.· (I'm not certain about TV.spin, I think it does the same.)



    I'll give your driver a go.· Color is not required, I just want a simple, easy to attach method to get debug output from my device away from the PC.· I do have to run at 40Mhz or less to·conserve battery power as much as possible though.

    Edit: Well, it works at 40 but I'm not up for manually poking data into the screen array byte by byte so that's not going to work either.· TV_Terminal works but it uses half the chips memory for something.· Might be my only option though.· I have a serial LCD on the way, might be easier to just use it.

    Post Edited (photomankc) : 9/9/2009 5:00:15 AM GMT
  • BaggersBaggers Posts: 3,019
    edited 2009-09-09 13:23
    The issue is speed, when you reduce to 8* ( 40Mhz ) you no longer have enough time to do 40 chars wide

    What you need to do, is copy TV_Text.spin to another file, TV_Slow_Text.spin, then change ( near the top )

    cols = 40

    to something like

    cols = 24

    and change ( near the bottom )

    long 4 'hx

    to something like

    long 7 'hx


    I'm not sure of the exact figures as I'm on 6Mhz crystal, but I can get
    cols = 28
    long 6 'hx
    before the display doesn't work properly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • potatoheadpotatohead Posts: 10,261
    edited 2009-09-09 14:39
    That means the blanking period calculations are not at issue before the waitvid loop is.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
    Safety Tip: Life is as good as YOU think it is!
  • BaggersBaggers Posts: 3,019
    edited 2009-09-09 14:55
    yup, it's having to get a block, then get character data, and palette etc from hub-ram before each waitvid.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • photomankcphotomankc Posts: 943
    edited 2009-09-09 15:34
    I'll give that a try and see what happens.
  • photomankcphotomankc Posts: 943
    edited 2009-09-10 02:57
    That worked! Cols = 23 and 'hx = 7
  • BaggersBaggers Posts: 3,019
    edited 2009-09-10 07:36
    [noparse]:)[/noparse] good news photomamkc

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
Sign In or Register to comment.