This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DS90UB981-Q1: DSI输入,981 VP无输出

Part Number: DS90UB981-Q1

1.981和947均在本地初始化。脚本见附件

2.981的pattern--VP0--可以正常点亮947侧的LCD

3.开DSI,DSI时钟与数据信号正常示波器已量,981切换为DSI--VP0。当前排查981侧VP_total为0,无输出, 读寄存器发现pll_lock_lost ,异常 , 请问可能是什么问题,请帮忙解答一下
## TI Confidential - NDA Restrictions
## 
## Copyright 2018 Texas Instruments Incorporated. All rights reserved.
## 
## IMPORTANT: Your use of this Software is limited to those specific rights
## granted under the terms of a software license agreement between the user who
## downloaded the software, his/her employer (which must be your employer) and
## Texas Instruments Incorporated (the License). You may not use this Software
## unless you agree to abide by the terms of the License. The License limits your
## use, and you acknowledge, that the Software may not be modified, copied or
## distributed unless embedded on a Texas Instruments microcontroller which is
## integrated into your product. Other than for the foregoing purpose, you may
## not use, reproduce, copy, prepare derivative works of, modify, distribute,
## perform, display or sell this Software and/or its documentation for any
## purpose.
## 
## YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
## PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
## INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
## NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL TEXAS
## INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
## NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL
## EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT
## LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL
## DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS,
## TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT
## LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
## 
## Should you have any questions regarding your right to use this Software,
## contact Texas Instruments Incorporated at www.TI.com.
## 

## DS90xx98x-Q1 Auto Script Generation Output
## Tool Version 4.1


import time 
## Serializer: DS90Ux981-Q1
## User Inputs:
## Serializer I2C Address= 0x18
## Port 0 DSI Lanes = 4
## Port 0 DSI Rate = 745 Mbps/lane
## FPD-Link Configuration: FPD-Link IV Single Port 0 - 6.75Gbps


## Number of Displays = 1

## Video Processor 0 Properties:
## Total Horizontal Pixels = 2768
## Total Vertical Lines = 1494
## Active Horizontal Pixels = 2560
## Active Vertical Lines = 1440
## Horizontal Back Porch = 60
## Vertical Back Porch = 20
## Horizontal Sync = 60
## Vertical Sync = 2
## Horizontal Front Porch = 88
## Vertical Front Porch = 32
## Horizontal Sync Polarity = Negative
## Vertical Sync Polarity = Negative
## Bits per pixel = 24
## Pixel Clock = 248MHz
## PATGEN Enabled

## Deserializer 0: DS90Ux984-Q1
## User Inputs:
## Deserializer I2C Address = 0x58
## Deserializer I2C Alias = 0x58
## Override of DES eFuse enabled
## DP Port 0 Enabled
## DP0 Video Source = Serializer Stream 0
## DP Port 0 PatGen Enabled
## Patgen Video Properties:
## Total Horizontal Pixels = 2768
## Total Vertical Lines = 1494
## Active Horizontal Pixels = 2560
## Active Vertical Lines = 1440
## Horizontal Back Porch = 60
## Vertical Back Porch = 20
## Horizontal Sync = 60
## Vertical Sync = 2
## Horizontal Front Porch = 88
## Vertical Front Porch = 32
## Horizontal Sync Polarity = Negative
## Vertical Sync Polarity = Negative
## Bits per pixel = 24
## Pixel Clock = 248MHz
## DP Port 1 Disabled
## DP Port 1 PatGen Disabled
## DP Rate set to 2.7 Gbps
## DP lane number set to 4 lanes

## *********************************************
## Set up Variables
## *********************************************
serAddr = 0x18
desAddr0 = 0x58
desAlias0 = 0x58
board.WriteI2C(serAddr,0x70,desAddr0)
board.WriteI2C(serAddr,0x78,desAlias0)
board.WriteI2C(serAddr,0x88,0x0)

## *********************************************
## Check MODE Strapping
## *********************************************
FPD4_Strap_Rate_P0 = 0
FPD4_Strap_Rate_P1 = 0
SSCG_FDEV_STRAP = 0
SSCG_FMOD_STRAP = 0
SSCG_TYPE_STRAP = "none"
TX_MODE_STS = board.ReadI2C(serAddr,0x27,1)
if TX_MODE_STS == 0:
  print "Error: No Serializer Detected" 
GENERAL_CFG = board.ReadI2C(serAddr,0x7,1)
if GENERAL_CFG & 0x03 == 0x03:
  print "MODE Strapped for ADAS Mode" 
else:
  if TX_MODE_STS & 0x0F == 0x0F:
      print "MODE Strapped for FPD III Mode" 
      FPD4_Strap_Rate_P0 = 0
      FPD4_Strap_Rate_P1 = 0
  if TX_MODE_STS & 0x0F == 0x08 or TX_MODE_STS & 0x0F == 0x09:
      print "MODE Strapped for FPD IV 10.8Gbps" 
      FPD4_Strap_Rate_P0 = 10.8
      FPD4_Strap_Rate_P1 = 10.8
  if TX_MODE_STS & 0x0F == 0x0A or TX_MODE_STS & 0x0F == 0x0B:
      print "Warning: Invalid MODE Strap" 
      FPD4_Strap_Rate_P0 = 13.5
      FPD4_Strap_Rate_P1 = 13.5
  if TX_MODE_STS & 0x0F == 0x0C or TX_MODE_STS & 0x0F == 0x0D:
      print "MODE Strapped for FPD IV 6.75Gbps" 
      FPD4_Strap_Rate_P0 = 6.75
      FPD4_Strap_Rate_P1 = 6.75
  if TX_MODE_STS & 0x0F == 0x0E:
      print "MODE Strapped for FPD IV 3.375Gbps" 
      FPD4_Strap_Rate_P0 = 3.375
      FPD4_Strap_Rate_P1 = 3.375

## *********************************************
## Program DSI Configs
## *********************************************

Reg_value = board.ReadI2C(serAddr,0x2,1)
Reg_value = Reg_value | 0x8
board.WriteI2C(serAddr,0x2,Reg_value) #Disable DSI

