找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6788|回复: 5
打印 上一主题 下一主题
收起左侧

TPS62260LED-338 EVM数字可寻址照明接口(DALI)设计 电路原理图+msp430程序

[复制链接]
跳转到指定楼层
楼主
实物图:



描述

数字可寻址照明接口 (DALI) 标准定义了用于照明控制应用中的通用通信协议和物理接口标准。该设计采用现有的 TPS62260LED-338 EVM 和电平转换电路板以实施 DALI LED 器件类型控制机构。在 TPS62260LED-338 EVM 上找到的微控制器为 MSP430F2131。MSP430F2131 负责执行与 CPU 间的通信,而计时器资源主要用于控制淡出率和 LED 亮度。DALI 在 IEC 60929 中有具体的定义,并已在 IEC 62386 中进行了更新。包含 LED 器件类型是进行此更新的主要原因之一。

特性

    使用板载 MSP430 计时器实施 DALI 协议
    提供用于 MSP430 的 DALI 接口的 PHY 设计
    与 TPS62260LED-338 EVM 配合使用
    还提供 MSP430 G2 Launchpad 支持
    该参考设计已经过测试,并包含软件、硬件设计gerber文件和相关的设计资料;

电路原理图:




BOM:
[size=15.7537px]BOM
[size=15.7537px]Digital Addressable Lighting Interface (DALI)
[size=15.7537px]Bill of Materials
[size=15.7537px]X1      851-93-006-20-001000    Mill-Max
[size=15.7537px]IC1     SN74AC14DR              Texas Instruments
[size=15.7537px]R1      10K Ohm resistor +/-5%
[size=15.7537px]R2      10K Ohm resistor +/-5%
[size=15.7537px]R3      200 ohm resistor +/-5%
[size=15.7537px]OK1     SFH6156-1T              Vishay/Semiconductors
[size=15.7537px]K1      ASSR-1410-003E          Avago Technologies
[size=15.7537px]X2      1935226                 Phoenix Contact
[size=15.7537px]X3      1935226                 Phoenix Contact

