这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 综合技术 » 基础知识 » msp430f149 (msp430f149)请教如何将一张固定的表格放入代码区

共2条 1/1 1 跳转至

msp430f149 (msp430f149)请教如何将一张固定的表格放入代码区??

院士
2006-09-17 18:14:16     打赏
msp430f149 (msp430f149)请教如何将一张固定的表格放入代码区??



关键词: msp430f149     请教     如何     一张     定的     表格    

院士
2006-12-22 22:43:00     打赏
2楼
问 (MSP430f149)请教如何将一张固定的表格用C语言放入代码区??
谢谢!! 1: 定义数组,如下面的程序

#include <MSP430x44x.h>

char digit[10] = {
0xB7, /* "0" LCD segments a+b+c+d+e+f */
0x12, /* "1" */
0x8F, /* "2" */
0x1F, /* "3" */
0x3A, /* "4" */
0x3D, /* "5" */
0xBD, /* "6" */
0x13, /* "7" */
0xBF, /* "8" */
0x3F /* "9" */
};

void main(void)
{
int i;
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
FLL_CTL0 |= XCAP14PF; // Configure load caps
LCDCTL = LCDON + LCD4MUX + LCDP2; // STK LCD 4Mux, S0-S17
BTCTL = BTFRFQ1; // STK LCD freq
P5SEL = 0xFC; // Common and Rxx all selected

for (;;)
{
for (i=0; i<7; ++i) // Display "6543210"
LCDMEM[i] = digit[i];
}
}
就是将0-9的显示代码放入了代码区。 2: http://bbs.zoglab.com/viewthread.ph...80&highlight=4k 3: const BYTE Lierda_13_19[3][38]=
{
0x00,0x10,0x92,0x92,0xD2,0x72,0xFE,0xFB,0x53,0x93,0x90,0x00,0xFC,0xFC,0x00,0x07,0xFF,0xC2,0x00,
0x03,0x03,0x03,0x01,0x00,0x00,0x1F,0x0F,0x00,0x00,0x00,0x08,0x08,0x18,0x18,0x0C,0x0F,0x07,0x00,

0x00,0x10,0x10,0x18,0x08,0x8C,0xC7,0x47,0x04,0xFC,0xFC,0x04,0x44,0xC4,0x84,0x0C,0x7C,0x00,0x00,
0x04,0x04,0x06,0x03,0x03,0x01,0x0C,0x08,0x18,0x1F,0x0F,0x00,0x00,0x00,0x01,0x07,0x0E,0x0E,0x04,

0x00,0x30,0x16,0x16,0x76,0xB4,0x08,0x08,0x0C,0x8C,0xCC,0x7F,0x3F,0x44,0xC4,0x84,0x04,0x00,0x00,
0x06,0x02,0x02,0x02,0x03,0x03,0x02,0x03,0x07,0x05,0x04,0x04,0x0C,0x0C,0x0C,0x1D,0x1F,0x0C,0x0C,
};
这样就可以了。如果你要放入指定代码区,就参考楼上的。 4: liaoduck 兄:
用这个CONST定义,可还占用RAM啊!
这可怎么办啊!

共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]