board.WriteI2C(serAddr,0x2d,0x1) #Select port 0
board.WriteI2C(serAddr,0x40,0x10) #Change indirect page to page 4
board.WriteI2C(serAddr,0x41,0x5)
board.WriteI2C(serAddr,0x42,0x12) #Port 0 TSKIP value:9 

Reg_value = board.ReadI2C(serAddr,0x4f,1)
Reg_value = Reg_value & 0x73
Reg_value = Reg_value | 0x8c
board.WriteI2C(serAddr,0x4f,Reg_value) #Set number of lanes and continuous or non-continuous

board.WriteI2C(serAddr,0x2d,0x3) #Select write port 0 and 1
board.WriteI2C(serAddr,0xbd,0x0) #Set DSI source for the Video processors 0 and 1
board.WriteI2C(serAddr,0xbe,0x0) #Set DSI source for the Video processors 2 and 3
board.WriteI2C(serAddr,0x2d,0x1) #Select port 0


## *********************************************
## Program SER to FPD-Link IV mode
## *********************************************
board.WriteI2C(serAddr,0x5b,0x23) #Disable FPD3 FIFO pass through
board.WriteI2C(serAddr,0x5,0x2c) #Force FPD4_TX single port 0 mode

## *********************************************
## Set up FPD IV PLL Settings
## *********************************************
FPD0_Rate = 6.75
SSCG_FDEV_0 = 0
SSCG_FMOD_0 = 0
SSCG_TYPE_0 = "none"
if (FPD0_Rate != FPD4_Strap_Rate_P0) or (SSCG_FDEV_STRAP != SSCG_FDEV_0) or (SSCG_FMOD_STRAP != SSCG_FMOD_0) or (SSCG_TYPE_STRAP != SSCG_TYPE_0):
  print "FPD IV script rate mismatched with strapped rate for FPD Port 0 - Overriding Port 0 PLL settings"
  board.WriteI2C(serAddr,0x40,0x8) #Select PLL reg page
  board.WriteI2C(serAddr,0x41,0x1b)
  board.WriteI2C(serAddr,0x42,0x8) #Disable PLL0
board.WriteI2C(serAddr,0x40,0x8) #Select PLL reg page
board.WriteI2C(serAddr,0x41,0x5b)
board.WriteI2C(serAddr,0x42,0x8) #Disable PLL1
if GENERAL_CFG & 0x03 == 0x03:
  board.WriteI2C(serAddr,0x40,0x24)
  board.WriteI2C(serAddr,0x41,0x84)
  board.WriteI2C(serAddr,0x42,0x2) #Switch encoder from ADAS to IVI on port 0
if (FPD0_Rate != FPD4_Strap_Rate_P0) or (SSCG_FDEV_STRAP != SSCG_FDEV_0) or (SSCG_FMOD_STRAP != SSCG_FMOD_0) or (SSCG_TYPE_STRAP != SSCG_TYPE_0):
  board.WriteI2C(serAddr,0x40,0x8) #Select PLL page
  board.WriteI2C(serAddr,0x41,0x5) #Select Ncount Reg
  board.WriteI2C(serAddr,0x42,0x7d) #Set Ncount
  board.WriteI2C(serAddr,0x41,0x13) #Select post div reg
  board.WriteI2C(serAddr,0x42,0x90) #Set post div for 6.75 Gbps
  board.WriteI2C(serAddr,0x2d,0x1) #Select write reg to port 0
  board.WriteI2C(serAddr,0x6a,0xa) #set BC sampling rate
  board.WriteI2C(serAddr,0x6e,0x80) #set BC fractional sampling
  board.WriteI2C(serAddr,0x40,0x4) #Select FPD page and set BC settings for FPD IV port 0
  board.WriteI2C(serAddr,0x41,0x6)
  board.WriteI2C(serAddr,0x42,0x0)
  board.WriteI2C(serAddr,0x41,0xd)
  board.WriteI2C(serAddr,0x42,0x34)
  board.WriteI2C(serAddr,0x41,0xe)
  board.WriteI2C(serAddr,0x42,0x53)
if (FPD0_Rate != FPD4_Strap_Rate_P0) or (SSCG_FDEV_STRAP != SSCG_FDEV_0) or (SSCG_FMOD_STRAP != SSCG_FMOD_0) or (SSCG_TYPE_STRAP != SSCG_TYPE_0):
  board.WriteI2C(serAddr,0x2,0x11) #Set HALFRATE_MODE Override
  board.WriteI2C(serAddr,0x2,0x51) #Set HALFRATE_MODE
  board.WriteI2C(serAddr,0x2,0x50) #Unset HALFRATE_MODE Override

if (FPD0_Rate != FPD4_Strap_Rate_P0) or (SSCG_FDEV_STRAP != SSCG_FDEV_0) or (SSCG_FMOD_STRAP != SSCG_FMOD_0) or (SSCG_TYPE_STRAP != SSCG_TYPE_0):
  board.WriteI2C(serAddr,0x40,0x8) #Zero out fractional PLL for port 0
  board.WriteI2C(serAddr,0x41,0x4)
  board.WriteI2C(serAddr,0x42,0x1)
  board.WriteI2C(serAddr,0x41,0x14)
  board.WriteI2C(serAddr,0x42,0x80)
  board.WriteI2C(serAddr,0x41,0x15)
  board.WriteI2C(serAddr,0x42,0x0)
  board.WriteI2C(serAddr,0x41,0x16)
  board.WriteI2C(serAddr,0x42,0x0)
  board.WriteI2C(serAddr,0x41,0x17)
  board.WriteI2C(serAddr,0x42,0x0)
  board.WriteI2C(serAddr,0x41,0x18)
  board.WriteI2C(serAddr,0x42,0xf6)
  board.WriteI2C(serAddr,0x41,0x19)
  board.WriteI2C(serAddr,0x42,0xff)
  board.WriteI2C(serAddr,0x41,0x1a)
  board.WriteI2C(serAddr,0x42,0xff)
  board.WriteI2C(serAddr,0x41,0x1e)
  board.WriteI2C(serAddr,0x42,0x0)
  board.WriteI2C(serAddr,0x41,0x1f)
  board.WriteI2C(serAddr,0x42,0x0)
  board.WriteI2C(serAddr,0x41,0x20)
  board.WriteI2C(serAddr,0x42,0x0)

