阅读:1683回复:8
[求助]紧急!T100 OSD问题
现在的问题是:OSD只能显示一行。
A2h和A3h(ORAM_AL/ORAM_AH)应该怎么设置?我现在只能是2E0h才能显示一行字,改到其他值就没有显示。不知应该注意哪些寄存器? 不知哪位老大有用过T100,能否指导一下或提供一份关于OSD部分的代码参考?万分感谢! 486x586@163.com [此贴子已经被作者于2006-1-20 17:28:56编辑过]
|
|
|
2楼#
发布于:2006-01-20 00:37
<P>“<FONT color=#003366>PTC(T100) 7 寸TFT 51源程序</FONT> ”</P> <P>如果不是,能否交换一份啊?我急用啊!万分感谢!</P> |
|
|
3楼#
发布于:2006-01-20 04:35
//--------------------------------------------------------------------------- // Terawins Inc. Company Confidential Strictly Private // // $Archive: Main.c $ // $Revision: 1.01 $ // $Author: JasonGuo $ // $Date: 2004/05/06 $ // // -------------------------------------------------------------------------- // >>>>>>>>>>>>>>>>>>>>>>>>> COPYRIGHT NOTICE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< // -------------------------------------------------------------------------- // Copyright 2004 (c) Terawins Inc. // // This is an unpublished work. // -------------------------------------------------------------------------- #include "reg51.h" #include "math.h" #include "common.h" #include "system.h" #include "struct.h" #include "TW101Reg.h" #include "twowire.h" #include "gamma.h" #include "filter.h" #include "keypad.h" #include "Nvram.h" #include "Video.h" #include "T101_Util.h" #include "remote.h" #include "osddraw.h" //**************************************************************************** // Private Function Prototypes //**************************************************************************** void Initial (void); void SysInit (void); void InitFactry (void); void SysInterruptEnable (void); void ClosePanel (void); void OpenPanel (void); void BKPower (void); void PowerManage (void); void InitPt2313 (void); //void Exchange_PAL_NTSC (void); //Kuo void RegisterSetting(void); #ifdef TIMER0 void Timer0Reset (void); void Timer0Start (void); void Timer0Stop (void); #endif uCHAR bdata Flag1; uCHAR bdata Flag2; uCHAR bdata Flag3; uCHAR idata m_cOSDEvent; uCHAR idata m_cOSDFunc; uCHAR idata m_cSource; uCHAR ir_data; uCHAR m_cFactryCnt; //uCHAR idata m_cStandard=4;//PAL uCHAR idata m_cStandard=0;//NTSC uCHAR idata m_cScaleratio=ScaleFULL; uWORD m_wHRes; uWORD m_wVRes; uWORD XCLK_MCU; uWORD idata m_wVTotal; uCHAR cPAL_Dot=5,cNTSC_Dot=4; uCHAR cSTV1_ON; uCHAR cSTV_OFFSET; uCHAR cPAL_OFFSET,cNTSC_OFFSET,cGATE_PREDRIVE; uCHAR cFactry_Addr=0x00,cFactry_Data; bit bFactry_Menu,bFactry_Func; #ifdef TV uCHAR idata m_cTV_Num; uCHAR m_cSoundSystem=PAL_I; #endif sbit m_bPanelClose = Flag1 ^ 0; sbit m_bBKPowerOn = Flag1 ^ 1; sbit m_bKyPowerOn = Flag1 ^ 2; sbit m_bChipPowerOn = Flag1 ^ 3; sbit m_bTimer0Overflow = Flag1 ^ 4; sbit m_bOSDEnable = Flag1 ^ 5; sbit ir_enable = Flag1 ^ 6; sbit m_bKyblocked = Flag1 ^ 7; sbit m_bFactryMode = Flag2 ^ 0; sbit m_bFactryReady = Flag2 ^ 1; sbit m_bRelease = Flag2 ^ 2; sbit m_bAir_Cable = Flag2 ^ 3; sbit m_bTV_Num_Bits = Flag2 ^ 4; sbit m_bTV_Skip = Flag2 ^ 5; uWORD idata m_wBuff[3]; uCHAR idata m_cBuff[5]; uDWORD m_dwBuff[2]; //---------------------------------------------------------------------------- //Main Function //---------------------------------------------------------------------------- extern unsigned char Win_Flag; unsigned int D_Count; #define DEBUG_C 0 void main(void) { m_wBuff[2]=DETECT_TIMER-1; // I2CWriteByte(0xa0, 0xd9, 0x00); InitFactry(); //System Initial Initial(); SysInterruptEnable(); #ifdef TVP5150 I2CWriteByte(0xba,0x00, 0x02); I2CWriteByte(0xba,0x03, 0x09); #endif //上电开机流程 m_cSource = I2CReadByte(EEPVIDEOBLOCK, idVIDEO_SOURCE_INDEX)&0x0f; if(m_cSource==0) m_cSource=1; SourceSelect(); //OSD Font Initial OSDInit(); Detect_NTSCPAL(); OSDShowSource(); //kitty0927 OpenPanel(); if(!m_bBKPowerOn) BKPower(); //========================Main loop==================== while(1) { kyKeypad(); if(ir_enable) { RemoteEvent(); ir_enable=0; } else if(!EX1) { EX1=1; }//*/ if(m_bTimer0Overflow) { if(m_bOSDEnable) OSDExit(); }//*/ Detect_NTSCPAL(); #if DEBUG_C D_Count ++; if(D_Count >= 100) { D_Count = 0; if(Win_Flag == 0) { Win_Flag = 1; Osd_Window_Enable(); } else { Win_Flag = 0; Osd_Window_Disable(); } } #endif } } //************************************************************************** //Power ON/OFF BackLight ON/OFF Panel ON/OFF //************************************************************************** void ClosePanel(void) { m_bPanelClose = 1; I2CWriteByte(TW101, 0xC2, I2CReadByte(TW101, 0xC2)|(PSYNC_STR|IGNORE_VSYNC)); I2CWriteByte(TW101, PATTERN_CTRL, 0x87);//I2CReadByte(TW101, PATTERN_CTRL)|0x80); //Enable Frame Background Color } void OpenPanel(void) { m_bPanelClose = 0; /* if(!m_cStandard)I2CWriteByte(TW101, 0xB8, (I2CReadByte(TW101, 0xb8)-cNTSC_Dot)); else I2CWriteByte(TW101, 0xB8, (I2CReadByte(TW101, 0xb8)-cPAL_Dot));*/ I2CWriteByte(TW101, 0xC2, I2CReadByte(TW101, 0xC2)&~(PSYNC_STR|IGNORE_VSYNC)); I2CWriteByte(TW101, PATTERN_CTRL, I2CReadByte(TW101, PATTERN_CTRL)&~0x80); //Enable Frame Background Color // twdDelay(100); } void BKPower(void) { if(m_bBKPowerOn) { BKLIGHT_EN = 1; // BKLIGHT shut down twdDelay(100); m_bBKPowerOn = 0; } else { twdDelay(100); BKLIGHT_EN = 0; // BKLIGHT power on m_bBKPowerOn = 1; } } void PowerManage(void) { if(m_bKyPowerOn) //Power on { LED_RED = 1; //Turn Off LED_GREEN = 0; //Turn On I2CWriteByte(TW101, 0xE0, I2CReadByte(TW101, 0xE0)|TPDB); m_cOSDEvent=0; m_cOSDFunc=0; //When power on chip, force to reset chip m_bChipPowerOn=1; twdDelay(100); OpenPanel(); if(!m_bBKPowerOn) BKPower(); } else //Forced Power Off { if(m_bChipPowerOn) { LED_RED =0; //Turn On LED_GREEN = 1; //Turn Off twdDelay(100); OSDExit(); if(m_bBKPowerOn) BKPower(); ClosePanel(); twdDelay(200); I2CWriteByte(TW101, 0xE0, I2CReadByte(TW101, 0xE0)&~TPDB|PDMD); m_bChipPowerOn=0; } } } //************************************************************************** //系统初始化函数 //************************************************************************** void Initial(void) { extern EEPVIDEO idata EepVideo; SysInit(); #ifdef TCON TconInit(); #endif #ifdef RSDS RsdsInit(); #endif //Ruby modify 2005-06-07 ClosePanel(); OSDDisable(); LoadGammaTable(0); LoadFilter(3); //Ruby 2004-10-07 // EepVideo.cSharp=0; // LoadFilter(3); //del charles // RegisterSetting(); // LoadFilter(3); BKLIGHT_EN = 0; // BKLIGHT power on kitty0927 OSDLogo(); //kitty0927 } void SysInit(void) { P0=0xff; P1=0xff; P2=0xff; P3=0xff; //Chip Reset CHIP_RESET = 0; VIDEO_RESET=0; twdDelay(100); CHIP_RESET = 1; VIDEO_RESET=1; twdDelay(50); //8051Register Set IE = 0; // disable all interrupt TMOD = 0x11; // Timer1 Mode 1, Timer0 Mode 1; //TMOD = 0x01; // Timer0 Mode 1; EX0 = 0; // disable external interrupt 0, IE[0] EX1 = 0; //ET0 = 1; // enable bTimer 0 //IT0 = 1; // falling endge generate interrupt, TCON[0] INT0 = 1; IT1 = 1; // falling endge generate interrupt, TCON[0] INT1 = 1; twdDelay(10); // if(!m_bPanelClose) // ClosePanel(); #ifdef NVRAM EEPLoadPubData(); #else OSDFactryReset(); OSDResetPubData(); //OSDResetVideoData(); OSDSetValues(); #endif InitTW101(); InitPt2313(); kyKeypadInit(); m_bPanelClose = 0; m_bBKPowerOn=0; m_bKyPowerOn=1; m_bChipPowerOn=1; LED_GREEN=0; //Ruby add IRScaleratioCtrl(); } void SysInterruptEnable(void) { #ifdef TIMER1 // Timer1Reset(); ET1 = 1; // Enable Timer1 interrupt TR1=0; #endif #ifdef TIMER0 Timer0Reset(); ET0 = 1; // Enable Timer0 interrupt TR0 = 0; #endif #ifdef INTERRUPT1 EX1 = 1; // Enable INT1 (IR) #endif EA = 1; // Enable Interrupt } void InitFactry(void) { if(!(ReadPort()&kyMENU)) { twdDelay(NVRDELAY); I2CWriteByte(0xa0, 0x0f ,0x01); twdDelay(NVRDELAY); } if(I2CReadByte(0xa0, 0x0f )) { twdDelay(NVRDELAY); I2CWriteByte(0xa0, 0x0f ,0x00); twdDelay(NVRDELAY); I2CWriteByte(0xa0, 0x10 ,0x0A); twdDelay(NVRDELAY); I2CWriteByte(0xa0, 0x11 ,0x08); twdDelay(NVRDELAY); I2CWriteByte(0xa0, 0x12 ,0x01); twdDelay(NVRDELAY); I2CWriteByte(0xa0, 0x13 ,0x06);//STV_OFFSET twdDelay(NVRDELAY); I2CWriteByte(0xa0, 0x14 ,0x0f);//PAL_OFFSET twdDelay(NVRDELAY); I2CWriteByte(0xa0, 0x15 ,0x12);//NTSC_OFFSET twdDelay(NVRDELAY); I2CWriteByte(0xa0, 0x16 ,0x03);//Gate_Drive_Predriving twdDelay(NVRDELAY); } ReadFactryData(); } [此贴子已经被作者于2006-1-19 20:37:43编辑过]
|
|
|
4楼#
发布于:2006-01-20 16:47
<P>已发邮件给你:ht_car@126.com</P> |
|
|
5楼#
发布于:2006-01-20 19:42
|
|
|
6楼#
发布于:2006-01-21 00:53
|
|
|
7楼#
发布于:2006-01-21 00:56
|
|
|
8楼#
发布于:2006-01-21 01:28
<P>我一开始就注意到这两个寄存器了,但以为默认值50h和60h本来就已经到C00h(1024*3)结束了,因此初始化时没有理会它。</P> <P>我再参照你的找找问题。</P> <P>另:你教训的是,所以将主题和帖子编辑一下。</P> |
|
|