TI中文支持网
TI专业的中文技术问题搜集分享网站

TMS320C6748: LCD屏驱动无效

Part Number:TMS320C6748

我按照C6748_StarterWare_1_20_04_01里的例程配置了我的LCD,这里是代码,根据LCD实际手册做了参数调整;

/**
 * \file  rasterDisplay.c
 *
 * \brief Sample application for raster
 */

/*
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ 
*
*  Redistribution and use in source and binary forms, with or without 
*  modification, are permitted provided that the following conditions 
*  are met:
*
*Redistributions of source code must retain the above copyright 
*notice, this list of conditions and the following disclaimer.
*
*Redistributions in binary form must reproduce the above copyright
*notice, this list of conditions and the following disclaimer in the 
*documentation and/or other materials provided with the
*distribution.
*
*Neither the name of Texas Instruments Incorporated nor the names of
*its contributors may be used to endorse or promote products derived
*from this software without specific prior written permission.
*
*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
*  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
*  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
*  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
*  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
*  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
*  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
*  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
*  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
*  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "raster.h"
#include "psc.h"
#include "interrupt.h"
#include "soc_C6748.h"
#include "hw_psc_C6748.h"
#include "hw_syscfg0_C6748.h"
#include "hw_types.h"
#include "lcdkC6748.h"
//#include "image.h"

#include "bsp_lcd.h"
#include "bsp_pll.h"

void LCDDisplay(void)
{unsigned int  status;status = RasterIntStatus(SOC_LCDC_0_REGS,RASTER_END_OF_FRAME0_INT_STAT |RASTER_END_OF_FRAME1_INT_STAT );status = RasterClearGetIntStatus(SOC_LCDC_0_REGS, status);

//if (status & RASTER_END_OF_FRAME0_INT_STAT)
//{
//RasterDMAFBConfig(SOC_LCDC_0_REGS,
//(unsigned int)image1,
//(unsigned int)image1 + sizeof(image1) - 2,
//0);
//}
//
//if(status & RASTER_END_OF_FRAME1_INT_STAT)
//{
//RasterDMAFBConfig(SOC_LCDC_0_REGS,
//(unsigned int)image1,
//(unsigned int)image1 + sizeof(image1) - 2,
//1);
//}
}

void LCDInit(void)
{// Ensure that SysCfg registers are unlockedKickUnlock();// Increase LCDC Master Priority to 0 to prevent FIFO underrunsHWREG(SOC_SYSCFG_0_REGS + SYSCFG0_MSTPRI2) &= 0x0FFFFFFF;LCDSetupIntc();SetUpLCD();/* configuring the base ceiling */RasterDMAFBConfig(SOC_LCDC_0_REGS,(unsigned int)image1,(unsigned int)image1 + sizeof(image1) - 2,0);RasterDMAFBConfig(SOC_LCDC_0_REGS,(unsigned int)image1,(unsigned int)image1 + sizeof(image1) - 2,1);/* enable End of frame interrupt */RasterEndOfFrameIntEnable(SOC_LCDC_0_REGS);/* enable raster */RasterEnable(SOC_LCDC_0_REGS);
}

/*
** Configures raster to display image 
*/
void SetUpLCD(void)
{PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_LCDC, PSC_POWERDOMAIN_ALWAYS_ON,PSC_MDCTL_NEXT_ENABLE);LCDPinMuxSetup();/* disable raster */RasterDisable(SOC_LCDC_0_REGS);/* configure the pclk */RasterClkConfig(SOC_LCDC_0_REGS, 40000000, 150000000);/* configuring DMA of LCD controller */RasterDMAConfig(SOC_LCDC_0_REGS, RASTER_DOUBLE_FRAME_BUFFER,RASTER_BURST_SIZE_16, RASTER_FIFO_THRESHOLD_8,RASTER_BIG_ENDIAN_DISABLE);/* configuring modes(ex:tft or stn,color or monochrome etc) for raster controller */RasterModeConfig(SOC_LCDC_0_REGS, RASTER_DISPLAY_MODE_TFT,RASTER_PALETTE_DATA, RASTER_COLOR, RASTER_EXTRAPOLATE);/* frame buffer data is ordered from least to Most significant bye */RasterLSBDataOrderSelect(SOC_LCDC_0_REGS);/* disable nibble mode */RasterNibbleModeDisable(SOC_LCDC_0_REGS);/* configuring the polarity of timing parameters of raster controller */RasterTiming2Configure(SOC_LCDC_0_REGS, RASTER_FRAME_CLOCK_LOW |RASTER_LINE_CLOCK_LOW  |RASTER_PIXEL_CLOCK_LOW |RASTER_SYNC_EDGE_RISING|RASTER_SYNC_CTRL_ACTIVE|RASTER_AC_BIAS_HIGH, 0, 255);/* configuring horizontal timing parameter */RasterHparamConfig(SOC_LCDC_0_REGS, 800, 40, 354, 46);/* configuring vertical timing parameters */RasterVparamConfig(SOC_LCDC_0_REGS, 600, 20, 77, 23);/* configuring fifo delay to */RasterFIFODMADelayConfig(SOC_LCDC_0_REGS, 2);

//RasterEnable(SOC_LCDC_0_REGS);
}

/*
** configures arm interrupt controller to generate raster interrupt 
*/
void LCDSetupIntc(void)
{// Register ISR to vector tableIntRegister(C674X_MASK_INT7, BspLCDIsr);// Map system interrupt to DSP maskable interruptIntEventMap(C674X_MASK_INT7, SYS_INT_LCDC_INT);// Enable DSP maskable interruptIntEnable(C674X_MASK_INT7);
}

/*
** For each end of frame interrupt base and ceiling is reconfigured 
*/
void BspLCDIsr(void)
{unsigned int  status;IntEventClear(SYS_INT_LCDC_INT);status = RasterIntStatus(SOC_LCDC_0_REGS,RASTER_END_OF_FRAME0_INT_STAT |RASTER_END_OF_FRAME1_INT_STAT );status = RasterClearGetIntStatus(SOC_LCDC_0_REGS, status);if (status & RASTER_END_OF_FRAME0_INT_STAT){RasterDMAFBConfig(SOC_LCDC_0_REGS,(unsigned int)image1,(unsigned int)image1 + sizeof(image1) - 2,0);}if(status & RASTER_END_OF_FRAME1_INT_STAT){RasterDMAFBConfig(SOC_LCDC_0_REGS,(unsigned int)image1,(unsigned int)image1 + sizeof(image1) - 2,1);}
}

/***************************** End Of File ************************************/

这里是LCD硬件连接图 这里是LCD部分参数 ,配置完成后,仿真屏幕就只闪一下,然后就没动作了,我代码还有什么地方没配置吗  还是配置有误,望请不吝赐教

Nancy Wang:

请将修改过的参数标红,与EVM板上使用的LCD对比参数有哪些部分不同。

着重看一下以下API的配置

RasterClkConfig

RasterModeConfig

RasterTiming2Configure

RasterHparamConfig

RasterVparamConfig

引脚信号是否有量过?

赞(0)
未经允许不得转载:TI中文支持网 » TMS320C6748: LCD屏驱动无效
分享到: 更多 (0)