## *********************************************
## Configure and Enable PLLs
## *********************************************
if (FPD0_Rate != FPD4_Strap_Rate_P0) or (SSCG_FDEV_STRAP != SSCG_FDEV_0) or (SSCG_FMOD_STRAP != SSCG_FMOD_0) or (SSCG_TYPE_STRAP != SSCG_TYPE_0):
  board.WriteI2C(serAddr,0x40,0x8) #Select PLL page
  board.WriteI2C(serAddr,0x41,0xe) #Select VCO reg
  board.WriteI2C(serAddr,0x42,0xc7) #Set VCO
if (FPD0_Rate != FPD4_Strap_Rate_P0) or (SSCG_FDEV_STRAP != SSCG_FDEV_0) or (SSCG_FMOD_STRAP != SSCG_FMOD_0) or (SSCG_TYPE_STRAP != SSCG_TYPE_0):
  board.WriteI2C(serAddr,0x1,0x30) #soft reset PLL
if (FPD0_Rate != FPD4_Strap_Rate_P0) or (SSCG_FDEV_STRAP != SSCG_FDEV_0) or (SSCG_FMOD_STRAP != SSCG_FMOD_0) or (SSCG_TYPE_STRAP != SSCG_TYPE_0):
  board.WriteI2C(serAddr,0x40,0x8) #Select PLL page
  board.WriteI2C(serAddr,0x41,0x1b)
  board.WriteI2C(serAddr,0x42,0x0) #Enable PLL0
if (FPD0_Rate != FPD4_Strap_Rate_P0) or (SSCG_FDEV_STRAP != SSCG_FDEV_0) or (SSCG_FMOD_STRAP != SSCG_FMOD_0) or (SSCG_TYPE_STRAP != SSCG_TYPE_0):
  board.WriteI2C(serAddr,0x1,0x1) #soft reset Ser
  time.sleep(0.04)
  board.WriteI2C(desAlias0,0x1,0x1) #Soft reset Des
  time.sleep(0.04)

## *********************************************
## Enable I2C Passthrough
## *********************************************
print("Enable I2C Passthrough")
I2C_PASS_THROUGH = board.ReadI2C(serAddr,0x7,1)
I2C_PASS_THROUGH_MASK = 0x08
I2C_PASS_THROUGH_REG = I2C_PASS_THROUGH | I2C_PASS_THROUGH_MASK
board.WriteI2C(serAddr,0x07,I2C_PASS_THROUGH_REG) #Enable I2C Passthrough

board.WriteI2C(serAddr,0x2d,0x1) #Select write to port0 reg

## *********************************************
## Program VP Configs
## *********************************************
print("Configure Video Processors")
# Configure VP 0
board.WriteI2C(serAddr,0x40,0x32)
board.WriteI2C(serAddr,0x41,0x2)
board.WriteI2C(serAddr,0x42,0x0) #VID H Active
board.WriteI2C(serAddr,0x42,0xa) #VID H Active
board.WriteI2C(serAddr,0x41,0x10)
board.WriteI2C(serAddr,0x42,0x0) #Horizontal Active
board.WriteI2C(serAddr,0x42,0xa) #Horizontal Active
board.WriteI2C(serAddr,0x42,0x3c) #Horizontal Back Porch
board.WriteI2C(serAddr,0x42,0x0) #Horizontal Back Porch
board.WriteI2C(serAddr,0x42,0x3c) #Horizontal Sync
board.WriteI2C(serAddr,0x42,0x0) #Horizontal Sync
board.WriteI2C(serAddr,0x42,0xd0) #Horizontal Total
board.WriteI2C(serAddr,0x42,0xa) #Horizontal Total
board.WriteI2C(serAddr,0x42,0xa0) #Vertical Active
board.WriteI2C(serAddr,0x42,0x5) #Vertical Active
board.WriteI2C(serAddr,0x42,0x14) #Vertical Back Porch
board.WriteI2C(serAddr,0x42,0x0) #Vertical Back Porch
board.WriteI2C(serAddr,0x42,0x2) #Vertical Sync
board.WriteI2C(serAddr,0x42,0x0) #Vertical Sync
board.WriteI2C(serAddr,0x42,0x20) #Vertical Front Porch
board.WriteI2C(serAddr,0x42,0x0) #Vertical Front Porch
board.WriteI2C(serAddr,0x41,0x27)
board.WriteI2C(serAddr,0x42,0x6) #HSYNC Polarity = -, VSYNC Polarity = -
board.WriteI2C(serAddr,0x41,0x23) #M/N Register
board.WriteI2C(serAddr,0x42,0x7) #M value
board.WriteI2C(serAddr,0x42,0x2f) #M value
board.WriteI2C(serAddr,0x42,0xf) #N value


## *********************************************
## Enable PATGEN
## *********************************************
board.WriteI2C(serAddr,0x40,0x30)
board.WriteI2C(serAddr,0x41,0x29)
board.WriteI2C(serAddr,0x42,0x8) #Set PATGEN Color Depth to 24bpp for VP0
board.WriteI2C(serAddr,0x41,0x28)
print("Enable PATGEN on VP0")
board.WriteI2C(serAddr,0x42,0x95) #Enable PATGEN on VP0 - Comment out this line to disable PATGEN and enable end to end video

## *********************************************
## Enable VPs
## *********************************************
print("Enable Video Processors")
board.WriteI2C(serAddr,0x43,0x0) #Set number of VPs used = 1
board.WriteI2C(serAddr,0x44,0x1) #Enable video processors

## *********************************************
## Configure Serializer TX Link Layer
## *********************************************
print("Configure serializer TX link layer")
board.WriteI2C(serAddr,0x40,0x2e) #Link layer Reg page
board.WriteI2C(serAddr,0x41,0x1) #Link layer 0 stream enable
board.WriteI2C(serAddr,0x42,0x1) #Link layer 0 stream enable
board.WriteI2C(serAddr,0x41,0x6) #Link layer 0 time slot 0
board.WriteI2C(serAddr,0x42,0x41) #Link layer 0 time slot
board.WriteI2C(serAddr,0x41,0x20) #Set Link layer vp bpp
board.WriteI2C(serAddr,0x42,0x51) #Set Link layer vp bpp according to VP Bit per pixel
board.WriteI2C(serAddr,0x41,0x0) #Link layer 0 enable
board.WriteI2C(serAddr,0x42,0x3) #Link layer 0 enable


