找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開(kāi)始

搜索
查看: 5176|回復(fù): 3
收起左側(cè)

dsp2812的12864液晶顯示源碼

[復(fù)制鏈接]
ID:209216 發(fā)表于 2017-8-8 08:10 | 顯示全部樓層 |閱讀模式
利用DSP2812處理器和12864顯示文字
0.png

所有資料51hei提供下載:
Example_281x_Lcd12864.rar (143.1 KB, 下載次數(shù): 40)

單片機(jī)源程序如下:

  1. //###########################################################################
  2. //
  3. // FILE:    Example_2833xI2c_eeprom.c
  4. //
  5. // TITLE:   DSP2833x I2C EEPROM Example
  6. //
  7. // ASSUMPTIONS:
  8. //
  9. //    This program requires the DSP2833x header files.
  10. //
  11. //    This program requires an external I2C EEPROM connected to
  12. //    the I2C bus at address 0x50.
  13. //
  14. //    As supplied, this project is configured for "boot to SARAM"
  15. //    operation.  The 2833x Boot Mode table is shown below.
  16. //    For information on configuring the boot mode of an eZdsp,
  17. //    please refer to the documentation included with the eZdsp,
  18. //
  19. //       $Boot_Table:
  20. //
  21. //         GPIO87   GPIO86     GPIO85   GPIO84
  22. //          XA15     XA14       XA13     XA12
  23. //           PU       PU         PU       PU
  24. //        ==========================================
  25. //            1        1          1        1    Jump to Flash
  26. //            1        1          1        0    SCI-A boot
  27. //            1        1          0        1    SPI-A boot
  28. //            1        1          0        0    I2C-A boot
  29. //            1        0          1        1    eCAN-A boot
  30. //            1        0          1        0    McBSP-A boot
  31. //            1        0          0        1    Jump to XINTF x16
  32. //            1        0          0        0    Jump to XINTF x32
  33. //            0        1          1        1    Jump to OTP
  34. //            0        1          1        0    Parallel GPIO I/O boot
  35. //            0        1          0        1    Parallel XINTF boot
  36. //            0        1          0        0    Jump to SARAM            <- "boot to SARAM"
  37. //            0        0          1        1    Branch to check boot mode
  38. //            0        0          1        0    Boot to flash, bypass ADC cal
  39. //            0        0          0        1    Boot to SARAM, bypass ADC cal
  40. //            0        0          0        0    Boot to SCI-A, bypass ADC cal
  41. //                                              Boot_Table_End$
  42. //
  43. // DESCRIPTION:
  44. //
  45. //    This program will write 1-14 words to EEPROM and read them back.
  46. //    The data written and the EEPROM address written to are contained
  47. //    in the message structure, I2cMsgOut1. The data read back will be
  48. //    contained in the message structure I2cMsgIn1.
  49. //
  50. //    This program will work with the on-board I2C EEPROM supplied on
  51. //    the F2833x eZdsp.
  52. //
  53. //
  54. //###########################################################################
  55. // Original Author: D.F.
  56. //
  57. // $TI Release: 2833x/2823x Header Files and Peripheral Examples V133 $
  58. // $Release Date: June 8, 2012 $
  59. //###########################################################################


  60. #include "DSP281x_Device.h"
  61. #include "DSP281x_Examples.h"

  62. // Note: I2C Macros used in this example can be found in the
  63. // DSP2833x_I2C_defines.h file

  64. // Prototype statements for functions found within this file.

  65. extern void Lcd_12864_Test(void);
  66. extern void Init_Port(void);
  67. void main(void)
  68. {


  69. // Step 1. Initialize System Control:
  70. // PLL, WatchDog, enable Peripheral Clocks
  71. // This example function is found in the DSP2833x_SysCtrl.c file.
  72.    InitSysCtrl();


  73. // Step 2. Initalize GPIO:
  74. // This example function is found in the DSP2833x_Gpio.c file and
  75. // illustrates how to set the GPIO to it's default state.
  76. // InitGpio();
  77. // Setup only the GP I/O only for I2C functionality

  78. // Step 3. Clear all interrupts and initialize PIE vector table:
  79. // Disable CPU interrupts
  80.    DINT;

  81. // Initialize PIE control registers to their default state.
  82. // The default state is all PIE interrupts disabled and flags
  83. // are cleared.
  84. // This function is found in the DSP2833x_PieCtrl.c file.
  85.    InitPieCtrl();

  86. // Disable CPU interrupts and clear all CPU interrupt flags:
  87.    IER = 0x0000;
  88.    IFR = 0x0000;

  89. // Initialize the PIE vector table with pointers to the shell Interrupt
  90. // Service Routines (ISR).
  91. // This will populate the entire table, even if the interrupt
  92. // is not used in this example.  This is useful for debug purposes.
  93. // The shell ISR routines are found in DSP2833x_DefaultIsr.c.
  94. // This function is found in DSP2833x_PieVect.c.
  95.    InitPieVectTable();

  96. // Interrupts that are used in this example are re-mapped to
  97. // ISR functions found within this file.

  98.    Init_Port();
  99. // Step 4. Initialize all the Device Peripherals:
  100. // This function is found in DSP2833x_InitPeripherals.c
  101. // InitPeripherals(); // Not required for this example

  102. // Step 5. User specific code



  103. // Enable interrupts required for this example


  104. // Enable CPU INT8 which is connected to PIE group 8

  105.    EINT;   // Enable Global interrupt INTM

  106.    for(;;)
  107.    {
  108.                 Lcd_12864_Test();
  109.    }   // end of for(;;)
  110. //#endif
  111. }   // end of main






  112. //===========================================================================
  113. // No more.
  114. //===========================================================================

復(fù)制代碼





評(píng)分

參與人數(shù) 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎(jiǎng)勵(lì)!

查看全部評(píng)分

回復(fù)

使用道具 舉報(bào)

ID:247467 發(fā)表于 2018-4-18 19:59 | 顯示全部樓層
看著不錯(cuò),可以試試看,也是剛開(kāi)學(xué)習(xí),先跑個(gè)程序試試
回復(fù)

使用道具 舉報(bào)

ID:327568 發(fā)表于 2018-5-11 14:11 | 顯示全部樓層
我用的是5502芯片 液晶也是12864的 能顯示嘛
回復(fù)

使用道具 舉報(bào)

ID:374389 發(fā)表于 2018-7-18 20:50 | 顯示全部樓層
新人能看不能下囧
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表