搜索
bottom↓
回复: 3

MSP430F449 LCD COMx口测不到波形

[复制链接]

出0入0汤圆

发表于 2015-1-7 16:58:20 | 显示全部楼层 |阅读模式
用官方的例程跑,但是用示波器看不到COMx口的波形


  1. /* --COPYRIGHT--,BSD_EX
  2. * Copyright (c) 2012, Texas Instruments Incorporated
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. *
  9. * *  Redistributions of source code must retain the above copyright
  10. *    notice, this list of conditions and the following disclaimer.
  11. *
  12. * *  Redistributions in binary form must reproduce the above copyright
  13. *    notice, this list of conditions and the following disclaimer in the
  14. *    documentation and/or other materials provided with the distribution.
  15. *
  16. * *  Neither the name of Texas Instruments Incorporated nor the names of
  17. *    its contributors may be used to endorse or promote products derived
  18. *    from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  21. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  22. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  23. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  24. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  25. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  26. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  27. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  28. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  29. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  30. * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. *
  32. *******************************************************************************
  33. *
  34. *                       MSP430 CODE EXAMPLE DISCLAIMER
  35. *
  36. * MSP430 code examples are self-contained low-level programs that typically
  37. * demonstrate a single peripheral function or device feature in a highly
  38. * concise manner. For this the code may rely on the device's power-on default
  39. * register values and settings such as the clock configuration and care must
  40. * be taken when combining code from several examples to avoid potential side
  41. * effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware
  42. * for an API functional library-approach to peripheral configuration.
  43. *
  44. * --/COPYRIGHT--*/
  45. //*****************************************************************************
  46. //  MSP-FET430P440 Demo - LCD, Display "6543210" on STK/EVK LCD
  47. //
  48. //  Description: Displays "6543210" on MSP-EVK430S320 LCD.
  49. //  ACLK = LFXT1 = 32768Hz, MCLK = SMCLK = default DCO = 32 x ACLK = 1048576Hz
  50. //  //* An external watch crystal between XIN & XOUT is required for ACLK *//       
  51. //
  52. //                                Connections MSP430 -> LCD
  53. //                                -------------------------
  54. //
  55. //                                             T.I. MSP-EVK430S320
  56. //                            MSP430F449       6.5 digit 4 mux LCD
  57. //                                                   #T218010
  58. //                      /|\ ---------------       --------------
  59. //                       | |          COM3 |-----|2    COM4     |
  60. //                       --|RST       COM2 |-----|1    COM3     |
  61. //                         |          COM1 |-----|3    COM2     |
  62. //                         |          COM0 |-----|4,20 COM1     |
  63. //                        -|XIN       SEG0 |-----|19            |
  64. //                    32kHz|          SEG1 |-----|18            |
  65. //                        -|XOUT      SEG2 |-----|17            |
  66. //                         |          SEG3 |-----|16            |
  67. //                         |          SEG4 |-----|15            |
  68. //                         |          SEG5 |-----|14            |
  69. //                         |          SEG6 |-----|13            |
  70. //                         |          SEG7 |-----|12            |
  71. //                       +-|R33       SEG8 |-----|11            |
  72. //                      1M |          SEG9 |-----|10            |
  73. //                       +-|R23       SEG10|-----|9             |
  74. //                      1M |          SEG11|-----|8             |
  75. //                       +-|R13       SEG12|-----|7             |
  76. //                      1M |          SEG13|-----|6             |
  77. //                       +-|R03       SEG14|-----|5 (bits C,E,H |
  78. //                       | |               |     |   of digit 7)|
  79. //                      Vss ---------------       --------------
  80. //
  81. //  M. Buccini / H. Grewal
  82. //  Texas Instruments Inc.
  83. //  Feb 2005
  84. //  Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.21A
  85. //*****************************************************************************
  86. #include <msp430.h>

  87. const char digit[10] =
  88. {
  89.   0xB7,  /* "0" LCD segments a+b+c+d+e+f */
  90.   0x12,  /* "1" */
  91.   0x8F,  /* "2" */
  92.   0x1F,  /* "3" */
  93.   0x3A,  /* "4" */
  94.   0x3D,  /* "5" */
  95.   0xBD,  /* "6" */
  96.   0x13,  /* "7" */
  97.   0xBF,  /* "8" */
  98.   0x3F   /* "9" */
  99. };

  100. int main(void)
  101. {
  102.   volatile unsigned int i;                  // Use volatile to prevent removal
  103.                                             // by compiler optimization

  104.   WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
  105.   FLL_CTL0 |= XCAP14PF;                     // Configure load caps
  106.   for (i = 0; i < 10000; i++);              // Delay for 32 kHz crystal to
  107.                                             // stabilize

  108.   LCDCTL = LCDON + LCD4MUX + LCDSG0_4;      // LCD on, 4-Mux, segments S0-S27
  109.   BTCTL = BT_fLCD_DIV128;                   // LCD clock freq is ACLK/128
  110.   P5SEL = 0xFC;                             // Select P5.2-7 as Com and Rxx

  111.   for (;;)
  112.   {
  113.     unsigned char x;

  114.     for (x=0; x<7; x++)
  115.     {
  116.       LCDMEM[x] = digit[x];                 // Display "6543210"
  117.     }
  118.   }
  119. }

复制代码

阿莫论坛20周年了!感谢大家的支持与爱护!!

一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。

出0入0汤圆

发表于 2015-1-7 21:55:54 | 显示全部楼层
官网的例程应该不会有问题,确定单片机运行起来了没?

出0入0汤圆

 楼主| 发表于 2015-1-8 10:57:59 | 显示全部楼层
huhandong 发表于 2015-1-7 21:55
官网的例程应该不会有问题,确定单片机运行起来了没?

确定!官网其他的例程都能正常用 485 spi adc什么的。
LCD就只有COM0能用

出0入0汤圆

 楼主| 发表于 2015-1-8 14:41:09 | 显示全部楼层
结贴!问题解决,详细的问题描述修改整理后在
http://www.amobbs.com/thread-5607447-1-1.html
发布
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-3-29 21:53

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

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