Reg_value = board.ReadI2C(serAddr,0x2,1)
Reg_value = Reg_value & 0xf7
board.WriteI2C(serAddr,0x2,Reg_value) #Enable DSI


## *********************************************
## Override DES 0 eFuse
## *********************************************
DES_READBACK = board.ReadI2C(desAlias0,0x0,1)
if DES_READBACK == 0:
  print "Error - no DES detected"
else:
  print "Deserializer detected successfuly"
board.WriteI2C(desAlias0,0x49,0xc)
board.WriteI2C(desAlias0,0x4a,0x0)
board.WriteI2C(desAlias0,0x48,0x1b)
UNIQUEID_Reg0xC = board.ReadI2C(desAlias0,0x4b,1)
if UNIQUEID_Reg0xC != 0x19:
  print "Non-Final DES Silicon Detected - Overriding DES eFuse"
  board.WriteI2C(desAlias0,0xe,0x3)
  board.WriteI2C(desAlias0,0x61,0x0)
  board.WriteI2C(desAlias0,0x5a,0x74)
  board.WriteI2C(desAlias0,0x5f,0x4)
  board.WriteI2C(desAlias0,0x40,0x3c)
  board.WriteI2C(desAlias0,0x41,0xf5)
  board.WriteI2C(desAlias0,0x42,0x21)
  board.WriteI2C(desAlias0,0x40,0x54)
  board.WriteI2C(desAlias0,0x41,0x43)
  board.WriteI2C(desAlias0,0x42,0x3)
  board.WriteI2C(desAlias0,0x40,0x58)
  board.WriteI2C(desAlias0,0x41,0x43)
  board.WriteI2C(desAlias0,0x42,0x3)
  board.WriteI2C(desAlias0,0x40,0x54)
  board.WriteI2C(desAlias0,0x41,0x5)
  board.WriteI2C(desAlias0,0x42,0x0)
  board.WriteI2C(desAlias0,0x40,0x58)
  board.WriteI2C(desAlias0,0x41,0x5)
  board.WriteI2C(desAlias0,0x42,0x0)
  board.WriteI2C(desAlias0,0x40,0x54)
  board.WriteI2C(desAlias0,0x41,0x6)
  board.WriteI2C(desAlias0,0x42,0x1)
  board.WriteI2C(desAlias0,0x40,0x58)
  board.WriteI2C(desAlias0,0x41,0x6)
  board.WriteI2C(desAlias0,0x42,0x1)
  board.WriteI2C(desAlias0,0x40,0x54)
  board.WriteI2C(desAlias0,0x41,0x37)
  board.WriteI2C(desAlias0,0x42,0x32)
  board.WriteI2C(desAlias0,0x40,0x58)
  board.WriteI2C(desAlias0,0x41,0x37)
  board.WriteI2C(desAlias0,0x42,0x32)
  board.WriteI2C(desAlias0,0x40,0x54)
  board.WriteI2C(desAlias0,0x41,0x8d)
  board.WriteI2C(desAlias0,0x42,0xff)
  board.WriteI2C(desAlias0,0x40,0x58)
  board.WriteI2C(desAlias0,0x41,0x8d)
  board.WriteI2C(desAlias0,0x42,0xff)
  board.WriteI2C(desAlias0,0x40,0x5c)
  board.WriteI2C(desAlias0,0x41,0x20)
  board.WriteI2C(desAlias0,0x42,0x3c)
  board.WriteI2C(desAlias0,0x40,0x5c)
  board.WriteI2C(desAlias0,0x41,0xa0)
  board.WriteI2C(desAlias0,0x42,0x3c)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x24)
  board.WriteI2C(desAlias0,0x42,0x61)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x54)
  board.WriteI2C(desAlias0,0x42,0x61)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x2c)
  board.WriteI2C(desAlias0,0x42,0x19)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x5c)
  board.WriteI2C(desAlias0,0x42,0x19)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x2e)
  board.WriteI2C(desAlias0,0x42,0x0)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x5e)
  board.WriteI2C(desAlias0,0x42,0x0)
  board.WriteI2C(desAlias0,0x40,0x10)
  board.WriteI2C(desAlias0,0x41,0x18)
  board.WriteI2C(desAlias0,0x42,0x4b)
  board.WriteI2C(desAlias0,0x40,0x10)
  board.WriteI2C(desAlias0,0x41,0x38)
  board.WriteI2C(desAlias0,0x42,0x4b)
  board.WriteI2C(desAlias0,0x40,0x54)
  board.WriteI2C(desAlias0,0x41,0x15)
  board.WriteI2C(desAlias0,0x42,0x0)
  board.WriteI2C(desAlias0,0x40,0x58)
  board.WriteI2C(desAlias0,0x41,0x15)
  board.WriteI2C(desAlias0,0x42,0x0)
  board.WriteI2C(desAlias0,0x40,0x54)
  board.WriteI2C(desAlias0,0x41,0x4a)
  board.WriteI2C(desAlias0,0x42,0x1)
  board.WriteI2C(desAlias0,0x40,0x58)
  board.WriteI2C(desAlias0,0x41,0x4a)
  board.WriteI2C(desAlias0,0x42,0x1)
  board.WriteI2C(desAlias0,0x40,0x54)
  board.WriteI2C(desAlias0,0x41,0xaa)
  board.WriteI2C(desAlias0,0x42,0x2c)
  board.WriteI2C(desAlias0,0x40,0x58)
  board.WriteI2C(desAlias0,0x41,0xaa)
  board.WriteI2C(desAlias0,0x42,0x2c)
  board.WriteI2C(desAlias0,0x40,0x54)
  board.WriteI2C(desAlias0,0x41,0xab)
  board.WriteI2C(desAlias0,0x42,0x2c)
  board.WriteI2C(desAlias0,0x40,0x58)
  board.WriteI2C(desAlias0,0x41,0xab)
  board.WriteI2C(desAlias0,0x42,0x2c)
  board.WriteI2C(desAlias0,0x40,0x54)
  board.WriteI2C(desAlias0,0x41,0xac)
  board.WriteI2C(desAlias0,0x42,0x4c)
  board.WriteI2C(desAlias0,0x40,0x58)
  board.WriteI2C(desAlias0,0x41,0xac)
  board.WriteI2C(desAlias0,0x42,0x4c)
  board.WriteI2C(desAlias0,0x40,0x54)
  board.WriteI2C(desAlias0,0x41,0xad)
  board.WriteI2C(desAlias0,0x42,0x4c)
  board.WriteI2C(desAlias0,0x40,0x58)
  board.WriteI2C(desAlias0,0x41,0xad)
  board.WriteI2C(desAlias0,0x42,0x4c)
  board.WriteI2C(desAlias0,0x40,0x54)
  board.WriteI2C(desAlias0,0x41,0xae)
  board.WriteI2C(desAlias0,0x42,0xac)
  board.WriteI2C(desAlias0,0x40,0x58)
  board.WriteI2C(desAlias0,0x41,0xae)
  board.WriteI2C(desAlias0,0x42,0xac)
  board.WriteI2C(desAlias0,0x40,0x54)
  board.WriteI2C(desAlias0,0x41,0xaf)
  board.WriteI2C(desAlias0,0x42,0xac)
  board.WriteI2C(desAlias0,0x40,0x58)
  board.WriteI2C(desAlias0,0x41,0xaf)
  board.WriteI2C(desAlias0,0x42,0xac)
  board.WriteI2C(desAlias0,0x40,0x10)
  board.WriteI2C(desAlias0,0x41,0x5)
  board.WriteI2C(desAlias0,0x42,0xa)
  board.WriteI2C(desAlias0,0x40,0x10)
  board.WriteI2C(desAlias0,0x41,0x25)
  board.WriteI2C(desAlias0,0x42,0xa)
  board.WriteI2C(desAlias0,0x40,0x54)
  board.WriteI2C(desAlias0,0x41,0x89)
  board.WriteI2C(desAlias0,0x42,0x38)
  board.WriteI2C(desAlias0,0x40,0x58)
  board.WriteI2C(desAlias0,0x41,0x89)
  board.WriteI2C(desAlias0,0x42,0x38)
  board.WriteI2C(desAlias0,0x40,0x10)
  board.WriteI2C(desAlias0,0x41,0x1a)
  board.WriteI2C(desAlias0,0x42,0x8)
  board.WriteI2C(desAlias0,0x40,0x10)
  board.WriteI2C(desAlias0,0x41,0x3a)
  board.WriteI2C(desAlias0,0x42,0x8)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x6f)
  board.WriteI2C(desAlias0,0x42,0x54)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x70)
  board.WriteI2C(desAlias0,0x42,0x5)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x80)
  board.WriteI2C(desAlias0,0x42,0x55)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x81)
  board.WriteI2C(desAlias0,0x42,0x44)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x82)
  board.WriteI2C(desAlias0,0x42,0x3)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x86)
  board.WriteI2C(desAlias0,0x42,0x2c)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x87)
  board.WriteI2C(desAlias0,0x42,0x6)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x18)
  board.WriteI2C(desAlias0,0x42,0x32)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x48)
  board.WriteI2C(desAlias0,0x42,0x32)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x19)
  board.WriteI2C(desAlias0,0x42,0xe)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x49)
  board.WriteI2C(desAlias0,0x42,0xe)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x17)
  board.WriteI2C(desAlias0,0x42,0x72)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x47)
  board.WriteI2C(desAlias0,0x42,0x72)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x26)
  board.WriteI2C(desAlias0,0x42,0x87)
  board.WriteI2C(desAlias0,0x40,0x38)
  board.WriteI2C(desAlias0,0x41,0x56)
  board.WriteI2C(desAlias0,0x42,0x87)
  board.WriteI2C(desAlias0,0x40,0x2c)
  board.WriteI2C(desAlias0,0x41,0x3d)
  board.WriteI2C(desAlias0,0x42,0xd5)
  board.WriteI2C(desAlias0,0x40,0x2c)
  board.WriteI2C(desAlias0,0x41,0x3e)
  board.WriteI2C(desAlias0,0x42,0x15)
  board.WriteI2C(desAlias0,0x40,0x2c)
  board.WriteI2C(desAlias0,0x41,0x7d)
  board.WriteI2C(desAlias0,0x42,0xd5)
  board.WriteI2C(desAlias0,0x40,0x2c)
  board.WriteI2C(desAlias0,0x41,0x7e)
  board.WriteI2C(desAlias0,0x42,0x15)
  board.WriteI2C(desAlias0,0x40,0x2c)
  board.WriteI2C(desAlias0,0x41,0x82)
  board.WriteI2C(desAlias0,0x42,0x1)
  board.WriteI2C(desAlias0,0x40,0x2c)
  board.WriteI2C(desAlias0,0x41,0x29)
  board.WriteI2C(desAlias0,0x42,0x0)
  board.WriteI2C(desAlias0,0x40,0x10)
  board.WriteI2C(desAlias0,0x41,0x41)
  board.WriteI2C(desAlias0,0x42,0x0)
  board.WriteI2C(desAlias0,0x40,0x10)
  board.WriteI2C(desAlias0,0x41,0x42)
  board.WriteI2C(desAlias0,0x42,0x0)
  board.WriteI2C(desAlias0,0x40,0x24)
  board.WriteI2C(desAlias0,0x41,0x20)
  board.WriteI2C(desAlias0,0x42,0x0)
  board.WriteI2C(desAlias0,0x40,0x24)
  board.WriteI2C(desAlias0,0x41,0x21)
  board.WriteI2C(desAlias0,0x42,0x0)
  board.WriteI2C(desAlias0,0x40,0x24)
  board.WriteI2C(desAlias0,0x41,0x23)
  board.WriteI2C(desAlias0,0x42,0x30)
  board.WriteI2C(desAlias0,0x40,0x10)
  board.WriteI2C(desAlias0,0x41,0x14)
  board.WriteI2C(desAlias0,0x42,0x78)
  board.WriteI2C(desAlias0,0x40,0x10)
  board.WriteI2C(desAlias0,0x41,0x35)
  board.WriteI2C(desAlias0,0x42,0x7e)
  board.WriteI2C(desAlias0,0x40,0x6c)
  board.WriteI2C(desAlias0,0x41,0xd)
  board.WriteI2C(desAlias0,0x42,0x0)
  board.WriteI2C(desAlias0,0x40,0x1c)
  board.WriteI2C(desAlias0,0x41,0x8)
  board.WriteI2C(desAlias0,0x42,0x13)
  board.WriteI2C(desAlias0,0x40,0x1c)
  board.WriteI2C(desAlias0,0x41,0x28)
  board.WriteI2C(desAlias0,0x42,0x13)
  board.WriteI2C(desAlias0,0x40,0x14)
  board.WriteI2C(desAlias0,0x41,0x62)
  board.WriteI2C(desAlias0,0x42,0x31)
  board.WriteI2C(desAlias0,0x40,0x14)
  board.WriteI2C(desAlias0,0x41,0x72)
  board.WriteI2C(desAlias0,0x42,0x31)
  board.WriteI2C(desAlias0,0x40,0x14)
  board.WriteI2C(desAlias0,0x41,0x61)
  board.WriteI2C(desAlias0,0x42,0x26)
  board.WriteI2C(desAlias0,0x1,0x1) #Soft Reset DES
  time.sleep(0.04)

