[讨论] 一个调试通过的LED循环走字屏程序

clark   2010-2-8 11:34 楼主
1、今天刚调试通过就挂上来了,大家支持一下,哈哈!!

2、还从中发现一个问题,这个程序用PICC9。65和谐版,就不能编译通过,而用PICC9。5却可以编译通过。

3、PICC9。65报错是因为定义了大数组(可能超2K了,涉及程序空间跨页问题了),就无法编译通过了,而用PICC9。5却没有这个问题,看来PICC9。65和谐版还有一些不尽如人意的地方啦。

4、所以忍痛割爱卸掉了9。65 又装上了PICC9。5,是网友木鱼( QQ: 362862933)帮助发现这一问题,在此表示感谢!!
程序如下:各位可以不防一试(C编译器)

  1. // A B C D 对应RB0; RB1 ;RB2; RB3//
  2. //------------------------------//
  3. //用到了单片机9个端口 RB0-RB7,和RA0//
  4. //晶振频率使用20MHz。
  5. //单片机型号为16F877A
  6. #include "pic.h"
  7. __CONFIG(HS&WDTEN&PWRTEN&BOREN&LVPDIS&DEBUGDIS&UNPROTECT&WP3);
  8. #define uchar unsigned char
  9. #define uint unsigned int
  10. void Keyscan (void); //修改参数按键扫描子程序
  11. void Sendping(); //发送半屏子程序
  12. #define clk RB5
  13. #define rclk RB4 //锁存用的
  14. #define red RB6
  15. #define green RB7 //试验证明,RB7可能接的是红色。
  16. uchar wei; //左移一位记录
  17. uchar word; //显示字记录
  18. uchar hang; //行扫描
  19. uchar sec50; //左移时间
  20. const uchar speed=100; //速度值.
  21. bit l;
  22. #define gen RA0 //行扫描使能端,低电平有效,试验证明,此脚一直为低电平不用控制也可。
  23. uchar const hanzi[][32]={
  24. {//电[16*16]横排0
  25. 0x01,0x00,0x01,0x00,
  26. 0x01,0x00,0x3F,0xF8,
  27. 0x21,0x08,0x21,0x08,
  28. 0x3F,0xF8,0x21,0x08,
  29. 0x21,0x08,0x21,0x08,
  30. 0x3F,0xF8,0x21,0x08,
  31. 0x01,0x02,0x01,0x02,
  32. 0x00,0xFE,0x00,0x00},
  33. {//气[16*16]横排1
  34. 0x08,0x00,0x08,0x00,
  35. 0x1F,0xFE,0x10,0x00,
  36. 0x20,0x00,0x4F,0xF8,
  37. 0x00,0x00,0x1F,0xF0,
  38. 0x00,0x10,0x00,0x10,
  39. 0x00,0x10,0x00,0x10,
  40. 0x00,0x0A,0x00,0x0A,
  41. 0x00,0x06,0x00,0x02},
  42. {//自[16*16]横排2
  43. 0x01,0x00,0x01,0x80,
  44. 0x02,0x00,0x1F,0xF8,
  45. 0x10,0x08,0x10,0x08,
  46. 0x1F,0xF8,0x10,0x08,
  47. 0x10,0x08,0x10,0x08,
  48. 0x1F,0xF8,0x10,0x08,
  49. 0x10,0x08,0x10,0x08,
  50. 0x1F,0xF8,0x10,0x08},
  51. {//动[16*16]横排3
  52. 0x00,0x20,0x00,0x20,
  53. 0x7E,0x20,0x00,0x20,
  54. 0x00,0xFC,0xFF,0x24,
  55. 0x10,0x24,0x10,0x24,
  56. 0x24,0x24,0x22,0x24,
  57. 0x4F,0x44,0xFA,0x44,
  58. 0x40,0x84,0x01,0x14,
  59. 0x02,0x08,0x00,0x00},
  60. {//化[16*16]横排4
  61. 0x08,0x80,0x0C,0x80,
  62. 0x08,0x88,0x10,0x8C,
  63. 0x10,0x98,0x30,0xB0,
  64. 0x50,0xE0,0x90,0xC0,
  65. 0x11,0x80,0x12,0x80,
  66. 0x14,0x80,0x10,0x84,
  67. 0x10,0x84,0x10,0x84,
  68. 0x10,0x7C,0x00,0x00},
  69. {//方[16*16]横排5
  70. 0x02,0x00,0x01,0x00,
  71. 0x00,0x80,0xFF,0xFE,
  72. 0x02,0x00,0x02,0x00,
  73. 0x03,0xF0,0x02,0x10,
  74. 0x04,0x10,0x04,0x10,
  75. 0x08,0x10,0x08,0x10,
  76. 0x10,0x10,0x20,0x90,
  77. 0xC0,0x60,0x00,0x00},
  78. {//案[16*16]横排6
  79. 0x02,0x00,0x01,0x00,
  80. 0x3F,0xFC,0x22,0x08,
  81. 0x04,0x40,0x7F,0xFC,
  82. 0x0C,0x80,0x03,0x80,
  83. 0x1E,0x60,0x01,0x20,
  84. 0x7F,0xFE,0x03,0x40,
  85. 0x0D,0x30,0x71,0x0E,
  86. 0x01,0x04,0x01,0x00},
  87. {//及[16*16]横排7
  88. 0x00,0x00,0x3F,0xE0,
  89. 0x04,0x20,0x04,0x20,
  90. 0x04,0x40,0x04,0x40,
  91. 0x04,0xF8,0x0A,0x50,
  92. 0x0A,0x10,0x09,0x20,
  93. 0x11,0x20,0x10,0xC0,
  94. 0x21,0x20,0x42,0x18,
  95. 0x8C,0x0E,0x30,0x04},
  96. {//电[16*16]横排8
  97. 0x01,0x00,0x01,0x00,
  98. 0x01,0x00,0x3F,0xF8,
  99. 0x21,0x08,0x21,0x08,
  100. 0x3F,0xF8,0x21,0x08,
  101. 0x21,0x08,0x21,0x08,
  102. 0x3F,0xF8,0x21,0x08,
  103. 0x01,0x02,0x01,0x02,
  104. 0x00,0xFE,0x00,0x00},
  105. {//子[16*16]横排9
  106. 0x00,0x00,0x3F,0xF0,
  107. 0x00,0x20,0x00,0x40,
  108. 0x00,0x80,0x01,0x00,
  109. 0x01,0x00,0x01,0x04,
  110. 0xFF,0xFE,0x01,0x00,
  111. 0x01,0x00,0x01,0x00,
  112. 0x01,0x00,0x01,0x00,
  113. 0x05,0x00,0x02,0x00},
  114. {//线[16*16]横排10
  115. 0x10,0x40,0x18,0x50,
  116. 0x10,0x4C,0x20,0x48,
  117. 0x23,0xFC,0x48,0x40,
  118. 0xF8,0x40,0x13,0xFE,
  119. 0x20,0x40,0x7C,0x48,
  120. 0x00,0x30,0x00,0x22,
  121. 0x1C,0xD2,0xE3,0x0A,
  122. 0x00,0x06,0x00,0x02},


DIY是一种信仰~~

回复评论 (4)

  1. {//路[16*16]横排11
  2. 0x00,0x80,0x78,0x80,
  3. 0x48,0xFC,0x49,0x88,
  4. 0x4A,0x48,0x7C,0x50,
  5. 0x50,0x20,0x10,0x58,
  6. 0x5D,0x86,0x53,0xFC,
  7. 0x51,0x08,0x51,0x08,
  8. 0x5D,0x08,0xE1,0xF8,
  9. 0x01,0x08,0x00,0x00},
  10. {//设[16*16]横排12
  11. 0x40,0x00,0x21,0xF0,
  12. 0x31,0x10,0x21,0x10,
  13. 0x01,0x10,0x01,0x10,
  14. 0xE2,0x0E,0x25,0xF8,
  15. 0x21,0x08,0x21,0x08,
  16. 0x20,0x90,0x20,0x90,
  17. 0x28,0x60,0x30,0x90,
  18. 0x23,0x0E,0x0C,0x04},
  19. {//计[16*16]横排13
  20. 0x40,0x20,0x20,0x20,
  21. 0x30,0x20,0x20,0x20,
  22. 0x00,0x20,0xF3,0xFE,
  23. 0x10,0x20,0x10,0x20,
  24. 0x10,0x20,0x10,0x20,
  25. 0x10,0x20,0x12,0x20,
  26. 0x14,0x20,0x18,0x20,
  27. 0x10,0x20,0x00,0x20},
  28. {//开[16*16]横排14
  29. 0x00,0x00,0x7F,0xFE,
  30. 0x04,0x20,0x04,0x20,
  31. 0x04,0x20,0x04,0x20,
  32. 0xFF,0xFE,0x04,0x20,
  33. 0x04,0x20,0x04,0x20,
  34. 0x08,0x20,0x08,0x20,
  35. 0x10,0x20,0x20,0x20,
  36. 0x40,0x20,0x00,0x00},
  37. {//发[16*16]横排15
  38. 0x02,0x00,0x22,0x40,
  39. 0x22,0x30,0x22,0x10,
  40. 0x7F,0xFE,0x24,0x00,
  41. 0x04,0x00,0x07,0xE0,
  42. 0x0C,0x20,0x0A,0x20,
  43. 0x0A,0x20,0x11,0x40,
  44. 0x20,0x80,0x41,0x60,
  45. 0x86,0x1C,0x18,0x08},
  46. {//,[16*16]横排16
  47. 0x00,0x00,0x00,0x00,
  48. 0x00,0x00,0x00,0x00,
  49. 0x00,0x00,0x00,0x00,
  50. 0x00,0x00,0x00,0x00,
  51. 0x00,0x00,0x00,0x00,
  52. 0x00,0x00,0x30,0x00,
  53. 0x30,0x00,0x10,0x00,
  54. 0x20,0x00,0x00,0x00},
  55. {//只[16*16]横排17
  56. 0x00,0x00,0x1F,0xF8,
  57. 0x10,0x08,0x10,0x08,
  58. 0x10,0x08,0x10,0x08,
  59. 0x10,0x08,0x1F,0xF8,
  60. 0x10,0x08,0x04,0x20,
  61. 0x06,0x10,0x0C,0x08,
  62. 0x18,0x0C,0x30,0x06,
  63. 0x40,0x04,0x00,0x00},

  64. {//要[16*16]横排18
  65. 0x00,0x00,0xFF,0xFE,
  66. 0x04,0x40,0x3F,0xF8,
  67. 0x24,0x48,0x24,0x48,
  68. 0x3F,0xF8,0x24,0x08,
  69. 0x04,0x00,0xFF,0xFE,
  70. 0x08,0x10,0x0E,0x20,
  71. 0x01,0xC0,0x06,0x30,
  72. 0x18,0x0C,0x60,0x08},
  73. {//您[16*16]横排19
  74. 0x08,0x00,0x09,0x00,
  75. 0x11,0xFE,0x12,0x04,
  76. 0x34,0x40,0x32,0x50,
  77. 0x52,0x48,0x94,0x44,
  78. 0x11,0x44,0x10,0x80,
  79. 0x00,0x00,0x29,0x04,
  80. 0x28,0x92,0x68,0x12,
  81. 0x07,0xF0,0x00,0x00},
  82. {//有[16*16]横排20
  83. 0x01,0x00,0x01,0x00,
  84. 0x7F,0xFE,0x02,0x00,
  85. 0x04,0x00,0x0F,0xF0,
  86. 0x18,0x10,0x28,0x10,
  87. 0x4F,0xF0,0x88,0x10,
  88. 0x08,0x10,0x0F,0xF0,
  89. 0x08,0x10,0x08,0x90,
  90. 0x08,0x70,0x08,0x20},
  91. {//控[16*16]横排21
  92. 0x10,0x00,0x10,0x20,
  93. 0x10,0x10,0xFD,0xFE,
  94. 0x11,0x04,0x10,0x50,
  95. 0x14,0x8C,0x19,0x04,
  96. 0x30,0x00,0xD1,0xFC,
  97. 0x10,0x20,0x10,0x20,
  98. 0x10,0x20,0x10,0x20,
  99. 0x53,0xFE,0x20,0x00},
  100. {//制[16*16]横排22
  101. 0x24,0x04,0x34,0x04,
  102. 0x24,0x24,0x3F,0xA4,
  103. 0x44,0x24,0x04,0x24,
  104. 0x7F,0xA4,0x04,0x24,
  105. 0x3F,0xA4,0x24,0xA4,
  106. 0x24,0xA4,0x24,0xA4,
  107. 0x24,0x84,0x27,0x84,
  108. 0x05,0x14,0x04,0x08},
  109. {//思[16*16]横排23
  110. 0x00,0x00,0x1F,0xF8,
  111. 0x11,0x08,0x11,0x08,
  112. 0x1F,0xF8,0x11,0x08,
  113. 0x11,0x08,0x1F,0xF8,
  114. 0x00,0x00,0x01,0x00,
  115. 0x08,0x88,0x48,0x84,
  116. 0x48,0x16,0xC8,0x12,
  117. 0x07,0xF0,0x00,0x00},
  118. {//路[16*16]横排24
  119. 0x00,0x80,0x78,0x80,
  120. 0x48,0xFC,0x49,0x88,
  121. 0x4A,0x48,0x7C,0x50,
  122. 0x50,0x20,0x10,0x58,
  123. 0x5D,0x86,0x53,0xFC,
  124. 0x51,0x08,0x51,0x08,
  125. 0x5D,0x08,0xE1,0xF8,
  126. 0x01,0x08,0x00,0x00},
  127. {//,[16*16]横排25
  128. 0x00,0x00,0x00,0x00,
  129. 0x00,0x00,0x00,0x00,
  130. 0x00,0x00,0x00,0x00,
  131. 0x00,0x00,0x00,0x00,
  132. 0x00,0x00,0x00,0x00,
  133. 0x00,0x00,0x30,0x00,
  134. 0x30,0x00,0x10,0x00,
  135. 0x20,0x00,0x00,0x00},
  136. {//我[16*16]横排26
  137. 0x06,0x40,0x38,0x50,
  138. 0x08,0x48,0x08,0x48,
  139. 0x08,0x40,0xFF,0xFE,
  140. 0x08,0x40,0x08,0x48,
  141. 0x0E,0x28,0x38,0x30,
  142. 0xC8,0x20,0x08,0x50,
  143. 0x09,0x92,0x08,0x0A,
  144. 0x28,0x06,0x10,0x02},
  145. {//们[16*16]横排27
  146. 0x0A,0x00,0x09,0x00,
  147. 0x11,0xBC,0x11,0x04,
  148. 0x34,0x04,0x24,0x04,
  149. 0x64,0x04,0xA4,0x04,
  150. 0x24,0x04,0x24,0x04,
  151. 0x24,0x04,0x24,0x04,
  152. 0x24,0x04,0x24,0x14,
  153. 0x24,0x08,0x00,0x00},
  154. {//就[16*16]横排28
  155. 0x10,0x20,0x08,0x28,
  156. 0xFF,0x24,0x00,0x24,
  157. 0x00,0x20,0x7F,0xFE,
  158. 0x42,0x50,0x42,0x50,
  159. 0x7E,0x50,0x08,0x50,
  160. 0x2C,0x50,0x2A,0x90,
  161. 0x4A,0x92,0x89,0x12,
  162. 0x2A,0x0E,0x10,0x00},

  163. {//会[16*16]横排29
  164. 0x01,0x00,0x01,0x00,
  165. 0x02,0x80,0x04,0x40,
  166. 0x08,0x20,0x10,0x18,
  167. 0x6F,0xEE,0x80,0x04,
  168. 0x00,0x00,0x3F,0xF8,
  169. 0x02,0x00,0x04,0x20,
  170. 0x08,0x10,0x11,0xF8,
  171. 0x3F,0x18,0x10,0x10},
  172. {//以[16*16]横排30
  173. 0x00,0x10,0x24,0x10,
  174. 0x22,0x10,0x23,0x10,
  175. 0x22,0x10,0x20,0x10,
  176. 0x20,0x10,0x21,0x10,
  177. 0x22,0x10,0x2C,0x30,
  178. 0x38,0x30,0x70,0x68,
  179. 0x20,0xC4,0x01,0x07,
  180. 0x06,0x02,0x00,0x00},
DIY是一种信仰~~
点赞  2010-2-8 11:35
  1. {//经[16*16]横排31
  2. 0x10,0x00,0x11,0xFC,
  3. 0x20,0x08,0x20,0x10,
  4. 0x48,0x30,0xF0,0xC8,
  5. 0x13,0x06,0x20,0x02,
  6. 0x41,0xFC,0xF8,0x20,
  7. 0x00,0x20,0x00,0x20,
  8. 0x18,0x20,0xE3,0xFE,
  9. 0x00,0x00,0x00,0x00},
  10. {//济[16*16]横排32
  11. 0x40,0x80,0x20,0x40,
  12. 0x27,0xFE,0x01,0x10,
  13. 0x88,0xA0,0x48,0x40,
  14. 0x51,0xB0,0x16,0x0E,
  15. 0x11,0x10,0x21,0x10,
  16. 0xE1,0x10,0x21,0x10,
  17. 0x22,0x10,0x22,0x10,
  18. 0x24,0x10,0x28,0x10},
  19. {//、[16*16]横排33
  20. 0x00,0x00,0x00,0x00,
  21. 0x00,0x00,0x00,0x00,
  22. 0x00,0x00,0x00,0x00,
  23. 0x00,0x00,0x00,0x00,
  24. 0x00,0x00,0x00,0x00,
  25. 0x00,0x00,0x60,0x00,
  26. 0x30,0x00,0x10,0x00,
  27. 0x00,0x00,0x00,0x00},
  28. {//合[16*16]横排34
  29. 0x01,0x00,0x02,0x80,
  30. 0x04,0x40,0x08,0x20,
  31. 0x10,0x18,0x20,0x2E,
  32. 0xDF,0xF4,0x00,0x00,
  33. 0x00,0x00,0x1F,0xF0,
  34. 0x10,0x10,0x10,0x10,
  35. 0x10,0x10,0x1F,0xF0,
  36. 0x10,0x10,0x00,0x00},
  37. {//理[16*16]横排35
  38. 0x00,0x00,0x03,0xFC,
  39. 0xFA,0x44,0x22,0x44,
  40. 0x23,0xFC,0x22,0x44,
  41. 0xFA,0x44,0x23,0xFC,
  42. 0x22,0x44,0x20,0x40,
  43. 0x23,0xFC,0x38,0x40,
  44. 0xC0,0x40,0x00,0x40,
  45. 0x0F,0xFE,0x00,0x00},
  46. {//、[16*16]横排36
  47. 0x00,0x00,0x00,0x00,
  48. 0x00,0x00,0x00,0x00,
  49. 0x00,0x00,0x00,0x00,
  50. 0x00,0x00,0x00,0x00,
  51. 0x00,0x00,0x00,0x00,
  52. 0x00,0x00,0x60,0x00,
  53. 0x30,0x00,0x10,0x00,
  54. 0x00,0x00,0x00,0x00},
  55. {//可[16*16]横排37
  56. 0x00,0x00,0x7F,0xFE,
  57. 0x00,0x08,0x00,0x08,
  58. 0x1F,0x88,0x10,0x88,
  59. 0x10,0x88,0x10,0x88,
  60. 0x10,0x88,0x1F,0x88,
  61. 0x10,0x88,0x00,0x08,
  62. 0x00,0x48,0x00,0x28,
  63. 0x00,0x10,0x00,0x00},
  64. {//靠[16*16]横排38
  65. 0x01,0x00,0x11,0x00,
  66. 0x1F,0xF8,0x21,0x00,
  67. 0x7F,0xFE,0x10,0x10,
  68. 0x10,0x10,0x1F,0xF0,
  69. 0x04,0x40,0x7C,0x7E,
  70. 0x04,0x40,0x3C,0x7C,
  71. 0x04,0x40,0xFC,0x7E,
  72. 0x04,0x40,0x04,0x40},
  73. {//的[16*16]横排39
  74. 0x10,0x80,0x10,0x80,
  75. 0x20,0x80,0x7C,0xFC,
  76. 0x45,0x04,0x45,0x04,
  77. 0x46,0x04,0x7C,0x84,
  78. 0x44,0x44,0x44,0x64,
  79. 0x44,0x24,0x44,0x04,
  80. 0x7C,0x04,0x44,0x28,
  81. 0x40,0x10,0x00,0x00},
  82. {//方[16*16]横排40
  83. 0x02,0x00,0x01,0x00,
  84. 0x00,0x80,0xFF,0xFE,
  85. 0x02,0x00,0x02,0x00,
  86. 0x03,0xF0,0x02,0x10,
  87. 0x04,0x10,0x04,0x10,
  88. 0x08,0x10,0x08,0x10,
  89. 0x10,0x10,0x20,0x90,
  90. 0xC0,0x60,0x00,0x00},
  91. {//案[16*16]横排41
  92. 0x02,0x00,0x01,0x00,
  93. 0x3F,0xFC,0x22,0x08,
  94. 0x04,0x40,0x7F,0xFC,
  95. 0x0C,0x80,0x03,0x80,
  96. 0x1E,0x60,0x01,0x20,
  97. 0x7F,0xFE,0x03,0x40,
  98. 0x0D,0x30,0x71,0x0E,
  99. 0x01,0x04,0x01,0x00},
  100. {//助[16*16]横排42
  101. 0x00,0x20,0x3E,0x20,
  102. 0x22,0x20,0x22,0x20,
  103. 0x22,0xFC,0x3E,0x24,
  104. 0x22,0x24,0x22,0x24,
  105. 0x3E,0x24,0x22,0x24,
  106. 0x22,0x44,0x27,0x44,
  107. 0xF8,0x84,0x01,0x14,
  108. 0x02,0x08,0x00,0x00},
  109. {//您[16*16]横排43
  110. 0x08,0x00,0x09,0x00,
  111. 0x11,0xFE,0x12,0x04,
  112. 0x34,0x40,0x32,0x50,
  113. 0x52,0x48,0x94,0x44,
  114. 0x11,0x44,0x10,0x80,
  115. 0x00,0x00,0x29,0x04,
  116. 0x28,0x92,0x68,0x12,
  117. 0x07,0xF0,0x00,0x00},
  118. {//实[16*16]横排44
  119. 0x01,0x00,0x00,0x80,
  120. 0x3F,0xFE,0x28,0x04,
  121. 0x46,0x88,0x04,0x80,
  122. 0x08,0x80,0x06,0x80,
  123. 0x04,0x80,0x7F,0xFE,
  124. 0x00,0x80,0x01,0x40,
  125. 0x02,0x20,0x04,0x10,
  126. 0x18,0x18,0x60,0x10},
  127. {//现[16*16]横排45
  128. 0x00,0x00,0xFF,0xF8,
  129. 0x12,0x08,0x12,0x48,
  130. 0x12,0x48,0x12,0x48,
  131. 0x7E,0x48,0x12,0x48,
  132. 0x12,0x48,0x12,0xA8,
  133. 0x1C,0xA0,0xE1,0x22,
  134. 0x01,0x22,0x02,0x22,
  135. 0x04,0x1E,0x08,0x00},
  136. {//。[16*16]横排46
  137. 0x00,0x00,0x00,0x00,
  138. 0x00,0x00,0x00,0x00,
  139. 0x00,0x00,0x00,0x00,
  140. 0x00,0x00,0x00,0x00,
  141. 0x00,0x00,0x00,0x00,
  142. 0x30,0x00,0x48,0x00,
  143. 0x48,0x00,0x30,0x00,
  144. 0x00,0x00,0x00,0x00},
  145. {//迁[16*16]横排47
  146. 0x00,0x00,0x40,0x3C,
  147. 0x37,0xC0,0x20,0x40,
  148. 0x00,0x40,0x00,0x40,
  149. 0xEF,0xFE,0x20,0x40,
  150. 0x20,0x40,0x20,0x40,
  151. 0x20,0x40,0x20,0x40,
  152. 0x20,0x40,0x50,0x00,
  153. 0x8F,0xFE,0x00,0x00},
  154. {//安[16*16]横排48
  155. 0x02,0x00,0x01,0x00,
  156. 0x3F,0xFE,0x20,0x04,
  157. 0x44,0x08,0x06,0x00,
  158. 0x04,0x00,0xFF,0xFE,
  159. 0x08,0x20,0x08,0x20,
  160. 0x08,0x40,0x06,0x80,
  161. 0x01,0x00,0x06,0xC0,
  162. 0x18,0x38,0xE0,0x10},
  163. {//机[16*16]横排49
  164. 0x10,0x00,0x10,0xF8,
  165. 0x10,0x88,0xFE,0x88,
  166. 0x10,0x88,0x10,0x88,
  167. 0x38,0x88,0x34,0x88,
  168. 0x54,0x88,0x50,0x88,
  169. 0x91,0x08,0x11,0x0A,
  170. 0x12,0x0A,0x12,0x0A,
  171. 0x14,0x06,0x10,0x00},
  172. {//电[16*16]横排50
  173. 0x01,0x00,0x01,0x00,
  174. 0x01,0x00,0x3F,0xF8,
  175. 0x21,0x08,0x21,0x08,
  176. 0x3F,0xF8,0x21,0x08,
  177. 0x21,0x08,0x21,0x08,
  178. 0x3F,0xF8,0x21,0x08,
  179. 0x01,0x02,0x01,0x02,
  180. 0x00,0xFE,0x00,0x00},
  181. {//欢[16*16]横排50
  182. 0x00,0x80,0x00,0x80,
  183. 0xFC,0x80,0x05,0xFE,
  184. 0x85,0x04,0x4A,0x48,
  185. 0x28,0x40,0x10,0x40,
  186. 0x18,0x40,0x18,0x60,
  187. 0x24,0xA0,0x24,0x90,
  188. 0x41,0x18,0x86,0x0E,
  189. 0x38,0x04,0x00,0x00},
DIY是一种信仰~~
点赞  2010-2-8 11:35
  1. {//迎[16*16]横排52
  2. 0x40,0x00,0x21,0x80,
  3. 0x36,0x7C,0x24,0x44,
  4. 0x04,0x44,0x04,0x44,
  5. 0xE4,0x44,0x24,0x44,
  6. 0x25,0x44,0x26,0x54,
  7. 0x24,0x48,0x20,0x40,
  8. 0x20,0x40,0x50,0x00,
  9. 0x8F,0xFE,0x00,0x00},
  10. {//您[16*16]横排53
  11. 0x08,0x00,0x09,0x00,
  12. 0x11,0xFE,0x12,0x04,
  13. 0x34,0x40,0x32,0x50,
  14. 0x52,0x48,0x94,0x44,
  15. 0x11,0x44,0x10,0x80,
  16. 0x00,0x00,0x29,0x04,
  17. 0x28,0x92,0x68,0x12,
  18. 0x07,0xF0,0x00,0x00},

  19. {//的[16*16]横排54
  20. 0x10,0x80,0x10,0x80,
  21. 0x20,0x80,0x7C,0xFC,
  22. 0x45,0x04,0x45,0x04,
  23. 0x46,0x04,0x7C,0x84,
  24. 0x44,0x44,0x44,0x64,
  25. 0x44,0x24,0x44,0x04,
  26. 0x7C,0x04,0x44,0x28,
  27. 0x40,0x10,0x00,0x00},
  28. {//光[16*16]横排55
  29. 0x01,0x00,0x21,0x10,
  30. 0x19,0x18,0x0D,0x10,
  31. 0x09,0x20,0x01,0x04,
  32. 0x7F,0xFE,0x04,0x40,
  33. 0x04,0x40,0x04,0x40,
  34. 0x04,0x40,0x08,0x42,
  35. 0x08,0x42,0x10,0x42,
  36. 0x20,0x3E,0x40,0x00},
  37. {//临[16*16]横排56
  38. 0x01,0x00,0x09,0x80,
  39. 0x09,0x00,0x49,0xFE,
  40. 0x4A,0x20,0x4A,0x10,
  41. 0x4C,0x10,0x49,0x04,
  42. 0x49,0xFE,0x49,0x24,
  43. 0x49,0x24,0x49,0x24,
  44. 0x49,0x24,0x09,0xFC,
  45. 0x09,0x04,0x00,0x00},
  46. {//![16*16]横排57
  47. 0x00,0x00,0x00,0x00,
  48. 0x00,0x00,0x00,0x00,
  49. 0x10,0x00,0x10,0x00,
  50. 0x10,0x00,0x10,0x00,
  51. 0x10,0x00,0x10,0x00,
  52. 0x10,0x00,0x10,0x00,
  53. 0x10,0x00,0x00,0x00,
  54. 0x10,0x00,0x00,0x00},

  55. {//TE[16*16]横排58
  56. 0x00,0x00,0xFF,0x7F,
  57. 0x10,0x40,0x10,0x40,
  58. 0x10,0x40,0x10,0x40,
  59. 0x10,0x40,0x10,0x7E,
  60. 0x10,0x40,0x10,0x40,
  61. 0x10,0x40,0x10,0x40,
  62. 0x10,0x40,0x10,0x40,
  63. 0x10,0x7F,0x00,0x00},
  64. {//L:[16*16]横排59
  65. 0x00,0x00,0xE0,0x00,
  66. 0x40,0x00,0x40,0xC0,
  67. 0x40,0xC0,0x40,0x00,
  68. 0x40,0x00,0x40,0x00,
  69. 0x40,0x00,0x40,0xC0,
  70. 0x40,0xC0,0x40,0x00,
  71. 0x42,0x00,0xFE,0x00,
  72. 0x00,0x00,0x00,0x00},
  73. {//15 [16*16]横排60
  74. 0x00,0x00,0x00,0x00,
  75. 0x00,0x00,0x10,0x7E,
  76. 0x70,0x40,0x10,0x40,
  77. 0x10,0x40,0x10,0x58,
  78. 0x10,0x64,0x10,0x02,
  79. 0x10,0x02,0x10,0x42,
  80. 0x10,0x44,0x7C,0x38,
  81. 0x00,0x00,0x00,0x00},

  82. {//93 [16*16]横排61
  83. 0x00,0x00,0x00,0x00,
  84. 0x00,0x00,0x18,0x3C,
  85. 0x24,0x42,0x42,0x42,
  86. 0x42,0x04,0x42,0x18,
  87. 0x26,0x04,0x1A,0x02,
  88. 0x02,0x02,0x02,0x42,
  89. 0x24,0x44,0x38,0x38,
  90. 0x00,0x00,0x00,0x00},
  91. {//25 [16*16]横排62
  92. 0x00,0x00,0x00,0x00,
  93. 0x00,0x00,0x3C,0x7E,
  94. 0x42,0x40,0x42,0x40,
  95. 0x42,0x40,0x04,0x58,
  96. 0x04,0x64,0x08,0x02,
  97. 0x10,0x02,0x20,0x42,
  98. 0x42,0x44,0x7E,0x38,
  99. 0x00,0x00,0x00,0x00},

  100. {//99 [16*16]横排63
  101. 0x00,0x00,0x00,0x00,
  102. 0x00,0x00,0x18,0x18,
  103. 0x24,0x24,0x42,0x42,
  104. 0x42,0x42,0x42,0x42,
  105. 0x26,0x26,0x1A,0x1A,
  106. 0x02,0x02,0x02,0x02,
  107. 0x24,0x24,0x38,0x38,
  108. 0x00,0x00,0x00,0x00},
  109. {//86 [16*16]横排64
  110. 0x00,0x00,0x00,0x00,
  111. 0x00,0x00,0x3C,0x1C,
  112. 0x42,0x24,0x42,0x40,
  113. 0x42,0x40,0x24,0x58,
  114. 0x18,0x64,0x24,0x42,
  115. 0x42,0x42,0x42,0x42,
  116. 0x42,0x24,0x3C,0x18,
  117. 0x00,0x00,0x00,0x00},

  118. {//3 [16*16]横排65
  119. 0x00,0x00,0x00,0x00,
  120. 0x00,0x00,0x3C,0x00,
  121. 0x42,0x00,0x42,0x00,
  122. 0x04,0x00,0x18,0x00,
  123. 0x04,0x00,0x02,0x00,
  124. 0x02,0x00,0x42,0x00,
  125. 0x44,0x00,0x38,0x00,
  126. 0x00,0x00,0x00,0x00},

  127. {//QQ [16*16]横排66
  128. 0x00,0x00,0x00,0x00,
  129. 0x00,0x00,0x38,0x38,
  130. 0x44,0x44,0x82,0x82,
  131. 0x82,0x82,0x82,0x82,
  132. 0x82,0x82,0x82,0x82,
  133. 0xB2,0xB2,0xCA,0xCA,
  134. 0x4C,0x4C,0x38,0x38,
  135. 0x06,0x06,0x00,0x00},

  136. {//:5 [16*16]横排67
  137. 0x00,0x00,0x00,0x00,
  138. 0x00,0x00,0x00,0x7E,
  139. 0x00,0x40,0x00,0x40,
  140. 0x18,0x40,0x18,0x58,
  141. 0x00,0x64,0x00,0x02,
  142. 0x00,0x02,0x00,0x42,
  143. 0x18,0x44,0x18,0x38,
  144. 0x00,0x00,0x00,0x00},

  145. {//04 [16*16]横排68
  146. 0x00,0x00,0x00,0x00,
  147. 0x00,0x00,0x18,0x04,
  148. 0x24,0x0C,0x42,0x14,
  149. 0x42,0x24,0x42,0x24,
  150. 0x42,0x44,0x42,0x44,
  151. 0x42,0x7E,0x42,0x04,
  152. 0x24,0x04,0x18,0x1E,
  153. 0x00,0x00,0x00,0x00},

  154. {//82 [16*16]横排69
  155. 0x00,0x00,0x00,0x00,
  156. 0x00,0x00,0x3C,0x3C,
  157. 0x42,0x42,0x42,0x42,
  158. 0x42,0x42,0x24,0x04,
  159. 0x18,0x04,0x24,0x08,
  160. 0x42,0x10,0x42,0x20,
  161. 0x42,0x42,0x3C,0x7E,
  162. 0x00,0x00,0x00,0x00},
  163. {//12 [16*16]横排70
  164. 0x00,0x00,0x00,0x00,
  165. 0x00,0x00,0x10,0x3C,
  166. 0x70,0x42,0x10,0x42,
  167. 0x10,0x42,0x10,0x04,
  168. 0x10,0x04,0x10,0x08,
  169. 0x10,0x10,0x10,0x20,
  170. 0x10,0x42,0x7C,0x7E,
  171. 0x00,0x00,0x00,0x00},
  172. {//12 [16*16]横排71
  173. 0x00,0x00,0x00,0x00,
  174. 0x00,0x00,0x10,0x3C,
  175. 0x70,0x42,0x10,0x42,
  176. 0x10,0x42,0x10,0x04,
  177. 0x10,0x04,0x10,0x08,
  178. 0x10,0x10,0x10,0x20,
  179. 0x10,0x42,0x7C,0x7E,
  180. 0x00,0x00,0x00,0x00},

  181. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //72
  182. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  183. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  184. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

  185. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //73
  186. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  187. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  188. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

  189. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //74
  190. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  191. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  192. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

  193. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //75
  194. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  195. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  196. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

  197. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //76
  198. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  199. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  200. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

  201. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //77
  202. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  203. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  204. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

  205. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //78
  206. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  207. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  208. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

  209. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //79
  210. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  211. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  212. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

  213. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //80
  214. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  215. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  216. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

  217. {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //81
  218. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  219. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  220. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

  221. };


DIY是一种信仰~~
点赞  2010-2-8 11:36
  1. void senddata(uchar datat) //发送1个字节的串行数据子程序.
  2. { uchar k;
  3. CLRWDT();
  4. for(k=0;k<8;k++)
  5. {
  6. //red=!(datat&0x80);
  7. CLRWDT();
  8. green=!(datat&0x80); //数据为零时显示,为1时不显示.
  9. clk=1; //时钟上升沿锁存数据.
  10. datat<<=1;
  11. clk=0;
  12. }
  13. }

  14. void sendwei(void) //在中断服务程序中调用了此程序,发送位数据子程序.
  15. {
  16. uchar i,j; //
  17. uchar huancun1,huancun2; //缓存局部变量.
  18. CLRWDT();
  19. l=0;
  20. huancun1=hanzi[word][hang*2]; //在中断程序中对word和hang两个变量修改
  21. huancun2=hanzi[word][hang*2+1];
  22. j=wei; //为一个0-15的数,在中断服务程序中,对此数的值修改
  23. if(j>=7)
  24. {CLRWDT();
  25. senddata(huancun1);
  26. j=j-7;
  27. l=1;
  28. }

  29. for(i=0;i
  30. {CLRWDT();
  31. if(l==1)
  32. {
  33. //red=!(huancun2&0x80);
  34. green=!(huancun2&0x80);
  35. clk=1;
  36. huancun2<<=1;
  37. clk=0;
  38. }
  39. else
  40. {
  41. //red=!(huancun1&0x80);
  42. green=!(huancun1&0x80);
  43. clk=1;
  44. huancun1<<=1;
  45. clk=0;
  46. }
  47. }

  48. }

  49. void sendhang(void) //在中断服务程序中调用了此程序.
  50. {//gen=1; //行扫描子程序,扫前先关闭显示
  51. CLRWDT();
  52. PORTB&=0xf0;
  53. PORTB|=hang;
  54. }

  55. void clearpingandinit(void) ///清屏且初始化子程序
  56. {uchar j,k;
  57. CLRWDT();
  58. ADCON1=6;//模拟量端口关闭,全设为输出端口
  59. TRISB=0; //RB口全设为输出口
  60. PORTB=0; //
  61. TRISA=0xfe; //RA0设为输出口
  62. PORTA=0;
  63. gen=1; //显示关闭
  64. PORTB=0x00;
  65. hang=0x00;
  66. word=0x00;
  67. wei=0x00;
  68. sec50=0x00;
  69. for(k=0;k<16;k++) //8改为16了
  70. {
  71. for(j=0;j<8;j++)
  72. {red=1;green=1;
  73. clk=1;
  74. CLRWDT();
  75. //_nop_();
  76. clk=0;}
  77. }
  78. rclk=1; //上升沿锁存数据.
  79. //_nop_();
  80. rclk=0;
  81. }

  82. void clearsuocun(void) //清锁存子程序,清除64位的数据(相当于8个595的数据).
  83. {uchar i,j; //而我的屏8个字,用到16个595,i的值改为了16
  84. clk=0;
  85. rclk=0;

  86. for(i=0;i<16;i++) //i的值由8改为了16(韩)
  87. {for(j=0;j<8;j++)
  88. {green=1; //red=1;
  89. CLRWDT();
  90. clk=1;
  91. //_nop_();
  92. clk=0;
  93. }
  94. }
  95. rclk=1;
  96. //_nop_();
  97. rclk=0;
  98. }

  99. void main(void)
  100. {CLRWDT();
  101. clearpingandinit();
  102. // TR0=1;
  103. // TR1=1;
  104. INTCON=0;//所有中断全部关闭.
  105. OPTION=0xd3;//定时器分频为1:16,T0选用内部时钟源,B11010011
  106. TMR0=0;
  107. T0IF=0;
  108. T0IE=1; //开启T0中断允许.
  109. GIE=1; //开启全局中断允许.


  110. while(1)
  111. {
  112. //GIE=0;
  113. //clearsuocun();
  114. //GIE=1;
  115. CLRWDT();
  116. }
  117. }

  118. void interrupt ISR(void) //每13.1ms中断16次,每中断一次只扫描一行,所以此值还要/16
  119. {
  120. uchar n,m;
  121. if((T0IE==1)&&(T0IF==1))
  122. {T0IF=0;

  123. //gen=1; //关闭显示
  124. if(word<=7) //此段用于开始时填空字符用。
  125. {for(n=8-word;n>0;n--)
  126. {senddata(0x00); senddata(0x00);}
  127. m=0x00; //行头未填溢出。
  128. }
  129. else m=word-8; //行头填溢出了。(韩)
  130. for(n=m;n
  131. {senddata(hanzi[n][hang*2]);
  132. senddata(hanzi[n][hang*2+1]);
  133. }
  134. sendwei();
  135. sendhang();
  136. gen=1;
  137. rclk=1;
  138. gen=0; //打开显示
  139. hang++; //在定时器T0中断中更新行扫描。
  140. if(hang>15) {hang=0;}
  141. rclk=0;

  142. if(++sec50==speed)
  143. {sec50=0x00;
  144. wei++;
  145. if(wei==16) //1个字的每行有16位.
  146. {wei=0x00;
  147. word++;
  148. if(word==80) //共计显示80个字.
  149. {word=0x00;}
  150. }
  151. }
  152. }
  153. }
DIY是一种信仰~~
点赞  2010-2-8 11:36
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 京公网安备 11010802033920号
    写回复