M
mmcshmi11
Guest
I'm working with a xilinx virtex 5 board (with the VLX110T) and have bee
trying to get any kind of output to a DVI monitor. I'm using the IIC cor
in XPS to try and program the CH7301. I'm using a clock generator to send
25MHz clock to the xclk pin, sending a high value to the xclk*, and no
sending any of the 12 data bits because I'm assuming they aren't needed fo
color bars...
I can talk to the CH7301 over the I2C bus and I'm not sure if I a
programming the control registers wrong or possibly my code is writte
wrong and not programming them at all. Can anybody help me with this? Th
code is below:
#define write_CH7301 0xEC //device address 0x76 shifted left 1 bit
/* Register Declarations */
#define GIE (*((volatile unsigned long*)(XPAR_IIC_BASEADDR + 0x01C)))
#define ISR (*((volatile unsigned long*)(XPAR_IIC_BASEADDR + 0x020)))
#define IER (*((volatile unsigned long*)(XPAR_IIC_BASEADDR + 0x028)))
#define SOFTR (*((volatile unsigned long*)(XPAR_IIC_BASEADDR + 0x040)))
#define CR (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x100)))
#define SR (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x104)))
#define TX_FIFO (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x108)))
#define RC_FIFO (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x10C)))
#define ADR (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x110)))
#define TX_FIFO_OCY (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x114)))
#define RC_FIFO_OCY (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x118)))
#define TEN_ADR (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x11C)))
#define RC_FIFO_PIRQ (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x120)))
#define GPO (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x124)))
void init_CH7301()
{
GIE = 0x80000000; //enable global interrupts for iic bus
IER = 0x4; //enable Tx FIFO Empty Interrupt [Int(2)]
CR = 0x01; //enable iic controller
/* IIC Master Transmitter with repeated START */
/* 1) Write IIC device @ to Tx_FIFO */
TX_FIFO = write_CH7301;
/* 2) Write data to Tx_FIFO */
TX_FIFO = 0x9C;
/* 3) Write to Control Register to set MSMS=1 and TX=1 */
CR = 0x0D; //TX, MSMS, EN = 1
/* 4) Continue writing data to Tx_FIFO */
TX_FIFO = 0x01;
/* 5) Wait for Transmit FIFO empty interrupt. */
while(!(ISR & 0x04)); //wait until TX_FIFO empty interrupt
/* 6) Write to CR to set RSTA=1 */
CR = 0x2D; //TX, MSMS, EN, RSTA = 1
/* 7) Write IIC device @ to Tx_FIFO */
TX_FIFO = write_CH7301;
/* 8) Write all data except last byte to Tx_FIFO */
TX_FIFO = 0x9F;
TX_FIFO = 0x84;
TX_FIFO = 0xEC;
TX_FIFO = 0xA1;
TX_FIFO = 0x0D;
TX_FIFO = 0xEC;
TX_FIFO = 0xC8;
TX_FIFO = 0x19;
TX_FIFO = 0xEC;
TX_FIFO = 0xC9;
TX_FIFO = 0xC0; //0x00 for bypass mode
TX_FIFO = 0xEC;
TX_FIFO = 0xD6;
/* 9) Wait for Transmit FIFO empty interrupt. */
while(!(ISR & 0x04)); //wait until TX_FIFO empty interrupt
/* 10) Write to CR to set MSMS=0. */
CR = 0x29; //RSTA, TX, EN = 1
/* 11) Write last byte of data to Tx_FIFO */
TX_FIFO = 0x01;
}
trying to get any kind of output to a DVI monitor. I'm using the IIC cor
in XPS to try and program the CH7301. I'm using a clock generator to send
25MHz clock to the xclk pin, sending a high value to the xclk*, and no
sending any of the 12 data bits because I'm assuming they aren't needed fo
color bars...
I can talk to the CH7301 over the I2C bus and I'm not sure if I a
programming the control registers wrong or possibly my code is writte
wrong and not programming them at all. Can anybody help me with this? Th
code is below:
#define write_CH7301 0xEC //device address 0x76 shifted left 1 bit
/* Register Declarations */
#define GIE (*((volatile unsigned long*)(XPAR_IIC_BASEADDR + 0x01C)))
#define ISR (*((volatile unsigned long*)(XPAR_IIC_BASEADDR + 0x020)))
#define IER (*((volatile unsigned long*)(XPAR_IIC_BASEADDR + 0x028)))
#define SOFTR (*((volatile unsigned long*)(XPAR_IIC_BASEADDR + 0x040)))
#define CR (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x100)))
#define SR (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x104)))
#define TX_FIFO (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x108)))
#define RC_FIFO (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x10C)))
#define ADR (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x110)))
#define TX_FIFO_OCY (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x114)))
#define RC_FIFO_OCY (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x118)))
#define TEN_ADR (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x11C)))
#define RC_FIFO_PIRQ (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x120)))
#define GPO (*((volatile unsigned long*)(XPAR_IIC_BASEADDR
0x124)))
void init_CH7301()
{
GIE = 0x80000000; //enable global interrupts for iic bus
IER = 0x4; //enable Tx FIFO Empty Interrupt [Int(2)]
CR = 0x01; //enable iic controller
/* IIC Master Transmitter with repeated START */
/* 1) Write IIC device @ to Tx_FIFO */
TX_FIFO = write_CH7301;
/* 2) Write data to Tx_FIFO */
TX_FIFO = 0x9C;
/* 3) Write to Control Register to set MSMS=1 and TX=1 */
CR = 0x0D; //TX, MSMS, EN = 1
/* 4) Continue writing data to Tx_FIFO */
TX_FIFO = 0x01;
/* 5) Wait for Transmit FIFO empty interrupt. */
while(!(ISR & 0x04)); //wait until TX_FIFO empty interrupt
/* 6) Write to CR to set RSTA=1 */
CR = 0x2D; //TX, MSMS, EN, RSTA = 1
/* 7) Write IIC device @ to Tx_FIFO */
TX_FIFO = write_CH7301;
/* 8) Write all data except last byte to Tx_FIFO */
TX_FIFO = 0x9F;
TX_FIFO = 0x84;
TX_FIFO = 0xEC;
TX_FIFO = 0xA1;
TX_FIFO = 0x0D;
TX_FIFO = 0xEC;
TX_FIFO = 0xC8;
TX_FIFO = 0x19;
TX_FIFO = 0xEC;
TX_FIFO = 0xC9;
TX_FIFO = 0xC0; //0x00 for bypass mode
TX_FIFO = 0xEC;
TX_FIFO = 0xD6;
/* 9) Wait for Transmit FIFO empty interrupt. */
while(!(ISR & 0x04)); //wait until TX_FIFO empty interrupt
/* 10) Write to CR to set MSMS=0. */
CR = 0x29; //RSTA, TX, EN = 1
/* 11) Write last byte of data to Tx_FIFO */
TX_FIFO = 0x01;
}