Texas Instruments | TVP5154A Patch Code Download lines | Application notes | Texas Instruments TVP5154A Patch Code Download lines Application notes

Texas Instruments TVP5154A Patch Code Download lines Application notes
Application Report
SLEA095 – June 2010
TVP5150AM1 Patch Code Download Guidelines
.....................................................................................................................................................
The TI family of video decoder products offers the optional flexibility to update device firmware by
downloading patch code into the device RAM. This application note outlines how to correctly download
patch code updates into the TVP5154A. A summary of all required I2C register writes, and sample C code
are included.
1
Download Options
There are two options for downloading the patch code onto the TVP5154A: (1) using the TI EVM, and (2)
using the Customer System.
1.1
TI EVM
1. Power-on the board with TVP5154A device on it. Connect source to Input and Output to monitor.
2. From the included WinVCC4 or later software, open P5154_02XX.CMD file, where XX refers to the
patch code revision number.
3. Load line 1
"Set TVP5154 ROM – Initialize for NTSC"
Now you should get good picture on monitor. There is no code loading here, just setups for TVP5154A
and ADV7311.
Check the version number from property sheets on WinVCC4. You will see 02.00
4. Load line 2
"TVP5154 Load RAM Code p5154_02XX.hra" Now the patch code is downloaded and microprocessor
is restarted. The decoder is running ROM + Patch RAM code.
Check the version number from the property sheets, you will see 02.XX. The XX refers to the patch
code revision number.
1.2
Customer System
1. Power on the board with TVP5154A ROM v2.00 device on it. After the power supplies are active and
stable (at least 100ms), perform a hardware reset. This is done by pulling RESETB (pin 8) active low
for at least 500ns. Then wait at least 10ms before initiating I2C communication.
2. Configure I2C Master Controller speed to 400kbps.
3. Start the TVP5154A without the patch code.
There are only two register writes to get the TVP5154A up and running. The user should start the
internal microprocessor (write 0x00 into register 0x7F) and has the option (not required) to enable the
outputs (write 0x69 into register 0x03). There is no code loading here, this just set up the TVP5154A
for normal operation.
Check the version number in registers 0x82 and 0x83. The values you will see are 0x02 and 0x00,
respectively.
SLEA095 – June 2010
TVP5154A Patch Code Download Guidelines
Copyright © 2010, Texas Instruments Incorporated
1
Download Options
www.ti.com
4. Load the code
There is a password for patch RAM code download. After the password is set, it is a good idea to lock
the device again, by writing 00 into that address. The password prevents undesirable writes into the
device at startup due to power surges etc. The following code demonstrates the method for unlocking
and then locking the device again.
**** Code starts here ***
(a) Select to write to all four decoders in TVP5154A
I2C Subaddress
0xFE
Data
0x0F
Description
// Write to all 4 decoders
Data
0x51
0x54
0xFF
0x04
Description
// Password MSB data
// Password LSB data
//Data address
// Write command
(b) Unlock the device
I2C Subaddress
0x21
0x22
0x23
0x24
(c) Download real patch code P5151_02XX.hra through subaddress 0x7E. XX refers to the patch code
revision number. Write all data to address 0x7E continuously.
Start
0xB8/0xBA
0x7E
Data0
Data1
Data2
…
DataN-1
Stop
Slave Address and data address are only needed for first byte of data, and user can download all
patch code data continuously.
(d) Restart Microprocessor
Write into register 0x7F, data 0x00 // Restart TVP5154A microprocessor
(e) Select to write to all four decoders in TVP5154A
I2C Subaddress
0xFE
Data
0x0F
Description
// Write to all 4 decoders
Data
0x00
0x00
0xFF
0x04
Description
// Password MSB data
// Password MSB data
// Data address
// Write command
(f) Lock the device
I2C Subaddress
0x21
0x22
0x23
0x24
**** Code ends here ****
Now decoder should run ROM + Patch RAM code.
Check the version number in registers 0x82 and 0x83. The values you will see are 0x02 and 0xXX,
respectively. XX refers to the patch code revision number.
5. After downloading the patch code, if there is an H/W reset to the TVP5154A (active low pulse to pin 8),
the original ROM code is restarted to run (patch code is disabled). To let patch code run without
downloading the whole patch code again, please use the following procedure.
Set the correct password by doing the four writes as mentioned above (step 4a-4b) to unlock the
device. Then write 0x05 to I2C address 0x10. Now the patch code is running. (Verify the version
number in registers 0x82 and 0x83. The values you will see are 0x02 and 0xXX, respectively.) Finally,
lock the device as in the previous section (step 4f).
2
TVP5154A Patch Code Download Guidelines
Copyright © 2010, Texas Instruments Incorporated
SLEA095 – June 2010
Download Options
www.ti.com
1.3
2
Summary of I C Register Writes
I2C Subaddress
0xFE
0x7F
0xFE
0x03
0x21
0x22
0x23
0x24
0x7E
Data
0x0F
0x00
0x0F
0x69
0x51
0x54
0xFF
0x04
Patch code
Description
// Write to all 4 decoders
// Restart microprocessor
// Write to all 4 decoders
// Enable outputs
// Password MSB data
// Password LSB data
// Data address
// Write command
// Load patch code with multi-byte/burst writes
ST B8/BA 7E D0 D1 D2 … Dn-1 SP
Where,
ST:
B8/BA:
7E:
D0:
n:
SP:
0x7F
0xFE
0x21
0x22
0x23
0x24
1.4
Start Condition
I2C Slave Address
I2C Subaddress
First Byte of patch code data
number of Bytes in patch code
Stop Condition
0x00
0x0F
0x00
0x00
0xFF
0x04
//
//
//
//
//
//
Restart microprocessor
Write to all 4 decoders
Password MSB data
Password LSB data
Data address
Write command
Sample C Code for Patch Download
#define TVP5154A_ADDR 0xB8
//Device Address could also be 0xBA
/////////////////////////////////////////////////////////////
// Firmware data array (.C file example)
/////////////////////////////////////////////////////////////
/*
/*
/*
/*
/*
/*
/*
/*
COPYRIGHT (C) 2003 TEXAS INSTRUMENTS
HexConv v3.00
DEVICE
: TVP5154A
VIDEO STANDARD: (M)NTSC(AUTO)
SAMPLING RATE : ITU-R BT.656
FILENAME
: P5154_0280.HRA
ASSEMBLED
: Wednesday, November 05, 200X 14:31:02
VERSION
: 2.80
SIZE (BYTES) : 3990
*/
*/
*/
*/
*/
*/
*/
*/
const unsigned char g_pData[3990] =
{
0x01, 0x00, 0x00,
0x00, 0x00, 0x04,
0x03, 0x05, 0x00,
SLEA095 – June 2010
TVP5154A Patch Code Download Guidelines
Copyright © 2010, Texas Instruments Incorporated
3
Download Options
www.ti.com
0x00, 0x00, 0x80,
.
.
.
0x0F, 0x56, 0xC7
};
/////////////////////////////////////////////////////////////
// Buffer Size
/////////////////////////////////////////////////////////////
int g_nNumBytes = 3990; //Add this line
/////////////////////////////////////////////////////////////
// Function prototypes
/////////////////////////////////////////////////////////////
//This will write to slave address 'nSlaveAddr',
//sub-address 'nSubAddr' the data 'nData'
//Definition based on system and I2C controller requirements.
void I2CWriteByte(unsigned char nSlaveAddr,
unsigned char nSubAddr,
unsigned char nData );
//This will write to slave address 'nSlaveAddr', sub-address 'nSubAddr'
//'nNumBytes' bytes from buffer 'pData' in one continuous I2Ctransfer.
//Definition based on system and I2C controller requirements.
void I2CWriteBuffer(unsigned char nSlaveAddr,
unsigned char nSubAddr,
int nNumBytes,
unsigned char* pData );
//This will load the TVP5154A program RAM from buffer 'pData'
//'nNumBytes' bytes
void TVP5154ALoadProgramRAM(unsigned char* pData,
int nNumBytes );
///////////////////////////////////////////////////////////////
// Main Program
///////////////////////////////////////////////////////////////
int main (int argc, char *argv[])
{
TVP5154ALoadProgramRAM( g_pData, g_nNumBytes );
}
///////////////////////////////////////////////////////////////
// Function: TVP5154ALoadProgramRAM()
///////////////////////////////////////////////////////////////
void TVP5154ALoadProgramRAM ( unsigned char* pData, int nNumBytes )
{
I2CWriteByte( TVP5154A_ADDR, 0xFE,0x0F ); // Write to all 4
I2CWriteByte( TVP5154A_ADDR, 0x7F,0x00 ); // Restart TVP5154A uP
I2CWriteByte( TVP5154A_ADDR, 0x03,0x69 ); // Enable Outputs
// unlock password for patch code download & register write
I2CWriteByte( TVP5154A_ADDR, 0x21,0x51 );
4
TVP5154A Patch Code Download Guidelines
Copyright © 2010, Texas Instruments Incorporated
SLEA095 – June 2010
Download Options
www.ti.com
I2CWriteByte( TVP5154A_ADDR, 0x22,0x54 );
I2CWriteByte( TVP5154A_ADDR, 0x23,0xFF );
I2CWriteByte( TVP5154A_ADDR, 0x24,0x04 );
//This will write to slave address TVP5154A_ADDR, sub-address 0x7E
//(auto-incrementing data register) 'nNumBytes' bytes
//from buffer 'pData' in one continuous I2Ctransfer.
I2CWriteBuffer( TVP5154A_ADDR, 0x7E, nNumBytes, pData );
I2CWriteByte( TVP5154A_ADDR, 0x7F,0x00 );
// Restart TVP5154A uP
// lock password for patch code download & register write
I2CWriteByte( TVP5154A_ADDR, 0x21,0x00 );
I2CWriteByte( TVP5154A_ADDR, 0x22,0x00 );
I2CWriteByte( TVP5154A_ADDR, 0x23,0xFF );
I2CWriteByte( TVP5154A_ADDR, 0x24,0x04 );
}
SLEA095 – June 2010
TVP5154A Patch Code Download Guidelines
Copyright © 2010, Texas Instruments Incorporated
5
IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements,
and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should
obtain the latest relevant information before placing orders and should verify that such information is current and complete. All products are
sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.
TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standard
warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where
mandated by government requirements, testing of all parameters of each product is not necessarily performed.
TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and
applications using TI components. To minimize the risks associated with customer products and applications, customers should provide
adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right,
or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information
published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a
warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual
property of the third party, or a license from TI under the patents or other intellectual property of TI.
Reproduction of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied
by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive
business practice. TI is not responsible or liable for such altered documentation. Information of third parties may be subject to additional
restrictions.
Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all
express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is not
responsible or liable for any such statements.
TI products are not authorized for use in safety-critical applications (such as life support) where a failure of the TI product would reasonably
be expected to cause severe personal injury or death, unless officers of the parties have executed an agreement specifically governing
such use. Buyers represent that they have all necessary expertise in the safety and regulatory ramifications of their applications, and
acknowledge and agree that they are solely responsible for all legal, regulatory and safety-related requirements concerning their products
and any use of TI products in such safety-critical applications, notwithstanding any applications-related information or support that may be
provided by TI. Further, Buyers must fully indemnify TI and its representatives against any damages arising out of the use of TI products in
such safety-critical applications.
TI products are neither designed nor intended for use in military/aerospace applications or environments unless the TI products are
specifically designated by TI as military-grade or "enhanced plastic." Only products designated by TI as military-grade meet military
specifications. Buyers acknowledge and agree that any such use of TI products which TI has not designated as military-grade is solely at
the Buyer's risk, and that they are solely responsible for compliance with all legal and regulatory requirements in connection with such use.
TI products are neither designed nor intended for use in automotive applications or environments unless the specific TI products are
designated by TI as compliant with ISO/TS 16949 requirements. Buyers acknowledge and agree that, if they use any non-designated
products in automotive applications, TI will not be responsible for any failure to meet such requirements.
Following are URLs where you can obtain information on other Texas Instruments products and application solutions:
Products
Applications
Amplifiers
amplifier.ti.com
Audio
www.ti.com/audio
Data Converters
dataconverter.ti.com
Automotive
www.ti.com/automotive
DLP® Products
www.dlp.com
Communications and
Telecom
www.ti.com/communications
DSP
dsp.ti.com
Computers and
Peripherals
www.ti.com/computers
Clocks and Timers
www.ti.com/clocks
Consumer Electronics
www.ti.com/consumer-apps
Interface
interface.ti.com
Energy
www.ti.com/energy
Logic
logic.ti.com
Industrial
www.ti.com/industrial
Power Mgmt
power.ti.com
Medical
www.ti.com/medical
Microcontrollers
microcontroller.ti.com
Security
www.ti.com/security
RFID
www.ti-rfid.com
Space, Avionics &
Defense
www.ti.com/space-avionics-defense
RF/IF and ZigBee® Solutions www.ti.com/lprf
Video and Imaging
www.ti.com/video
Wireless
www.ti.com/wireless-apps
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2010, Texas Instruments Incorporated
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising