资源描述:
《松翰单片机 SN8F5702程序例程.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、#include#include"SN8F5702.h"#include//for_nop_voidInitCPU(void);//单片机初始化voidRam_init(void);//全局变量赋值voidTime_Fun(void);//基准走时函数voidSYSIspStart(unsignedintpageAddress);//----------------------字节全局变量-------------------------------u8idataISP_RAM[32];//IRAM0xE0to0xFF#defineWenDu_
2、UpISP_RAM[1]#defineWenDu_DownISP_RAM[2]#defineWenDu_ChaISP_RAM[3]//u8WenDu_Up;//u8WenDu_Down;u8WenDu_HJ;u8ADC_WenDu_HJ;u8AD_key;u8Time_500ms_Cnt;u8Temp_ChaZhi_ID;//0显示环境温度,1显示差值闪烁u8SS_500Ms_Cnt;//500ms闪烁标志位u8IAP_Save_Cnt;//存储标志位//--------------------位全局变量-----------------------------------bitTi
3、meFlag;//定时标记bitBuzz_Flag;//蜂鸣器标志位bitSS_500Ms_Flag;//500ms闪烁标志位bitZiDong_ShouDong_Flag;//自动手动标志位bitShouDong_Out_Flag;//手动输出标志位bitIAP_Save_Flag;//存储标志位bitNTC_Error_Flag;//传感器错误bitNTC_OK_Flag;//传感器错误u8codeISP_ROM[32]_at_0X0200;//******************************************************************#d
4、efineADC_GLOBAL#include"..incconfig.h"/*****************************************************************/#defineAD_DATA_CNT250constu16codeTEMP_AD_DATA[AD_DATA_CNT+1]={3138,//03100,//13061,//23022,//32982,//42941,//52899,//62857,//72815,//82771,//92728,//102684,//112639,//122595,//132550,//142
5、504,//152459,//162413,//172367,//182321,//192276,//202230,//212184,//222139,//232093,//242048,//252003,//261959,//271914,//281870,//291827,//301784,//311741,//321699,//331658,//341617,//351577,//361537,//371498,//381459,//391421,//401384,//411348,//421312,//431277,//441243,//451209,//461176,//4
6、71144,//481112,//491082,//501052,//511022,//52994,//53966,//54938,//55912,//56886,//57861,//58836,//59812,//60789,//61766,//62744,//63723,//64702,//65682,//66662,//67643,//68624,//69606,//70589,//71572,//72555,//73539,//74524,//75509,//76494,//77480,//78466,//79453,//80440,//81427,//82415,//834
7、03,//84392,//85381,//86370,//87360,//88349,//89340,//90330,//91321,//92312,//93303,//94295,//95287,//96279,//97271,//98264,//99};voidAD_fun(void)//{staticu8AD_Sum_Cnt=0,AD_ID=0;staticu16AD_Sum=0;staticu8Temp_Change_Cnt=0;u8i;AD_Su