I have been trying to run the tutorial programs for the 7" zed touch display kit but I have been facing this problem where I get the following error:
ERROR : Failed to write Touch Controller
I have narrowed down the error to the point where the program attempts to send 2 bytes of data using IIC. Specifically at the final few lines of the program. I'm not sure what exactly it is writing to, I can only guess that it's writing something to the ALI3 sharp interface or the LCD interface, but I'm not sure what it is trying to trigger with the final write.
int zed_ali3_controller_demo_init( zed_ali3_controller_demo_t *pDemo )
{
int ret;
xil_printf("
r");
xil_printf("------------------------------------------------------
r");
xil_printf("-- ZedBoard Display Kit --
r");
xil_printf("-- ALI3 Controller Demonstration --
r");
xil_printf("-- Standalone Application --
r");
xil_printf("------------------------------------------------------
r");
xil_printf("
r");
// Fill frame stores with color bars
xil_printf( "Video Frame Buffer Initialization ...
r" );
int32u frame, row, col;
int32u pixel;
volatile int32u *pStorageMem = (int32u *)pDemo->uBaseAddr_MEM_FrameBuffer;
for ( frame = 0; frame < pDemo->uNumFrames_FrameBuffer; frame++ )
{
for ( row = 0; row < pDemo->ali3_height; row++ )
{
for ( col = 0; col < pDemo->ali3_width; col++ )
{
pixel = 0x00000000; // Black
//pixel = 0x00FFFFFF; // White
*pStorageMem++ = pixel;
}
}
}
// Wait for DMA to synchronize.
Xil_DCacheFlush();
// Initialize Output Side of AXI VDMA
xil_printf( "Video DMA (Output Side) Initialization ...
r" );
vfb_common_init(
pDemo->uDeviceId_VDMA_FrameBuffer, // uDeviceId
&(pDemo->vdma_ali3) // pAxiVdma
);
vfb_tx_init(
&(pDemo->vdma_ali3), // pAxiVdma
&(pDemo->vdmacfg_ali3_read), // pReadCfg
pDemo->ali3_resolution, // uVideoResolution
pDemo->ali3_resolution, // uStorageResolution
pDemo->uBaseAddr_MEM_FrameBuffer, // uMemAddr
pDemo->uNumFrames_FrameBuffer // uNumFrames
);
// IIC Initialization for touch controller
xil_printf( "I2C Touch Controller Initialization ...
r");
ret = zed_iic_axi_init(&(pDemo->touch_iic),"ALI3 Touch I2C Controller0", pDemo->uBaseAddr_IIC_Touch);
if ( !ret )
{
xil_printf("ERROR : Failed to open ZED-IIC driver
r");
return -1;
}
pDemo->touch_irqs = 0;
pDemo->touch_events = 0;
pDemo->touch_posx = 0x0000;
pDemo->touch_posy = 0x0000;
zed_ali3_controller_demo_SetupInterruptSystem( pDemo );
int8u ChipAddress = 0x20;
int8u RegAddress = 0x00;
int8u RegData = 0x11; // [4] = INT enabled, [0] = Touch enabled
int8u ByteCount = 1;
ret = pDemo->touch_iic.fpIicWrite( &(pDemo->touch_iic), ChipAddress, RegAddress, &RegData, ByteCount );
if ( !ret )
{
xil_printf( "ERROR : Failed to write Touch Controller
r" );
return -1;
}
return 0;
}
Any help would be appreciated thanks =)