## *********************************************
## Read Deserializer 0 Temp
## *********************************************
print("Configure deserializer 0 temp ramp optimizations")
board.WriteI2C(desAlias0,0x40,0x6c)
board.WriteI2C(desAlias0,0x41,0xd)
board.WriteI2C(desAlias0,0x42,0x0)
board.WriteI2C(desAlias0,0x41,0x13)
TEMP_FINAL = board.ReadI2C(desAlias0,0x42,1)
TEMP_FINAL_C = 2*TEMP_FINAL - 273
print "Deserializer 0 starting temp =", TEMP_FINAL_C, "C"

## *********************************************
## Set up Deserializer 0 Temp Ramp Optimizations
## *********************************************
Efuse_TS_CODE = 2
Ramp_UP_Range_CODES_Needed = int((150-TEMP_FINAL_C)/(190/11)) + 1
Ramp_DN_Range_CODES_Needed = int((TEMP_FINAL_C-30)/(190/11)) + 1
Ramp_UP_CAP_DELTA = Ramp_UP_Range_CODES_Needed - 4
Ramp_DN_CAP_DELTA = Ramp_DN_Range_CODES_Needed - 7

board.WriteI2C(desAlias0,0x40,0x3c)
board.WriteI2C(desAlias0,0x41,0xf5)
board.WriteI2C(desAlias0,0x42,(Efuse_TS_CODE<<4)+1) # Override TS_CODE Efuse Code
if Ramp_UP_CAP_DELTA > 0:
  print("Adjusting ramp up and resetting DES")
  TS_CODE_UP = Efuse_TS_CODE - Ramp_UP_CAP_DELTA
  if TS_CODE_UP < 0:
      TS_CODE_UP = 0
  board.WriteI2C(desAlias0,0x41,0xf5)
  rb = board.ReadI2C(desAlias0,0x42,1)
  rb &= 0x8F
  rb |= (TS_CODE_UP << 4)
  board.WriteI2C(desAlias0,0x42,rb)
  rb = board.ReadI2C(desAlias0,0x42,1)
  rb &= 0xFE
  rb |= 0x01
  board.WriteI2C(desAlias0,0x42,rb)
  board.WriteI2C(desAlias0,0x1,0x1)
  time.sleep(0.04)
if Ramp_DN_CAP_DELTA > 0:
  print("Adjusting ramp down and resetting DES")
  TS_CODE_DN = Efuse_TS_CODE + Ramp_DN_CAP_DELTA
  if TS_CODE_DN >= 7:
      TS_CODE_DN = 7
  board.WriteI2C(desAlias0,0x41,0xf5)
  rb = board.ReadI2C(desAlias0,0x42,1)
  rb &= 0x8F
  rb |= (TS_CODE_DN << 4)
  board.WriteI2C(desAlias0,0x42,rb)
  rb = board.ReadI2C(desAlias0,0x42,1)
  rb &= 0xFE
  rb |= 0x01
  board.WriteI2C(desAlias0,0x42,rb)
  board.WriteI2C(desAlias0,0x1,0x1)
  time.sleep(0.04)

## *********************************************
## Clear CRC errors from initial link process
## *********************************************
print("Clear CRC errors from initial link process")

Reg_value = board.ReadI2C(serAddr,0x2,1)
Reg_value = Reg_value | 0x20
board.WriteI2C(serAddr,0x2,Reg_value) #CRC Error Reset

Reg_value = board.ReadI2C(serAddr,0x2,1)
Reg_value = Reg_value & 0xdf
board.WriteI2C(serAddr,0x2,Reg_value) #CRC Error Reset Clear

board.WriteI2C(serAddr,0x2d,0x1)

## *********************************************
## Hold Des DTG in reset
## *********************************************
print("Hold Des 0 DTG in reset and configure video settings")
board.WriteI2C(desAlias0,0x40,0x50) #Select DTG Page
board.WriteI2C(desAlias0,0x41,0x32)
board.WriteI2C(desAlias0,0x42,0x6) #Hold Local Display Output Port 0 DTG in Reset
board.WriteI2C(desAlias0,0x41,0x62)
board.WriteI2C(desAlias0,0x42,0x6) #Hold Local Display Output Port 1 DTG in Reset


## *********************************************
## Disable Stream Mapping
## *********************************************
board.WriteI2C(desAlias0,0xe,0x3) #Select both Output Ports
board.WriteI2C(desAlias0,0xd0,0x0) #Disable FPD4 video forward to Output Port
board.WriteI2C(desAlias0,0xd7,0x0) #Disable FPD3 video forward to Output Port


