Examples
19
SNVU495 – March 2016
Copyright © 2016, Texas Instruments Incorporated
LP8580 Evaluation Board
Read NVM
button. If the
Read NVM
button is not clicked, the new EEPROM values are not read to the
control registers until the next time the IC is started up.
6.7
Saving Register Settings to a File
Control register values can also be saved to a text file for future use. This can be done for the whole
memory or for a single register block.
To save the contents of the whole memory, go to
File
→
Save All Registers
— a
Save As
window pops
up. Give the register file name, and click the
Save
button.
To save the contents of a register block into a text file, activate any register inside that block by selecting it
from the register view. Go to
Go to File
→
Save Register Block
— a
Save As
window pops up. Give the
register a file name and click the
Save
button.
6.8
Reading Control Register Values from a Text File
Control register values can also be set from a text file. This can be done for the whole memory or for a
single register block.
To set the contents of the whole memory, go to
File
→
Load All Registers
, and an
Open File
window pops
up. Browse to the folder containing the register file, select it, then click the
Open
button.
To set the content of a register block activate any register inside that block by selecting it from the register
view. Go to
File
→
Load Registers
, and an
Open File
window pops up. Browse to the folder containing the
register file, select it, then click the
Open
button.
NOTE:
The register file must have same number of lines containing register settings as the register
block that is being set up. The settings are read line by line, and the register address in the
file is ignored.
6.9
Using Macros
Macros have a structure similar to the register settings files, but they have one advantage. In register files
data must be in same order as the registers, and they are read into the registers line by line. Additionally,
register files can only be used to set up a whole register block or to the whole memory. A macro file, on
the other hand, can have any number of register settings in any order. It can also have multiple writes to
the same register. Macro file settings are saved in an address-data format. Macro files also allow
comments after register data. Comments must be separated with at least one space after the register
data.
shows an example of a simply macro. The macro first sets the BASE_BRT setting to
maximum (register 026h, data 1FFFh). Next, the macro sets up the LED current of each output to
0071hex (registers 1C2h to 1CCh); the macro then enables the VCOMTRIM output (register 02Ch, data
0081h) and sets the VCOM_TRIM_ADJ0 setting to 00FFhex (register 202h data 00FFh). Finally, the
macro turns on the backlight (register 020h, data 0582h).
Macro files are executed by selecting
Operations
→
Execute Macro
; an
Open File
window pops up.
Browse to the folder containing the macro file, select it, then click the
Open
button.
6.9.1
Macro File Format
026 1FFF ;BASE_BRT to max
1C2 0071 ;set LED0 current to 0071hex
1C4 0071 ;set LED1 current to 0071hex
1C6 0071 ;set LED2 current to 0071hex
1C8 0071 ;set LED3 current to 0071hex
1CA 0071 ;set LED4 current to 0071hex
1CC 0071 ;set LED5 current to 0071hex