部分程序:
  1. /******************************************************************************/
  2. // DALI RGB-LED Demo using MSP430F2131 and TPS62260 from Texas Instruments
  3. // The MSP430F2131 IO does not support the DALI logic levels and a level
  4. // translation circuit is required.
  5. //
  6. // LED PWM Description:
  7. // 8Mhz clock with a period of 5000 counts results in a frequency of 1.6Khz.
  8. // Minimum Physical Level setting for the TPS62260 EVM is 90
  9. //
  10. // DALI:
  11. // TI_DALI_Init()
  12. // This function restores the previous DALI settings stored in information
  13. // memory and intializes the WDT+, RAM varaibles, and GPIO.  The WDT+ is used
  14. // to update the actual_level based upon the DALI fade_rate or fade_time.
  15. //
  16. // TI_DALI_Transaction_Loop()
  17. // This function continually receives, decodes, and then acts upon DALI
  18. // commands.
  19. //
  20. // TI_DALI_Update_Callback()
  21. // The LED source continues without CPU intervention until the source needs
  22. // to be updated. In this case the source is the TIMER_A3, outputs A1 and A2.
  23. //
  24. // TI_DALI_Idle_Callback()
  25. // The time between two transactions (forward-forward or forward-backward)
  26. // is limited in the standard to 9.17ms.  After the CPU has processed the
  27. // recevied information this leaves only about 7ms to do other processes
  28. // before the CPU must receive or transmit the next DALI transaction.
  29. //
  30. // TI_DALI_Flash_Update(FWKEY)
  31. // This takes all of the non-voltaile variables defined in the standard and
  32. // writes them into a free portion of one of the info memory segments.
  33. // This function is intended to be called only once before or during a power
  34. // loss event.  The write cycles takes approximately 2.5ms and Vcc must be
  35. // greater than 2.2V during the write.
  36. //
  37. // Chris Sterzik
  38. // Texas Instruments
  39. // Built with CCS Version: 5.20
  40. //
  41. // Revision 1.1    09/17/2012
  42. /******************************************************************************/

  43. // THIS PROGRAM IS PROVIDED "AS IS". TI MAKES NO WARRANTIES OR
  44. // REPRESENTATIONS, EITHER EXPRESS, IMPLIED OR STATUTORY,
  45. // INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
  46. // FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR
  47. // COMPLETENESS OF RESPONSES, RESULTS AND LACK OF NEGLIGENCE.
  48. // TI DISCLAIMS ANY WARRANTY OF TITLE, QUIET ENJOYMENT, QUIET
  49. // POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY
  50. // INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE PROGRAM OR
  51. // YOUR USE OF THE PROGRAM.
  52. //
  53. // IN NO EVENT SHALL TI BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
  54. // CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY
  55. // THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED
  56. // OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN ANY WAY OUT
  57. // OF THIS AGREEMENT, THE PROGRAM, OR YOUR USE OF THE PROGRAM.
  58. // EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF
  59. // REMOVAL OR REINSTALLATION, COMPUTER TIME, LABOR COSTS, LOSS
  60. // OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR LOSS OF
  61. // USE OR INTERRUPTION OF BUSINESS. IN NO EVENT WILL TI'S
  62. // AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF
  63. // YOUR USE OF THE PROGRAM EXCEED FIVE HUNDRED DOLLARS
  64. // (U.S.$500).
  65. //
  66. // Unless otherwise stated, the Program written and copyrighted
  67. // by Texas Instruments is distributed as "freeware".  You may,
  68. // only under TI's copyright in the Program, use and modify the
  69. // Program without any charge or restriction.  You may
  70. // distribute to third parties, provided that you transfer a
  71. // copy of this license to the third party and the third party
  72. // agrees to these terms by its first use of the Program. You
  73. // must reproduce the copyright notice and any other legend of
  74. // ownership on each copy or partial copy, of the Program.
  75. //
  76. // You acknowledge and agree that the Program contains
  77. // copyrighted material, trade secrets and other TI proprietary
  78. // information and is protected by copyright laws,
  79. // international copyright treaties, and trade secret laws, as
  80. // well as other intellectual property laws.  To protect TI's
  81. // rights in the Program, you agree not to decompile, reverse
  82. // engineer, disassemble or otherwise translate any object code
  83. // versions of the Program to a human-readable form.  You agree
  84. // that in no event will you alter, remove or destroy any
  85. // copyright notice included in the Program.  TI reserves all
  86. // rights not specifically granted under this license. Except
  87. // as specifically provided herein, nothing in this agreement
  88. // shall be construed as conferring by implication, estoppel,
  89. // or otherwise, upon you, any license or other right under any
  90. // TI patents, copyrights or trade secrets.
  91. /******************************************************************************/
  92. #include "dali_demo_hw.h"
  93. #include "dali.h"

  94. void Update_Callback(void);
  95. void DALI_Idle_Callback(void);

  96. /*********************LED Pointer Table ***************************************/
  97. const unsigned int LED[255]={0,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,8,8,8,8,9,9,9,9,
  98. 10,10,10,10,11,11,11,12,12,12,13,13,13,14,14,14,15,15,16,16,17,17,17,18,18,19,
  99. 20,20,21,21,22,22,23,24,24,25,26,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,
  100. 40,41,42,43,44,46,47,48,49,51,52,54,55,57,58,60,61,63,65,67,69,70,72,74,76,79,
  101. 81,83,85,88,90,93,95,98,100,103,106,109,112,115,118,122,125,128,132,136,139,
  102. 143,147,151,156,160,164,169,173,178,183,188,193,199,204,210,216,222,228,234,
  103. 241,247,254,261,269,276,284,291,300,308,316,325,334,343,353,363,373,383,394,
  104. 404,416,427,439,451,464,476,490,503,517,531,546,561,577,593,609,626,643,661,
  105. 679,698,718,737,758,779,800,823,845,869,893,917,943,969,996,1023,1052,1081,
  106. 1111,1141,1173,1205,1239,1273,1308,1345,1382,1420,1459,1500,1541,1584,1628,
  107. 1673,1719,1767,1816,1866,1918,1971,2025,2081,2139,2198,2259,2321,2386,2452,
  108. 2519,2589,2661,2735,2810,2888,2968,3050,3135,3221,3311,3402,3496,3593,3693,
  109. 3795,3900,4008,4119,4233,4350,4470,4594,4721,4852,4986
  110. }; //LED
  111. /******************************************************************************/

  112. static void Timer_Init(void);
  113. static void Clock_Init(void);

  114. // Main Program
  115. void main(void)
  116. {
  117.   unsigned int temp_flash_key;
  118.   WDTCTL=WDTPW+WDTHOLD;      // disable Watchdog

  119.   Clock_Init();
  120.   GPIO_INIT();  // GPIO Initialization
  121.   Timer_Init(); // Timer Initialization

  122.   temp_flash_key = FWKEY;         //
  123.   TI_DALI_Init(temp_flash_key);   // Initialize WDT for DALI fade implementation
  124.   temp_flash_key = 0;

  125.   TAxCTL |= MC_1;  // start Timer_A (up mode)
  126.   __enable_interrupt(); // enable maskable interrupts

  127.   TI_DALI_Transaction_Loop();
  128.   /* should never return */
  129.   while(1);
  130. } //End Main

  131. static void Clock_Init(void)
  132. {
  133.     DCOCTL = 0;
  134.     BCSCTL1= CALBC1_8MHZ;      // System Clock Settings
  135.     DCOCTL = CALDCO_8MHZ;      // use calibrated 8MHz settings
  136.                                // This should be coordinated with the dali.h file
  137. }

  138. static void Timer_Init(void)
  139. {
  140.     /*** PWM Timer Initialization ***********************************************/
  141.      TPS62260_ENABLE_PxOUT &= ~TPS62260_ENABLE_BIT;           // Turn off LEDs
  142.      TAxCTL = TASSEL_2+ID_0+MC_0+TACLR;   // Timer clock = SMCLK = 8MHz
  143.      TAxCCR0=5000;    // Define 1.6Khz frequency
  144.      TAxCCR1=LED[power_on_level];         // This power level will be overwritten
  145.      TAxCCR2=LED[power_on_level];         // by the reception of a power command
  146.                                          // within 0.6 seconds.  After this time
  147.                                          // the device will automatically go to
  148.                                          // the power on level if no command is
  149.                                          // received.
  150.      TAxCCTL1 = CM_0+CCIS_2+OUTMOD_3;     // ReSet on TACCRx, set on TACCR0
  151.      TAxCCTL2 = CM_0+CCIS_2+OUTMOD_3;
  152.      /****************************************************************************/
  153. }

  154. void TI_DALI_Update_Callback()
  155. {
  156.   TAxCCTL1 |= CCIE;
  157. }

  158. void TI_DALI_Idle_Callback(void)
  159. {
  160.   __no_operation();
  161. }

  162. /******************************************************************************/
  163. // Timer_A Interrupt Service Routine:
  164. /******************************************************************************/
  165. #pragma vector=TIMER_VECTOR
  166. __interrupt void ISR_TimerA(void)
  167. {
  168.   if(actual_level==OFF)
  169.   {
  170.       /* turn off LEDs */
  171.       TPS62260_ENABLE_PxOUT &= ~TPS62260_ENABLE_BIT;
  172.       TAxCCR1 = 0x00;
  173.       TAxCCR2 = 0x00;
  174.   }
  175.   else
  176.   {
  177.           //--- PWM signal generation
  178.       TPS62260_ENABLE_PxOUT|= TPS62260_ENABLE_BIT;
  179.       TAxCCR1=LED[actual_level]; //
  180.       TAxCCR2=LED[actual_level]; //
  181.   }
  182.   TAxCCTL1 &= ~CCIE;
  183. }

  184. /******************************************************************************/
  185. // Power loss event, save settings
  186. /******************************************************************************/
  187. //  if(flash_update_request)
  188. //  {
  189. //    TI_DALI_Flash_Update(FWKEY);
  190. //    WDTCTL = 0x05;  // illegal write to watch dog causes reset
  191. //  }


  192. #pragma vector=DUMMY_VECTORS
  193. __interrupt void ISR_Dummy(void)
  194. {
  195.     while(1)
  196.     {
  197.     }
  198. }
复制代码



全部资料(压缩包)下载:


软件代码.zip

48.67 KB, 下载次数: 32, 下载积分: 黑币 -5

物料清单 (BOM).pdf

16.7 KB, 下载次数: 21, 下载积分: 黑币 -5

相关设计参考资料.zip

4.45 MB, 下载次数: 27, 下载积分: 黑币 -5

硬件设计gerber文件.zip

13.98 KB, 下载次数: 23, 下载积分: 黑币 -5

评分

参与人数 1黑币 +5 收起 理由
zhs + 5 共享资料的黑币奖励!

查看全部评分

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏2 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:111490 发表于 2017-11-9 16:50 | 只看该作者
学习!!!!
回复

使用道具 举报

板凳
ID:170509 发表于 2018-8-3 16:40 | 只看该作者
学习这个不错。最近刚好要用到。
回复

使用道具 举报

地板
ID:27027 发表于 2019-1-4 08:26 | 只看该作者
主要用途在哪里
寻址照明控制,可以复联多少
回复

使用道具 举报

5#
ID:464689 发表于 2019-1-8 16:13 来自手机 | 只看该作者
不错俄
回复

使用道具 举报

6#
ID:25310 发表于 2019-3-1 11:41 | 只看该作者
不错。这个可以有。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表