Fri Aug 22 13:57:48 2014: The stack 'Stack' is filled to 100% (80 bytes used out of 80). The warning
threshold is set to 90.%
Fri Aug 22 13:57:48 2014: The stack pointer for stack 'Stack' (currently Memory:0x75E) is outside the
stack range (Memory:0x9B0 to Memory:0xA00)
知道是堆栈的问题但是不知道怎么改.
这个是main.c
include<msp430x14x.h>
#include"12864.h"
#include"24C08.h"
#include"DS18B20.h"//
#include"ds1302.h"
#include"key.h"
#include"menu.h"
#include"gdata.h"
uchar time;
const unsigned char tishi_W[]={"温度:"};
const unsigned char tishi_Wd[]={"°"};
const unsigned char tishi_S[]={"湿度:"};
const unsigned char tishi_Sd[]={"%"};
const unsigned char tishi_dot[]={".00"};
const uchar storage[]={"已存储"};
const uchar full[]={"已存满"};
void ShowTime();
uchar year[14],disptemp[8];
extern uchar key_Flag;
extern uchar key_val;
void disp_temp(uint temp);
uchar add=0x00,addr;
uchar ye;
uint temp;//存储温度
main()
{
P1DIR=0xff;P1OUT=0xff;
P2DIR=0xff;P2OUT=0xff;
P3DIR=0xff;P3OUT=0xff;
P4DIR=0xff;P4OUT=0xff;
P5DIR=0xff;P5OUT=0xff;
P6DIR=0xff;P6OUT=0xff;
WDTCTL=WDTPW+WDTHOLD;
BCSCTL1&=~XT2OFF;
do
{
IFG1&=~OFIFG;
for(uchar i=0;i<0xff;i++)
_NOP();
}while(IFG1&OFIFG);
BCSCTL2|=SELM_2+SELS;//mclk=Xt2,smclk=mclk
Reset_DS1302();//时钟复位
Set_DS1302(wdata);//设置时间
init_EEPROM();//20C08存储块初始化
//Init_keypad();//键盘初始化
//Init_18B20();温度传感器初始化//
lcd_Init();//屏幕初始化
//ShowTime();日期时间显示
CCR0=60000;//60ms
CCTL0=CCIE;
TACTL=TASSEL_2+ID_3+MC_1+TACLR;//定时器A时钟为smclk,8分频,增计数模式,TAR清零
/*TBCTL=TBSSEL0+TBCLR;
TBCCTL0=CCIE;
TBCCR0=32768;*/
_EINT();
LPM0;
while(1);
}
#pragma vector=TIMERA0_VECTOR
__interrupt void timerA0_ISR()
{
//time++;
//if(time==10)
//{
// time=0;
temp=Do1Convert();
jiance_Key();//
ShowTime();
if(key_Flag==1)
{
key_Flag=0;
//temp = key_val/10;
switch(key_val)
{
case 0: //break;
case 1: //break;
case 2: //break;
case 3: //break;
case 4: //break;
case 5: //break;
case 6: //break;
case 7: //break;
case 8: //break;
case 9: //break;
case 10:// break;
case 11:////
write_cmd(0x9f);
write_data(key_val/10 + '0');
write_data(key_val%10 + '0');
break;
case 12://存储
add=addr;
if(ye<=3)
{
for(uchar j=0;j<7;j++)
{
write_add(ye,add+j,rdata[j]);
if(add>=0xff)
{
ye++;
add=0x00;
}
}
addr=add+7;//存储日期后,应该存储温度的地址
write_add(ye,addr,temp);
if(addr>=0xff)
{
ye++;
addr=0x00;
}
addr++;
disp_hz(0x98,storage,3);
}
else
{
disp_hz(0x98,full,3);
ye=0;
add=0x00;
for(uchar j=0;j<7;j++)
write_add(ye,add+j,rdata[j]);
addr=add+7;
write_add(ye,addr,temp);
addr++;
if(add==0xff)ye++;
}
break;
case 13://显示日期
clear_GDRAM();
lcd_Init();
write_cmd(0x88);
for(uchar i=0;i<14;i++)
write_data(year[i]);
break;
case 14://显示温度
clear_GDRAM();
lcd_Init();
disp_hz(0x80,tishi_W,3);
/*write_data(temp/100 + '0');
write_data(temp/10%10 + '0');
write_data(temp%10 + '0');*/
disp_temp(temp);
disp_hz(0x85,tishi_Wd,1);
break;
case 15://显示时间
clear_GDRAM();
lcd_Init();
write_cmd(0x90);
for(uchar i = 0;i < 8;i++)
write_data(disptemp[i]);
break;
default:
break;
}
}
//}
}
void ShowTime()
{
//uchar disptemp[8];
//uchar year[14];
BurstRead1302(rdata);
disptemp[6] = shuzi[(rdata[0]&0xf0)>>4];
disptemp[7] = shuzi[rdata[0]&0x0f];
disptemp[3] = shuzi[(rdata[1]&0xf0)>>4];
disptemp[4] = shuzi[rdata[1]&0x0f];
disptemp[0] = shuzi[(rdata[2]&0xf0)>>4];
disptemp[1] = shuzi[rdata[2]&0x0f];
disptemp[2]=0x3a; // ":"对应的编码
disptemp[5]=0x3a;
/*write_cmd(0x90);
for(uchar i = 0;i < 8;i++)
write_data(disptemp[i]);*/
year[0] = shuzi[2];
year[1] = shuzi[0];
year[2] = shuzi[(rdata[6]&0xf0)>>4];
year[3] = shuzi[rdata[6]&0x0f];
year[4] = 0x2d;
year[5] = shuzi[(rdata[4]&0xf0)>>4];
year[6] = shuzi[rdata[4]&0x0f];
year[7] = 0x2d;
year[8] = shuzi[(rdata[3]&0xf0)>>4];
year[9] = shuzi[rdata[3]&0x0f];
year[10] = 0x20;
year[11] = 0x2a;
year[12] = shuzi[rdata[5]];//周
year[13] = 0x2a;
/* write_cmd(0x80);
for(uchar i = 0;i < 14;i++)
write_data(year[i]);*/
}
void disp_temp(uint num)
{
//uint8 g,s,b;
//write_cmd(0x01);//清屏
//lcd_sec();
write_cmd(0x83);
if(num < 10)
{
write_data(' ');
write_data(' ');
write_data(' ');
write_data(num + '0');
}
if((num > 10) & (num < 100))
{
write_data(' ');
write_data(' ');
write_data(num / 10 + '0');
write_data(num % 10 + '0');
}
if((num > 100) & (num < 125))
{
write_data(' ');
write_data((num / 100) + '0');
write_data((num / 10 % 10) + '0');
write_data((num % 10) + '0');
}
}