## *********************************************
## Force DP Rate
## *********************************************
board.WriteI2C(desAlias0,0x40,0x2c) #Select DP Page
board.WriteI2C(desAlias0,0x41,0x81)
board.WriteI2C(desAlias0,0x42,0x60) #Set DP Rate to 2.7Gbps
board.WriteI2C(desAlias0,0x41,0x82)
board.WriteI2C(desAlias0,0x42,0x3) #Enable force DP rate with calibration disabled
board.WriteI2C(desAlias0,0x40,0x2c) #Select DP Page
board.WriteI2C(desAlias0,0x41,0x91)
board.WriteI2C(desAlias0,0x42,0xc) #Force 4 lanes
board.WriteI2C(desAlias0,0x40,0x30) #Disable DP SSCG
board.WriteI2C(desAlias0,0x41,0xf)
board.WriteI2C(desAlias0,0x42,0x1)
board.WriteI2C(desAlias0,0x1,0x40)


## *********************************************
## Setup DP ports
## *********************************************
board.WriteI2C(desAlias0,0xe,0x12) #Select Port 1 registers
board.WriteI2C(desAlias0,0x46,0x0) #Disable DP Port 1
board.WriteI2C(desAlias0,0xe,0x1) #Select Port 0 registers
board.WriteI2C(desAlias0,0x1,0x40) #DP-TX-PLL RESET Applied


## *********************************************
## Map video to display output
## *********************************************
board.WriteI2C(desAlias0,0xe,0x3) #Select both Output Ports
board.WriteI2C(desAlias0,0xd0,0xc) #Enable FPD_RX video forward to Output Port
board.WriteI2C(desAlias0,0xd1,0xf) #Every stream forwarded on DC
board.WriteI2C(desAlias0,0xd6,0x8) #Send Stream 0 to Output Port 0 and Send Stream 1 to Output Port 1
board.WriteI2C(desAlias0,0xd7,0x0) #FPD3 to local display output mapping disabled
board.WriteI2C(desAlias0,0xe,0x1) #Select Port 0 


## *********************************************
## Set up deserializer Patgen
## *********************************************
board.WriteI2C(desAlias0,0x40,0x50) #Set Patgen page
board.WriteI2C(desAlias0,0x41,0x1) #Set patgen address
board.WriteI2C(desAlias0,0x42,0xc) #Set bit per pixel
board.WriteI2C(desAlias0,0x41,0x2) #Set patgen address
board.WriteI2C(desAlias0,0x42,0x86) #Set patgen address auto increment
board.WriteI2C(desAlias0,0x41,0x3) #Set patgen address
board.WriteI2C(desAlias0,0x42,0xd0) #Set patgen THW
board.WriteI2C(desAlias0,0x42,0xa) #Set patgen THW
board.WriteI2C(desAlias0,0x42,0xd6) #Set patgen TVW
board.WriteI2C(desAlias0,0x42,0x5) #Set patgen TVW
board.WriteI2C(desAlias0,0x42,0x0) #Set patgen AHW
board.WriteI2C(desAlias0,0x42,0xa) #Set patgen AHW
board.WriteI2C(desAlias0,0x42,0xa0) #Set patgen AVW
board.WriteI2C(desAlias0,0x42,0x5) #Set patgen AVW
board.WriteI2C(desAlias0,0x42,0x3c) #Set patgen HSW
board.WriteI2C(desAlias0,0x42,0x0) #Set patgen HSW
board.WriteI2C(desAlias0,0x42,0x2) #Set patgen VSW
board.WriteI2C(desAlias0,0x42,0x0) #Set patgen VSW
board.WriteI2C(desAlias0,0x42,0x3c) #Set patgen HBP
board.WriteI2C(desAlias0,0x42,0x0) #Set patgen HBP
board.WriteI2C(desAlias0,0x42,0x14) #Set patgen VBP
board.WriteI2C(desAlias0,0x42,0x0) #Set patgen VBP
board.WriteI2C(desAlias0,0x42,0x3) #HSYNC Polarity = -, VSYNC Polarity = -
board.WriteI2C(desAlias0,0x41,0x0) #Set patgen address
board.WriteI2C(desAlias0,0x42,0x95) #Enable Patgen color bar


## *********************************************
## Program quad pixel clock for DP port 0
## *********************************************
board.WriteI2C(desAlias0,0xe,0x1) #Select Port0 registers
board.WriteI2C(desAlias0,0xb1,0x1) #Enable clock divider
board.WriteI2C(desAlias0,0xb2,0xc0) #Program M value lower byte
board.WriteI2C(desAlias0,0xb3,0xc8) #Program M value middle byte
board.WriteI2C(desAlias0,0xb4,0x3) #Program M value upper byte
board.WriteI2C(desAlias0,0xb5,0xc0) #Program N value lower byte
board.WriteI2C(desAlias0,0xb6,0x7a) #Program N value middle byte
board.WriteI2C(desAlias0,0xb7,0x10) #Program N value upper byte
board.WriteI2C(desAlias0,0xe,0x1) #Select Port 0 registers


## *********************************************
## Setup DTG for port 0
## *********************************************
board.WriteI2C(desAlias0,0x40,0x50) #Select DTG Page
board.WriteI2C(desAlias0,0x41,0x20)
board.WriteI2C(desAlias0,0x42,0x9f) #Set up Local Display DTG BPP, Sync Polarities, and Measurement Type
board.WriteI2C(desAlias0,0x41,0x29) #Set Hstart
board.WriteI2C(desAlias0,0x42,0x80) #Hstart upper byte
board.WriteI2C(desAlias0,0x41,0x2a)
board.WriteI2C(desAlias0,0x42,0x78) #Hstart lower byte
board.WriteI2C(desAlias0,0x41,0x2f) #Set HSW
board.WriteI2C(desAlias0,0x42,0x40) #HSW upper byte
board.WriteI2C(desAlias0,0x41,0x30)
board.WriteI2C(desAlias0,0x42,0x3c) #HSW lower byte


