Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
main.c
Package: MSP430.rar [view]
Upload User: buddy3
Upload Date: 2022-06-12
Package Size: 100k
Code Size: 3k
Category:
GPS develop
Development Platform:
C/C++
- #include "..config.h"
- char Edition[Edition_Len] = "MSP430_V1.0"; //终端版本号
- char TerminalNumber[TNumber_Len] = "5710106000";//"QJ_SB2010_MSP430"; //终端ID号
- //第0位表示 GPRS 0表示GPRS , 1表示GSM
- //第1位表示 GPS 0表示定位 , 1表示没定位
- char State[State_Len] = "11"; //终端系统状态
- /*
- **********************************************************************
- 函数:Clock_Init
- 参数:无
- 返回:无
- 功能:时钟晶振初始化
- **********************************************************************
- */
- void Clock_Init(void)
- {
- //DIVA1,0=0:ACLK divider number=1
- //XTS=0:LFXT1 low Freq. XT2OFF=0:XT2 Oscilator ON,XT5V=0: should always be reset
- BCSCTL1 = DIVA_0 + RSEL2 + RSEL1 + RSEL0;//0Xx87;;
- BCSCTL1 &=~ (XT2OFF + XTS + XT5V);
- //SELM1,0=2:MCLK source select DCOCLK, DIVM1,0=0:MCLK divider number=1,
- //SELS=0: SMCLK resource select XT2CLK, DEIS1,0=0:SMCLK divider number=1
- //DCOR=0: Internal resistor enable(DCO start)
- BCSCTL2 = SELS + DIVS_0 + SELM_0 + DIVM_0;//0x08;
- }
- /*
- **********************************************************************
- 函数:WTD_Init
- 参数:无
- 返回:无
- 功能:看门狗初始化
- **********************************************************************
- */
- void WTD_Init(void)
- {
- WDTCTL = WDTPW + WDTHOLD; // Stop WDT
- //WDTCTL = WDTPW;
- //WDTCTL = WDT_ADLY_250; // WDT 250ms, ACLK, interval timer
- //IE1 |= WDTIE; // Enable WDT interrupt
- //P1DIR |= 0x01; // Set P1.0 to output direction
- //_BIS_SR(LPM3_bits + GIE); // Enter LPM3 w/interrupt
- }
- /*
- **********************************************************************
- 函数:Clear_WDT
- 参数:无
- 返回:无
- 功能:看门狗计数器清零
- **********************************************************************
- */
- void Clear_WDT(void)
- {
- WDTCTL = WDTPW + WDTCNTCL;//计数器清零 (WDTCTL = 0X5A008)
- }
- /*
- **********************************************************************
- 函数:main
- 参数:无
- 返回:无
- 功能:main主函数
- **********************************************************************
- */
- void main(void)
- {
- Clock_Init(); //时钟初始化
- WTD_Init(); //看门狗初始化
- LED_Init(); //LED初始化
- UART0_Init();
- UART1_Init();
- UART0_SendStr_char("=Program_Start=rn");
- //MoniUART_Init();
- _EINT(); //通用中断允许
- while(1)
- {
- //Clear_WDT();
- GSM_Init();
- LED_Prol();
- ReadUART0();
- ReadUART1();
- SendGPSData();
- }
- }