Shop OBEX P1 Docs P2 Docs Learn Events
Trying to change output pins in TV Driver v1.0 — Parallax Forums

Trying to change output pins in TV Driver v1.0

Looked all over this file and in the forums and can't seem to find the part that defines the output pins for the composite video signal.
at line 214 it has this:
mov t1,_pins 'set video pins and directions
test t1,#$08 wc
if_nc mov t2,pins0
if_c mov t2,pins1
test t1,#$40 wc
shr t1,#1
shl t1,#3
shr t2,t1
movs vcfg,t2
shr t1,#6
movd vcfg,t1
shl t1,#3
and t2,#$FF
shl t2,t1
if_nc mov dira,t2
if_nc mov dirb,#0
if_c mov dira,#0
if_c mov dirb,t2 '+18


But i cant make sense of this,

ive seen video pins defined like this before:
%0000 -> %0000_0111 (pins 24, 25, 26)
%0101 -> %0111_0000 (pins 12, 13, 14)

if anyone can help id be very grateful.

Rob

Comments

  • The parameters used by the TV object need to be listed correctly in the parent object's RAM. This group of parameters is passed to the TV object with the "tvptr" variable.

    Now how one sets the pins in the parent object's RAM isn't very clear from looking at some example objects.

    Both "TV_Terminal" and "TV_Text" use this line of code to set the pins.
    tvparams_pins := (basepin & $38) << 1 | (basepin & 4 == 4) & %0101
    

    I understand each part of the above code but I don't understand why the above code is used.

    Are you aware the base pin needs to be a multiple of 4?

    My suggestion would be to look at the two objects I mentioned earlier along with their demo objects (in the Library\_Demos folder) and use the same code to set your base pin.

    At least this is my suggestion until you get an answer from someone who understands the TV object better than myself.
Sign In or Register to comment.