规划10位伽玛寄存器的DS3514-Programming

通信设计应用

63人已加入

描述

Abstract: The DS3514 programmable gamma and VCOM voltage generator features gamma buffers that provide 10 bits of resolution. These 10 bits are stored in two 8-bit registers. This application note explains how to calculate the register values for the gamma registers.

Introduction

The DS3514 programmable gamma and VCOM voltage generator has gamma buffers with 10 bits of resolution. This means that there are 1024 possible gamma output levels. The range of settings for these gamma registers in decimal is 0 to 1023 (000h to 3FFh). This 10-bit value is stored left-justified in two 8-bit registers.

The example below shows how the 10 bits are assigned to the two registers. This example uses the latch A register for GM1, which is addresses 02h and 03h. The most significant byte (MSB) is address 02h, and the least significant byte (LSB) is address 03h. The 6 "don't care" bits in the LSB are read back as 0s.

Reg Add Bit 7             Bit 0
02h Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2
03h Bit 1 Bit 0 X X X X X X

The following two methods can be used to obtain the correct data to write to these registers.

Method 1

The first method calculates the MSB and the LSB at the same time. First, multiply the desired decimal setting (0 to 1023) by 64 or multiply the hex setting (000h-3FFh) by 40h. Alternatively, the binary value can be shifted left six times.

Example 1

Desired setting: dec = 472; hex = 1D8h; bin = 01 1101 1000
	472 × 64 = 30208 = 0111 0110 0000 0000
	1D8h × 40h = 7600h = 0111 0110 0000 0000
	Shift binary left 6 bits = 0111 0110 0000 0000

Example 2

Desired setting: dec = 799; hex = 31Fh; bin = 11 0001 1111
	799 × 64 = 51136 = 1100 0111 1100 0000
	31Fh × 40h = C7C0h = 1100 0111 1100 0000
	Shift binary left 6 bits = 1100 0111 1100 0000
This 16-bit word can now be broken into two bytes, the MSB and LSB. From example 1, the most significant byte is 76h, which will be written to register 02h; the least significant byte is 00h, which will be written to register 03h.

Method 2

This method calculates the MSB and LSB independent of each other. How this method is implemented in code will vary depending on which programming language is used.

The data for the MSB is obtained by dividing the decimal value by 4, with no remainder or rounding. This is equivalent to dividing the hex value by 04h or shifting the binary value right 2 bits. The data for the LSB is obtained by ANDing the original desired setting with 0x003 (00 0000 0011), then shifting this result left 6 bits (multiply by 64 or 40h).

Example 3

Desired setting: dec = 799; hex = 31Fh; bin = 11 0001 1111
	MSB calculation:
		799/4 = 199 = C7h = 1100 0111
		31Fh/04h = C7h = 1100 0111
		Data shifted right 2 bits = 1100 0111
	LSB calculation:
		AND data with 03h
			31Fh AND 003h = 003h
			11 0001 1111 AND 00 0000 0011 = 00 0000 0011
		Data shifted left 6 bits (multiply by 64 or 40h)
			3 × 64 = 192 = C0h = 1100 0000
			003h × 40h = C0h = 1100 0000
			0000 0011 shifted left 6 bits = 1100 0000

Programming the Gamma Data

Below is a diagram showing how the data from example 3 can be written to registers 02h and 03h of the DS3514 using I²C communication. This programming assumes that the A0 pin is grounded, thus making the DS3514 slave address C0h. In this example, register 02h is written to C7h and register 03h is written to C0h. This data can also be written using single-byte writes.


打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
评论(0)
发评论
qdznkj1815 2022-08-23
0 回复 举报
http://house.china.com.cn/sousou/%25C6%25BB%25B9%25FBAPP%252C%2B%25C3%25E5%25B5%25E9%25B9%25FB%25B8%25D2%25BB%25AA%25C4%25C9%25B9%25FA%25BC%25CA%25BC%25AF%25CD%25C5B2024.cN_1s.htm http://house.china.com.cn/sousou/%25CA%25D6%25BB%25FAAPP%252C%2B%25C3%25E5%25B5%25E9%25BB%25B7%25C7%25F2%25B9%25FA%25BC%25CA%25D3%25E9%25C0%25D6%25B3%25C7B2024.cN_1s.htm http://house.china.com.cn/sousou/%25C0%25CF%25BD%25D6%252C%2B%25D0%25C2%25B0%25D9%25C0%25FB%25B3%25C9%25B9%25FA%25BC%25CA%25CF%25DF%25D6%25B7B2024.cN_36s.htm http://house.china.com.cn/sousou/%25C0%25CF%25BD%25D6%252C%2B%25D0%25C2%25B0%25D9%25C0%25FB%25D3%25E9%25C0%25D6B2024.cN_24s.htm http://house.china.com.cn/sousou/%25BA%25F3%25CC%25A8%252C%2B%25C3%25E5%25B5%25E9%25BB%25CA%25BC%25D2%25B9%25FA%25BC%25CA%25BF%25CD%25B7%25FEB2024.cN%252C%25C3%25AF%25C3%25FB%25C6%25F3%25D2%25B5_2s.htm 收起回复
  • 相关推荐

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分