## *********************************************
## Program DPTX for DP port 0
## *********************************************
board.WriteI2C(desAlias0,0x48,0x1) #Enable APB interface
board.WriteI2C(desAlias0,0x48,0x1)
board.WriteI2C(desAlias0,0x49,0xa4) #Set bit per color
board.WriteI2C(desAlias0,0x4a,0x1)
board.WriteI2C(desAlias0,0x4b,0x20)
board.WriteI2C(desAlias0,0x4c,0x0)
board.WriteI2C(desAlias0,0x4d,0x0)
board.WriteI2C(desAlias0,0x4e,0x0)

board.WriteI2C(desAlias0,0x48,0x1)
board.WriteI2C(desAlias0,0x49,0xb8) #Set pixel width
board.WriteI2C(desAlias0,0x4a,0x1)
board.WriteI2C(desAlias0,0x4b,0x4)
board.WriteI2C(desAlias0,0x4c,0x0)
board.WriteI2C(desAlias0,0x4d,0x0)
board.WriteI2C(desAlias0,0x4e,0x0)

board.WriteI2C(desAlias0,0x48,0x1)
board.WriteI2C(desAlias0,0x49,0xac) #Set DP Mvid
board.WriteI2C(desAlias0,0x4a,0x1)
board.WriteI2C(desAlias0,0x4b,0x92)
board.WriteI2C(desAlias0,0x4c,0x75)
board.WriteI2C(desAlias0,0x4d,0x0)
board.WriteI2C(desAlias0,0x4e,0x0)

board.WriteI2C(desAlias0,0x48,0x1)
board.WriteI2C(desAlias0,0x49,0xb4) #Set DP Nvid
board.WriteI2C(desAlias0,0x4a,0x1)
board.WriteI2C(desAlias0,0x4b,0x0)
board.WriteI2C(desAlias0,0x4c,0x80)
board.WriteI2C(desAlias0,0x4d,0x0)
board.WriteI2C(desAlias0,0x4e,0x0)

board.WriteI2C(desAlias0,0x48,0x1)
board.WriteI2C(desAlias0,0x49,0xc8) #Set TU Mode
board.WriteI2C(desAlias0,0x4a,0x1)
board.WriteI2C(desAlias0,0x4b,0x0)
board.WriteI2C(desAlias0,0x4c,0x0)
board.WriteI2C(desAlias0,0x4d,0x0)
board.WriteI2C(desAlias0,0x4e,0x0)

board.WriteI2C(desAlias0,0x48,0x1)
board.WriteI2C(desAlias0,0x49,0xb0) #Set TU Size
board.WriteI2C(desAlias0,0x4a,0x1)
board.WriteI2C(desAlias0,0x4b,0x40)
board.WriteI2C(desAlias0,0x4c,0x0)
board.WriteI2C(desAlias0,0x4d,0x2c)
board.WriteI2C(desAlias0,0x4e,0x2)

board.WriteI2C(desAlias0,0x48,0x1)
board.WriteI2C(desAlias0,0x49,0xc8) #Set FIFO Size
board.WriteI2C(desAlias0,0x4a,0x0)
board.WriteI2C(desAlias0,0x4b,0x6)
board.WriteI2C(desAlias0,0x4c,0x40)
board.WriteI2C(desAlias0,0x4d,0x0)
board.WriteI2C(desAlias0,0x4e,0x0)

board.WriteI2C(desAlias0,0x48,0x1)
board.WriteI2C(desAlias0,0x49,0xbc) #Set data count
board.WriteI2C(desAlias0,0x4a,0x1)
board.WriteI2C(desAlias0,0x4b,0x80)
board.WriteI2C(desAlias0,0x4c,0x7)
board.WriteI2C(desAlias0,0x4d,0x0)
board.WriteI2C(desAlias0,0x4e,0x0)

board.WriteI2C(desAlias0,0x48,0x1)
board.WriteI2C(desAlias0,0x49,0xc0) #Disable STREAM INTERLACED
board.WriteI2C(desAlias0,0x4a,0x1)
board.WriteI2C(desAlias0,0x4b,0x0)
board.WriteI2C(desAlias0,0x4c,0x0)
board.WriteI2C(desAlias0,0x4d,0x0)
board.WriteI2C(desAlias0,0x4e,0x0)

board.WriteI2C(desAlias0,0x48,0x1)
board.WriteI2C(desAlias0,0x49,0xc4) #Set SYNC polarity
board.WriteI2C(desAlias0,0x4a,0x1)
board.WriteI2C(desAlias0,0x4b,0xc)
board.WriteI2C(desAlias0,0x4c,0x0)
board.WriteI2C(desAlias0,0x4d,0x0)
board.WriteI2C(desAlias0,0x4e,0x0)



## *********************************************
## Release Des DTG reset
## *********************************************
print("Release Des 0 DTG reset and enable video output")
board.WriteI2C(desAlias0,0x40,0x50) #Select DTG Page
board.WriteI2C(desAlias0,0x41,0x32)
board.WriteI2C(desAlias0,0x42,0x4) #Release Local Display Output Port 0 DTG
board.WriteI2C(desAlias0,0x41,0x62)
board.WriteI2C(desAlias0,0x42,0x4) #Release Local Display Output Port 1 DTG


board.WriteI2C(desAlias0,0x48,0x1)
board.WriteI2C(desAlias0,0x49,0x80) #Set Htotal
board.WriteI2C(desAlias0,0x4a,0x1)
board.WriteI2C(desAlias0,0x4b,0xd0)
board.WriteI2C(desAlias0,0x4c,0xa)
board.WriteI2C(desAlias0,0x4d,0x0)
board.WriteI2C(desAlias0,0x4e,0x0)

## *********************************************
## Enable DP 0 output
## *********************************************
board.WriteI2C(desAlias0,0x48,0x1)
board.WriteI2C(desAlias0,0x49,0x84) #Enable DP output
board.WriteI2C(desAlias0,0x4a,0x0)
board.WriteI2C(desAlias0,0x4b,0x1)
board.WriteI2C(desAlias0,0x4c,0x0)
board.WriteI2C(desAlias0,0x4d,0x0)
board.WriteI2C(desAlias0,0x4e,0x0)