Shop OBEX P1 Docs P2 Docs Learn Events
VGA pin usage — Parallax Forums

VGA pin usage

Toby SeckshundToby Seckshund Posts: 2,027
edited 2010-02-10 10:12 in Propeller 1
I have tried to just not drive the whole lot of VGA pins, that is I want to use just the lower four, of the eight usually allocated.

So what I want to know is, are the unused pins useless whilst the VGA mode is selected or are they released for othe uses. I want to use just the lower four for VGA and the upper four for a SD card.

Or is it " go and read the Counters artical again, and .... "

It was this bit of PropBASIC (VGA Demo) that got me interested

'
'·················+
VMode 00=Disable, 01=VGA, 10=Baseband, 11=broadcast
'···· ············ |··· +
CMode 0=2color, 1=4color
'················ ·|····|····································+
Pin group 23..16
'··················|··· |···································· |·········· +
Drive all 8 video pins
VCFG = %0_01_1_0_0_000_00000000000_010_0_11111111 ' Setup video configuration

so I put the upper four driven bits to 0s and they do not output VGA info, as expected, but the SD card will not work on them ( having changed the pin allocations in the program )

Post Edited By Moderator (Bean) : 2/7/2010 4:19:37 PM GMT

Comments

  • RaymanRayman Posts: 14,877
    edited 2010-02-07 15:55
    If I remember correctly, the lower three bits described below say how many pins are used by the VGA driver.· This example shows "01_111", meaning all 8 pins are used..
    If you put in "01_011", then only 4 pins would be used, pins %01000-%01011 (8-11).
    ''    bits 2..0 select top pin within group
    ''    for example: %01111 (15) will use pins %01000-%01111 (8-15)
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

    Post Edited (Rayman) : 2/7/2010 10:46:27 PM GMT
  • BeanBean Posts: 8,129
    edited 2010-02-07 16:15
    Just change those last 8 1's to 1's(for the pins for VGA) and 0's(for the pin for SD).

    The video hardware will only drive the pins that have a 1.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.

    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-02-07 16:56
    Thanks for the replies.

    I tried the masking bits 0s for SD and 1s for VGA but that didn't seem to be what I wanted, but then as I am trying to bend the DracBlade design something else may be the problem. In the Prop manual it always states 8 bits.

    Rayman also used the phrase " top bit " I wonder if it means that the top 4 could be used for the VGA and the lower bits for the SD ????

    more playing required.



    Edit.

    I have just tried to simplify things by doing the same thing on PropComm(vga), just in case the DracBlade software was fighting me. I have the same results, although the upper four bits are masked off the card cannot use them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point

    Post Edited (Toby Seckshund) : 2/7/2010 8:24:18 PM GMT
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-02-07 20:31
    Just thought, am I being dense (again) and fighting DIRAs, so I tried pushing the SD conections onto other pins not in the VGA group and it worked, after the pin defs were set.

    It seems a shame to blow the use of 1/8 of the pins, the single pin version just doesn't have the resolution I need.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • RaymanRayman Posts: 14,877
    edited 2010-02-07 22:45
    I expanded on my comment above, hope that helps...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-02-08 01:30
    Toby: You will need to read and understand the VGA object. I believe what you are trying to do is possible. Of course you will lose colors.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-02-08 09:21
    Colours ?? Nascoms don't do that sort of thing ! (unless you were incedibly rich)

    "Read and understand" is not easy for the hard of thinking.

    It's a part of the pin harvest to try the SDRAM fiasco. I was also looking at switching out the EEPROM after bootup.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-02-08 13:59
    Toby: I didn't mean to sound like I know how it works - I have been trying for a while too.

    I understand the basics of how the signal is generated. I can follow the horizontal and vertical syncs. What I don't quite yet follow is how the pins create the analog signal which means I cannot reduce the pins with any understanding.

    I think to turn the pins off is as easy as making those lower bits "0" in the VCFG, but it's impact on the signal and hence display I don't understand. I think the VCFG is loaded in a number of places, so that could be your problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-02-08 19:55
    Yeah, I'm sure it isn't just a case of a couple of "0"s stuffed into one line. Life would too simple if it was.

    The main problem I have is that all the good folks on this forum have laid such wonderful snippits of code and hardware before me that "pick-n-mix" gets you a ..... without having to get into the roots of the problem. I recon that is why I yearn for the Z80 days, there was little help and if you didn't do it yourself then it didn't happen, it made me learn. I will continue to experiment on PropCOMM and the hopefully take a crack at DracBlade (ish). There must be somebody out there who knows if it is possible or not (Chip).

    I asked the same question about a year back but it went the way of other ways of generation. single pin Vid would be ok for debug etc but I want to have better resolution for a text/block graphics screen.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • localrogerlocalroger Posts: 3,452
    edited 2010-02-08 23:40
    Cluso, the analog voltage is generated by using the resistors as a voltage divider. It looks a little strange because there's no resistor to ground; that's because the resistors that are selected work against the 75 ohm line impedance. To reduce pin count you will need to combine the two resistors into one that has the same resistance as both in parallel, and then instead of getting 4 levels selected by 2 bits you will get two levels selected by 1 bit. You will still need 5 lines for 3 colors, unless you want to just not drive one of the colors or try driving more than one from one output (which might require changing the resistor value).
  • tonyp12tonyp12 Posts: 1,951
    edited 2010-02-09 00:23
    The prop-board usb, only have the 3 color msb pins hooked up (8 different colors possible)
    manual·says it is·so to leve the options to use the other 3 pins for something else.

    How do you turn them off so waitvid does not effect them, i'm not sure right now.


    ·
  • localrogerlocalroger Posts: 3,452
    edited 2010-02-09 01:20
    Toby, in addition to zeroing the pins you don't want affected in the video control mask the driver probably has totally separate code that sets all the pins up as outputs. For the SD card, DO has to be an input and some of the code I've seen doesn't set that, probably because the author "knows" all the pins are configured as inputs on boot. Look for the code elsewhere in the driver that sets DIRA and make sure it's not interfering with the SD driver.
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-02-09 01:24
    localroger: Thanks. OK, it is working as a voltage divider with the 2 pins able to drive 3v3 or gnd with their series resistors joined at the R, G or B node with input impedance of 75R to gnd. The max voltage at the node should be <1Vp-p. So I presume the node voltage could be +2V max. I will work out the maths later.

    I have been looking at the 1-pin TV by ericball. That is a different method and uses single ended duty mode to generate the drive for the TV.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-02-09 05:21
    It certainly gets you thinking.
    Some of the relevant code in the dracblade (high res vga object) is here
      'implant pin settings
      reg_vcfg := $200000FF + (BasePin & %111000) << 6
      i := $FF << (BasePin & %011000)
      j := BasePin & %100000 == 0
      reg_dira := i & j
      reg_dirb := i & !j
    
    



    But there is so much more that needs changing

    To my way of thinking pins is proportional to speed. I use 12 and Cluso uses about 28 and yes his code is faster on pure ram access. But the zicog instructions still take time, so at the end of the day you can have a 3.5Mhz Z80 or maybe a 5Mhz one.

    But you give up some colors. Oh no!

    How many pins are you going to gain - maybe go from 12 to 16? It won't make much of a difference to the emulation speed.

    I guess the question is what you intend doing with a board. For me, I'm using it for a wireless network and the long range needs slow baud rates it doesn't matter if the code is slower and Basic running in CP/M is more than fast enough. I can still log into a remote board and interact with it wirelessly in a normal sort of way.

    But your application may help decide whether it is worth pulling the vga object to bits. (I know I wouldn't be game).

    With external ram I don't think you can make it any faster than Cluso's matchbox computer.

    But I think there might well be neater solutions, and the one that intrigues me is trying to reclaim up to 14k of hub ram lost from loading in cogs, then write a smart paging system that has the most used packets in hub ram and less used ones in external ram.

    Pondering this more, that may still not be faster than cluso's ramblade, as there is still the overhead of checking if a packet is in hub or not. 14k could store a lot - it could store all the commonly used bits of CP/M (eg conin and conout) and it would end up storing 0-FFH and it would end up with the program from 100H up, and if that program were small, maybe 10k, then the system might never access external ram. So if you hardly ever accessed external ram then that ram could be serial ram.

    But it involves a massive rewrite of the system. I spent 4 hours just trying to combine all the different spin objects in the dracblade into one spin object but there were so many variable names that then clashed that I gave up. And combining them all together could be the first step to making contiguous hub ram. I think cluso is trying to rewrite objects so they load their cogs through a common area of hub ram, but that is not easy either, and you probably need the source code for a spin compiler and/or a deep understanding of exactly how each object works.

    I'm particularly interested in the idea of an SPI or I2C ram chip using just a couple of lines as it frees up lots of pins for analog I/O and sound and maybe another serial port. I'd sacrifice more speed to get those things, but I'm not sure how to get there.

    Anyway, enough rambling. I suppose the question is what you would do with the ?3 pins you could save and which memory chip that could access.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-02-09 07:36
    It was never a quest for speed, bigger or better anything, I just want to clear as many as poss to do the SDRAM stuff. Then that would have to be reduced back as the gains and losses were balanced out. Back when I was trying to nail a Z80 to a demoboard I thought about minimal pin overheads.

    But most of all I have to get deep into the code at some point, and this is my interest/excuse ( and now even work is conspiring against it ) sad.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-02-09 20:43
    I think I've sussed it.



    'implant pin settings
    reg_vcfg := $2000000F + (BasePin & %111000) << 6
    i := $0F << (BasePin & %011000)
    j := BasePin & %100000 == 0
    reg_dira := i & j
    reg_dirb := i & !j


    I have taken $200000FF down to $2000000F, as expected and as suspected the DIRA bit required the i := $FF << (BasePin & %011000) needed to be i := $0F << (BasePin & %011000).

    PropCOMM now runs H+V suncs with two "colour pins" P16,P17,P18 AND P19 with the SD on P20,P21,P22 and P23.

    And DracBlade, with no ram. 18/20 free pins now for the experiments.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point

    Post Edited (Toby Seckshund) : 2/9/2010 9:43:46 PM GMT
    640 x 480 - 52K
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-02-09 22:37
    Ah so you now have only 1 or 0 for each color so 111 is white and 001 is blue (RGB)?

    I think I used dark blue for background and you might end up with a brighter blue but no problem. Re that screenshot, I see it is crashing out to the single step - ie zicog isn't loading or running so I presume you need to get that fixed (is that because you have no ram??)

    I guess if you really wanted lots of pins you could just use one serial port and a terminal program on the PC, and that would free up almost all the propeller pins. Anyway, if you have enough to start experimenting with ram then it is all systems go. What I did was to write a driver in spin first and test it one line at a time and eventually got it to the point it stored a byte, read that byte back and then flashed a led if the bytes matched. It was easier to debug spin. Then I translated that spin to pasm and put it in the ram driver object. And finally when that was working I copied that code into the zicog.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • tonyp12tonyp12 Posts: 1,951
    edited 2010-02-10 02:12
    Just wait, I have ordered the parts from digi-key.

    Using only 6 pins.
    128kB of fast memory in a 32k x 32-bit Organization
    SEQUENTIAL read and writes are as fast as other solutions that are using 16 pins.

    P.S. the 6 pins could share the pins with the SD card.
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-02-10 02:50
    Toby: Great work on getting VGA running with 4 pins.
    Now you have sussed it, maybe we can get reduce even further although the white on blue is nice smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • tonyp12tonyp12 Posts: 1,951
    edited 2010-02-10 03:31
    Should able to reduse one more pin.

    Hook up Blue vga pin to 3.3v for always on.

    hook up Red prop pin to R+G vga pins.

    Use red and black palette and you will now have a white and blue screen.
  • TubularTubular Posts: 4,717
    edited 2010-02-10 04:12
    Toby, great work

    If you get VGA working successfully on the lowest four pins (greyscale or white on blue etc), we may be able to use the upper four pins for SD card via the HD15 connector of the proto board. One can envisage a small HD15M to HD15F adapter card with uSD in the middle and possibly TV out too.

    It's possible to recover 4 outputs from the analog 'R' and 'G' pins using a LM339 or similar (ie recovering P20-23 on the other side of the VGA connector despite the fused 240 and 470 ohm resistors). Haven't had a chance to check for race conditions or how to incorporate the input data stream from the uSD card yet.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-02-10 07:40
    Dr_A

    At the present it is H + V syncs on P16 and P17, as usuall. The two "colour options" are P18 and P19, the two "blue ones"
    The White on Blue is actually a light grey. backgound blue, with the 270 Ohm red and greens added in. I haven't gone that deep into the real colours as the 470s and 270s seem to follow the Briel plan rather than the DemoBoard. Yes the crash is just because it can't see the ram, which isn't there, yet. The ram driver writings will follow your path.


    Tonyp12

    I tried the blue on all the time a while back, using the H sync signal rather than the +3.3 but the monitors clamps faught against it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-02-10 07:46
    Phil (PhiPi) showed an inverter/buffer (I use exclusive or) circuit for combining the HS & VS pins to one tristate pin. Perhaps by some other combination we can use the remaining gates so we can use a 2 pin VGA for white on blue (or whateve we can). The circuit has the same basics as I used on the LatchBlade. While obviously this is a little more complex, it will save pins.

    Toby, what value resistors are you using for that pic above?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-02-10 08:42
    Well done with these experiments. This is going to be a very useful addition, especially since 'text' programs only really need two colors anyway. You just have to choose those colors, and white on blue has my vote.

    So with the saved pins - you are going to do cunning RAM things and, hmm, I'm already thinking of another serial port on the dracblade (especially since the serial obex can do up to 4 ports so it is just a matter of a few lines of glue spin). Or - some analog I/O. And I'm sure there will be other uses.

    But, does this now give you enough spare pins for the ram experiments? How many pins do you have now?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-02-10 08:59
    Thanks Toby. Our posts crossed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-02-10 09:06
    At the moment all I have done is lash up my "lunchtime" demoboard which I had put lots of jumper links into so that the usuall suspects of Vid, VGA, KBD ... could be isolated so that the top breadboard could be used. So with some single strands of wire innards, the colours can be fed to the 15 pin plug via the usual 270/470 resistor pairs (pallette selection, by tweezers). I have to look at the way the software talks to the resistors as I think there is a reversal of the feeds (Briel like) but will have to check this properly latter tonight. There is a limit of the current feed on the pins, two lots of 270s would be ok but three might be a problem, although as with the other "Maximums" of the Prop it seems to cope. A dedicated triple driver chip would be more elegant and give the required 75 Ohms feeds. The setup at the present is RGB through 270s and the background blue through one 470. The background is·just a flat field so the "white" is a slightly blue light grey.

    Using the tristate gating of the syncs will help the pincount but doesn't the polarity of the syncs tell the monitor what the rate is? The two XORs would naturally give both negative going syncs (or VGA feeds, through inverters), the syncs would be ok in the DracBlade case but might need more inverters for·others. I will think about that one a bit more.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-02-10 10:12
    Toby: One XOR is setup as an iverter, the other a non-inverter (buffer). Both are set to be active low.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
Sign In or Register to comment.