MSP430_SMBus_Users_Guide-1_10_00_00
MSP430_单片机_资料

MSP430_单片机_资料MSP430_单片机_资料Ulrt-lao wowep drsien wigthTexas nsItumertn s超功低微耗控制器超低功耗控微器制SM4P0Augus3t 0 0/1MSP430_单片机_资料ltUra-lwo pwored signe withMSP340发展历程性能Flsh aFalhs1.-836. VL CDD riev r. 1….-3.6 8V Bsica lCoc Tiker_A meNwROM/OPT.525 -VL DC DrvireFL TiLmrePor/ tBasc Tiierm8- bi tT/ C33xxCD120L Tmeri_ ASAUTR MPFY14xTiermB _DAC2 21US RT MPAYC mo_Ap4F4NewxF13Tixmr_Be DCA1 2UASTRC op_AmF42x3x2xCDL48 ADC41X1xUSART24F1x3x1xLCD921x1x1Cop_AF40xm***-*****20XX年20XX年0202Agustu0 0 /2UlMSP430_单片机_资料ratl-wop wor eedisgn itwhSM4P3:全新的0微制控R器N THE *****NH ,NT TOH EMIEL. ITs’ lFah MsS430 MPU redCuces pwoer cnsuompton driatiscally s, youo rabtteire surn lnogr.eMS430P的效极能.高/IO和PC U运是行用能同的不时钟PC 功U 的耗关通过开状寄态器存控的位实现制MSP430 的耗功极低. 行执时为601A u@ .81 V(Fasl)h 备用时为0.1u A(Fl sh)a MPS403极地延长大电了池寿命电SM4P0 有3业级工16 itb RISCM CU. -40 8-5 C M SP34 0编程方便,发开工具廉价DA MED1M,EMM ;2EMM=2*****+E2hTeMSP 304 runswith aatcwhcr staylat p tou4MH zitenrnalclck!ouAugst 00 /3MSP430_单片机_资料lUra-ltw powero dsiegnw ith*****Fxx :LASH F列特性系New灵活样多外的围模块RUNTH ***** N,O ONT HTEM IL.ET ’Is lash*****MCU red cuesp wore conumptions drsticaaly, so ylou rabtetiesrrun l ongre. 12b-t iAD /8( +4 通道, 转换1 0s) 61-ib timTe_r wAthi C3C /寄器存1-6bt iTime_B wirth 7/C C存器寄1 2 个-SURA接口T 件硬法器乘模拟号信比较器基本时模钟块- 由可程内部电阻控编频制率-由单一部电外控制阻率频-2 3kHz 振产晶生低频- 高晶振频产高生频可选择外部-时钟源超低功耗1.8V . ..3 6.V 供电电压范2围00 A@ 1MH,z 2.2V,活动模式0.7 A 备用模式0. 1A 保持R AM 据数 6 s备从模式唤醒用强大C的U 内P核16Bit R-IC S构结251n 指令s期周@ MHz8Auugs t00/4UMSP430_单片机_资料lrt-alw oopewr edign swtihSP4M0 系3列注1 - :可C由mopaatorrA_实现2 -可由Ti mr/Poert实现3 -有562 FLASBH 和oot BRM O 4 I-punt/utpuOt+ Otpuu外t模围块: TIMRSE: WT Db8tiT B1T _A T_BT- aWchtdgo 定时器- 8位定器时/计器数-Baic siTemr 1- Tmie_r A(x )捕/捉比较寄存器T-ime_r (Bx 捕)捉比/较寄存器URAT 件实软,或现用通同步异/接口步数MPY硬乘法器I/O件数字I/O ,O及tuputAgusut 00/ 5MSP430_单片机_资料Ulrt-aowlp wore dsegin witMhSP403F LSAH 列系NweFie vnew lFas hcofinurgtiaon avsilaable now!号型LASH 1 FB 4 KB 8 KB 1K6KB 32 B K8 K4 B60KBA/ DlSpeo loSe p2-b1t 12i-itb 12-bti1 2b-it12 bit-Tmire sA3A3 A 3 +B 33 A +3 A3B +B7 A + B3 A7 +3B 7SUART 1 12 2M2P Yvv v/IO 4 114 8 448 8 4484 8FALH 型S超低功耗Falsh 内核10,000 次写/0周期擦程存储器序段:51分2 信B存储息分器:128B段可以分擦段除或整擦除体编和擦程除电由压内产生部有代读出码护保*****101 *****1F211MS P34F031 M3FS*****FMSP 40F317 4SPM*****F *****F94Augst 00 u/6MSP430_单片机_资料低功耗的超现实:速起动和快电省模式其他MCUIUltarlo- powewrd esig nithw* / 4b8tiC UP* 电流耗大消* 唤醒慢Ic c /A45 400 ***-*****IvAgr300 5022 00tVc c=3 V1 se ccylcetime**********ctAvei odMe PML0*****LLPMIAvrg3 t例L:P3, M备模式用(*****C1) 3276xHz 振8荡活动器基。
MSP430G2xx3设备的SMBus库用户指南说明书

SMBus Library for MSP430G2xx3Devices User’s GuideDOCNUM-1.10.00.00Copyright©2015T exas Instruments Incorporated.1 CopyrightCopyright©2015Texas Instruments Incorporated.All rights reserved.MSP430and MSP430Ware are trademarks of Texas Instruments Instruments. ARM and Thumb are registered trademarks and Cortex is a trademark of ARM Limited.Other names and brands may be claimed as the property ofbe aware that an important notice concerning availability,standard warranty,and use in critical applications of Texas Instruments semi-conductor products and disclaimers thereto appears at the end of this document.Texas Instruments13532N.Central Expressway MS3810Dallas,TX75243/Revision InformationThis is version1.10.00.00of this document,last updated on Fri Feb13201511:59:44.Table of Contents2Table of ContentsCopyright (1)Revision Information (1)1Introduction (3)1.1Introduction (3)1.2SMBus (3)1.3The MSP430™SMBus Library Package (4)2Introduction to the MSP430™SMBus API (5)2.1Overview (5)2.2Supported Device Families (5)2.3Supported Development Environments (5)2.4Stack Organization (5)2.5Usage of MCU Peripheral Resources (6)2.6Release Notes and Migration from Previous Versions (6)3SMBus API Usage (7)3.1Introduction (7)3.2Usage (7)3.3Examples (8)IMPORTANT NOTICE (9)1Introduction1.1IntroductionThs SMBus(Sytem Management Bus)API(application programming interface)stack forMSP430™microcontrollers is a turnkey API.It includes support for applications where theMSP430™microcontroller is acting as the master or a slave.The API is designed to minimize the SMBus knowledge required to write an application:All SMBus protocol is handled automatically by the APIThe data interface presented to the application is simple to use,abstracting the applicationfrom SMBus protocolThe user should not need to modify the API source.However,for experienced developers,thesource is open and available for editing.Accessing the API’s source can also be useful for systemdebug.Application examples are included in the MSP430™SMBus Library Package.1.2SMBusThe System Management Bus(SMBus)is a lightweight two-wire interface based on the principlesof I2C,commonly used as a control bus and for power management tasks in computing,mobilecomputing and battery operated applications.A device performing data transfers on the bus canbe considered a master,which is the device which initiates a transaction and drives the clock,or aslave,which is the target of a SMBus transaction driven by the master.Both the master and theslave can act as transmitters or as receivers.SMBus2.0shares a lot of similarities with I2C,but some of the most relevant differences include:Time-out detection when a device stretches the clock for too longPacket Error Checking(PEC)can be optionally appended at the end of each transaction,allowing the bus to automatically validate packetsI2C only defines a PHY and Data-Link layers,but SMBus defines a network layer withdifferent SMBus protocols which can be used to exchange data between devicesOptional use of additional lines such as SMBAlert#and SMBSUS#.For more information about SMBus,please refer to the SMBus2.0specification:/specs/.For more information about I2C,please refer to/documents/user manual/UM10204.pdf1.2.1Supported FeaturesThe following table details the SMBus features supported in the MSP430™SMBus library.SMBus Feature MSP430FR5xx6xx MSP430G2xx3Applicable SMBus2.0 Master Slave Master Slave specification sectionClock Timeout detection1Y es Y es Y es1Y es1 3.1.1.2Manual NACK on invalid address/data N/A Y es2N/A No 4.2Arbitration Y es N/A Y es N/A 4.3.2Clock stretching Y es Y es Y es Y es 4.3.3Multiple Slave address N/A No N/A No 5.2General Call address N/A No N/A No 5.2PEC Y es Y es Y es Y es 5.4Quick Command Partial3Partial3Parial3Partial3 5.5.1Send Byte Y es Y es Y es Y es 5.5.2Receive Byte Y es Y es Y es Y es 5.5.3Write Byte/Word Y es Y es Y es Y es 5.5.4Read Byte/Word Y es Y es Y es Y es 5.5.5Process Call Y es Y es Y es Y es 5.5.6Block Write/Read Y es Y es Y es Y es 5.5.7Block write-block read process call Y es Y es Y es Y es 5.5.8Host notify protocol No No No No 5.5.9ARP No No No No 5.6SMBAlert#No No No No Appendix ASMBSUS#No No No No Appendix ANotes:1.MSP430G2xx3USCI doesn’t have integrated timeout detection and requires a timer2.MSP430FR5x/6xx can optionally-use DMA to stretch SCL while deciding to ACK/NACK thecurrent byte3.Only QuickCommand Write is supported,not QuickCommand Read1.3The MSP430™SMBus Library PackageThis User’s Guide documents the SMBus API and examples.The contents of the package isdescribed below:smbuslib:T op level directory.Contains release notes and the manifestfile related to licensing.•docs:Contains the API and User’s Guides for the supported MSP430™devices•driverlib:Contains the standard MSP430™driverlib which is used in the libraryimplementation for device families that support driverlib(for example,MSP430FR5xx6xx)•examples:Contains the example projects for each of the supported MSP430™devices•src:Contains the source code for the SMBus Library stack2Introduction to the MSP430™SMBus API 2.1OverviewThe MSP430™SMBus API stack allows easy creation of MSP430™applications thatcommunicate with other system components over a SMBus interface.This API supports using the MSP430™microcontroller as the SMBus master or as a SMBusslave.2.2Supported Device FamiliesThe SMBus API stack is supported on the following MSP430™device families:MSP430FR5xx6xxMSP430G2xx32.3Supported Development EnvironmentsThe SMBus API stack and examples build and run on both the IAR and CCS environments forMSP430™microcontrollers.See the Release Notes HTMLfile in the SMBus Library Package forspecific IAR/CCS version information.IAR and CCS are both available in free,code-size-limited versions(8K and16K,respectively,ofobject code).Applications thatfit under8K of memory can be run on both free versions.Applications that are greater than8K cannot be built using the free IAR Kickstart tool.Instead,thefree version of CCS can be used;or a licensed version of either environment.See the Release Notes within the SMBus Library Package zipfile for additional informationspecific to a given release.2.4Stack OrganizationThe software stack is organized into three layers:The public API layer defines the API’s that should be called by application programs.Thesefunctions are defined in smbus.h.The network layer manages the SMBus protocol state machine and interfaces with thephysical layer.These functions are defined in smbus nwk.h and should not be called directlyfrom application programs.The physical layer contain all the device specific code to interact with the MSP430™microcontroller.These functions are defined in smbus phy.h and should not be called directlyfrom application programs.2.5Usage of MCU Peripheral ResourcesWithin the SMBus API,the resources shown below are considered owned by the API.If theapplication accesses them,it should be aware of how the API uses them.2.6Release Notes and Migration from Previous VersionsA Release Notes HTMLfile accompanies each release of the SMBus Library Package.Referencethisfile for any information specific to this release,including:All changes from the previous versionsInstructions for migration from previous versionsUpdated IDE configuration informationKnown issues3SMBus API Usage3.1IntroductionThis chapter contains the detailed documentation for the application API functions anddescriptions on using the API to create a SMBus master or slave application.3.2UsageThis section illustrates the basic application template for master and slave applications.See theexamples for complete applications,and the HTML API documentation for details on theindividual APIs.3.2.1Master Usage Outline//Declare master SMBus structureSMBus SMB;//Initialize GPIOs and clocks...//Initialize GPIO I2C pins...//Initialize SMBus Master always at100kbps per SMBus specSMBus masterInit(&SMB,NULL,(MCLK MHZ*1000000));//Initialize I2C and enable SMBus InterruptsSMBus masterEnableInt(&SMB);//Send SMBus Sendbyte command(0x33)uint8t ret=SMBus masterSendByte(&SMB,//SMB struct0x40,//Slave Addr0x33);//SMB Command...3.2.2Slave Usage Outlinemain(){//Declare slave SMBus structureSMBus SMB;//SMBus receive and transmit buffersuint8t au8RxBuff[SMB MAX PACKET SIZE];uint8t au8TxBuff[SMB MAX PACKET SIZE];//Initialize GPIOs and clocks...//Initialize GPIO I2C pins...//Initialize SMBus SlaveSMBus slaveInit(&SMB,NULL);//Set the slave’s addressSMBus slaveSetAddress(&SMB,0x40);//Set the RX and TX buffers for SMBusSMBus slaveSetRxBuffer(&SMB,au8RxBuff,sizeof(au8RxBuff));SMBus slaveSetTxBuffer(&SMB,au8TxBuff,sizeof(au8TxBuff));//Initialize I2C and enable SMBus InterruptsSMBus slaveEnableInt(&SMB);...while(1){disable interrupt();{BIS SR(LPM3bits+GIE);//Go to sleep}enable interrupt();}//While(1)}#pragma vector=USCIAB0TX VECTOR,USCIAB0RX VECTORinterrupt void USCI ISR(void){//Check the state of SMBusswitch(SMBus slaveProcessInt(&SMB)){case SMBus State Slave QCMD://If a Quick command was detected,execute function(if any)break;case SMBus State Slave CmdComplete://Get command using SMBus slaveGetCommand(&SMB)and process command//if command is not valid/supported//SMBus slaveReportError(&SMB,SMBUS ErrorCode Cmd);LPM3EXIT;//Exit to main loop if requiredbreak;default:break;}//Clear flags to be ready for next packetSMBus processDone(&SMB);}#pragma vector=TIMER1A0VECTORinterrupt void TIMER1A0ISR(void){//Call the SMBUS function to handle a timeout error and restart the SMBUSSMBus slaveProcessTimeoutInt(&SMB);}3.3ExamplesSeveral examples are provided with the release package that illustrate using the library toimplement both SMBus master and slave application.For each example,matching master and slave implementations are provided.ReadByte Echo-sends and echoes back a ReadByte commandWriteWord Dimmer-sends and echoes back a WriteWord commandAllProtocols-sequences through all the SMBus protocolsExamples are configured for the MSP-EXP430G2and MSP-EXP430FR5969launch pad boardsand CCS and IAR projects are provided.9 IMPORTANT NOTICET exas Instruments Incorporated and its subsidiaries(TI)reserve the right to make corrections,modifications,enhancements,improvements, and other changes to its products and services at any time and to discontinue any product or service without notice.Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete.All products are sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standard warranty.T esting and other quality control techniques are used to the extent TI deems necessary to support this warranty.Except where mandated by government requirements,testing of all parameters of each product is not necessarily performed.TI assumes no liability for applications assistance or customer product design.Customers are responsible for their products and applications using TI components.T o minimize the risks associated with customer products and applications,customers should provide adequate design and operating safeguards.TI does not warrant or represent that any license,either express or implied,is granted under any TI patent right,copyright,mask work right,or other TI intellectual property right relating to any combination,machine,or process in which TI products or services are used. Information published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a warranty or endorsement e of such information may require a license from a third party under the patents or other intellectual property of the third party,or a license from TI under the patents or other intellectual property of TI.Reproduction of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accom-panied by all associated warranties,conditions,limitations,and notices.Reproduction of this information with alteration is an unfair and deceptive business practice.TI is not responsible or liable for such altered rmation of third parties may be subject to additional restrictions.Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice.TI is not responsible or liable for any such statements.TI products are not authorized for use in safety-critical applications(such as life support)where a failure of the TI product would reasonably be expected to cause severe personal injury or death,unless officers of the parties have executed an agreement specifically governing such use.Buyers represent that they have all necessary expertise in the safety and regulatory ramifications of their applications, and acknowledge and agree that they are solely responsible for all legal,regulatory and safety-related requirements concerning their products and any use of TI products in such safety-critical applications,notwithstanding any applications-related information or support that may be provided by TI.Further,Buyers must fully indemnify TI and its representatives against any damages arising out of the use of TI products in such safety-critical applications.TI products are neither designed nor intended for use in military/aerospace applications or environments unless the TI products are specifically designated by TI as military-grade or“enhanced plastic.”Only products designated by TI as military-grade meet military spec-ifications.Buyers acknowledge and agree that any such use of TI products which TI has not designated as military-grade is solely at the Buyer’s risk,and that they are solely responsible for compliance with all legal and regulatory requirements in connection with such use.TI products are neither designed nor intended for use in automotive applications or environments unless the specific TI products are designated by TI as compliant with ISO/TS16949requirements.Buyers acknowledge and agree that,if they use any non-designated products in automotive applications,TI will not be responsible for any failure to meet such requirements.Following are URLs where you can obtain information on other Texas Instruments products and application solutions:ProductsAmplifiersData ConvertersDLP®ProductsDSPClocks and TimersInterfaceLogicPower Mgmt MicrocontrollersRFIDRF/IF and ZigBee®Solutions amplifi/clockswww.ti-rfi/lprfApplicationsAudioAutomotiveBroadbandDigital ControlMedicalMilitaryOptical NetworkingSecurityT elephonyVideo&ImagingWireless/audio/automotive/broadband/digitalcontrol/medical/military/opticalnetwork/security/telephony/video/wirelessMailing Address:T exas Instruments,Post Office Box655303,Dallas,T exas75265 Copyright©2015,T exas Instruments Incorporated。
MSP430时钟系统详解

2
while(1) { P1OUT = 0x40; _delay_cycles(100); P1OUT = 0; _delay_cycles(5000); } }
// 开启 LED // 关闭 LED
2、CPU 运行在晶振(32768Hz)时钟下: 时钟下: 晶体频率为 32768 赫兹,约 3 倍的 VLO。如果我们在前面的代码中使用晶振,指示灯应闪 烁大约每秒一次。 你知道为什么 32768 赫兹是一个标准?这是因为这个数字是 2 的 15 次方, 因此很容易用简单的数字计数电路,以每秒一次获得率 ——手表和其他时间时基。认识到 ACLK 来自外部晶振时钟。 #include <msp430g2231.h> void main(void) { WDTCTL = WDTPW + WDTHOLD; // 关闭看门狗定时器 P1DIR = 0x41; // P1.0 和 P1.6 配置输出 P1OUT = 0x01; // 开启 P1.0 BCSCTL3 |= LFXT1S_0; // LFXT1 = 32768Hz 晶振 while(IFG1 & OFIFG) { IFG1 &= ~OFIFG; // 清除 OSCFault 标志 _delay_cycles(100000); // 为可见的标志延时 } P1OUT = 0; // 关闭 P1 __bis_SR_register(SCG1 + SCG0); // 关闭 DCO BCSCTL2 |= SELM_3 + DIVM_3; // MCLK = 32768/8 while(1) { P1OUT = 0x40; // 开启 LED _delay_cycles(100); P1OUT = 0; / / 关闭 LED _delay_cycles(5000); } } 3、CPU 运行在晶振(32768Hz)和 DCO 时钟下: 时钟下: 最慢的频率,我们可以运行 DCO 约在 1MHz(这也是默认速度) 。因此,我们将开始切换 MCLK 到 DCO 下。在大多数系统中,你会希望 ACLK 上运行的 VLO 或 32768 赫兹晶振。 由于 ACLK 在我们目前的代码是在晶体上运行,我们会打开 DCO 计算。
MSP430寄存器的中文解释,熟知这些写起程序来很方便

#define P5DIR_ sfrb P5DIR
#define P5SEL_ sfrb P5SEL
#define P6IN_ const sfrb P6IN #define P6OUT_ sfrb P6OUT
0x0034 /* P6 输入寄存器 */ = P6IN_; 0x0035 /* P6 输出寄存器*/ = P6OUT_; 0x0036 /* P6 方向选择寄存器*/ = P6DIR_; 0x0037 /* P6 功能选择寄存器*/ = P6SEL_;
#define P4DIR_ sfrb P4DIR
#define P4SEL_ sfrb P4SEL
/************************************************************ * DIGITAL I/O Port5/6 I/O口寄存器定义PORT5和6 无中断功能
************************************************************/
#define P5IN_ const sfrb P5IN #define P5OUT_ sfrb P5OUT
0x0030 /* P5 输入寄存器 */ = P5IN_; 0x0031 /* P5 输出寄存器*/ = P5OUT_; 0x0032 /* P5 方向选择寄存器*/ = P5DIR_; 0x0033 /* P5 功能选择寄存器*/ = P5SEL_;
#define MPY_
0x0130 /* 无符号乘法 */
sfrw
MPY
= MPY_; 0x0132 /* 有符号乘法*/ = MPYS_; 0x0134 /* 无符号乘加 */ = MAC_; 0x0136 /* 有符号乘加 */ = MACS_; 0x0138 /* 第二乘数 */ = OP2_; 0x013A /* 低6位结果寄存器 */ = RESLO_; 0x013C /* 高6位结果寄存器 */ = RESHI_; 0x013E /*结果扩展寄存器 */ = SUMEXT_;
MSP430中文数据手册

MSP430混合信号微控制器数据手册产品特性●低电压范围:2.5V~5.5V●超低功耗——活动模式:330μA at 1MHz, 3V——待机模式:0.8μA——掉电模式(RAM数据保持):0.1μA●从待机模式唤醒响应时间不超过6μs●16位精简指令系统,指令周期200ns●基本时钟模块配置——多种内部电阻——单个外部电阻——32kHz晶振——高频晶体——谐振器——外部时钟源●带有三个捕获/比较寄存器的16位定时器(Timer_A)●串行在线可编程●采用保险熔丝的程序代码保护措施●该系列产品包括——MSP430C111:2K字节ROM,128字节RAM——MSP430C112:4K字节ROM,256字节RAM——MSP430P112:4K字节OTP,256字节RAM●EPROM原型——PMS430E112:4KB EPROM, 256B RAM●20引脚塑料小外形宽体(SOWB)封装,20引脚陶瓷双列直插式(CDIP)封装(仅EPROM)●如需完整的模块说明,请查阅MSP430x1xx系列用户指南(文献编号:SLAU049产品说明TI公司的MSO43O系列超低功耗微控制器由一些基本功能模块按照不同的应用目标组合而成。
在便携式测量应用中,这种优化的体系结构结合五种低功耗模式可以达到延长电池寿命的目的。
MSP430系列的CPU采用16位精简指令系统,集成有16位寄存器和常数发生器,发挥了最高的代码效率。
它采用数字控制振荡器(DCO),使得从低功耗模式到唤醒模式的转换时间小于6μs.MSP430x11x系列是一种超低功耗的混合信号微控制器,它拥有一个内置的16位计数器和14个I/0引脚。
典型应用:捕获传感器的模拟信号转换为数据,加以处理后输出或者发送到主机。
作为独立RF传感器的前端是其另一个应用领域。
DW封装(顶视图)可用选型功能模块图管脚功能简介:1.CPUMSP430的CPU采用16位RISC架构,具有高度的应用开发透明性。
MSP430教程1

MSP430教程1:MSP430 单片机系列简介1、MSP430 单片机的发展MSP430 系列是一个 16 位的、具有精简指令集的、超低功耗的混合型单片机,在 1996 年问世,由于它具有极低的功耗、丰富的片内外设和方便灵活的开发手段,已成为众多单片机系列中一颗耀眼的新星。
回忆 MSP430 系列单片机的发展过程,可以看出有这样三个阶段:开始阶段从 1996 年推出 MSP430 系列开始到 2000 年初,这个阶段首先推出有 33X 、32X 、 31X 等几个系列,而后于 2000 年初又推出了 11X 、 11X1 系列。
MSP430 的 33X 、 32X 、 31X 等系列具有 LCD 驱动模块,对提高系统的集成度较有利。
每一系列有 ROM 型( C )、 OTP 型( P )、和 EPROM 型( E )等芯片。
EPROM 型的价格昂贵,运行环境温度范围窄,主要用于样机开发。
这也表明了这几个系列的开发模式,即:用户可以用 EPROM 型开发样机;用 OTP 型进行小批量生产;而 ROM 型适应大批量生产的产品。
2000 年推出了 11X/11X1 系列。
这个系列采用 20 脚封装,内存容量、片上功能和 I/O 引脚数比较少,但是价格比较低廉。
这个时期的 MSP430 已经显露出了它的特低功耗等的一系列技术特点,但也有不尽如人意之处。
它的许多重要特性,如:片内串行通信接口、硬件乘法器、足够的 I/O 引脚等,只有33X 系列才具备。
33X 系列价格较高,比较适合于较为复杂的应用系统。
当用户设计需要更多考虑成本时, 33X 并不一定是最适合的。
而片内高精度 A/D 转换器又只有 32X 系列才有。
寻找突破,引入 Flash 技术随着 Flash 技术的迅速发展, TI 公司也将这一技术引入 M SP430 系列中。
在 2000 年 7 月推出 F13X/F14X 系列,在 2001 年 7 月到 2002 年又相继推出 F41X 、 F43X 、 F44X 这些全部是 Flash 型单片机。
MSP430单片机原理解读

第 2 章MSP430 单片机原理与 C 语言基础MSP430系列超低功耗单片机有200多种型号,TI公司用3~ 4位数字表示其型号。
其中第一位数字表示大系列,如MSP430F1xx系列、MSP430F2xx系列、MSP430F4xx系列、MSP430F5xx系列等。
在每个大系列中,又分若干子系列,单片机型号中的第二位数字表示子系列号,一般子系列越大,所包含的功能模块越多。
最后1~2 位数字表示存储容量,数字越大表示RAM 和ROM 容量越大。
430 家族中还有针对热门应用而设计的一系列专用单片机。
如SP430FW4xx 系列水表专用单片机、MSP430FG4xx 系列医疗仪器专用单片机、MSP430FE4xx 系列电能计量专用单片机等。
这些专用单片机都是在同型号的通用单片机上增加专用模块而构成的。
最新的MSP430型号列表可以通过TI公司网站下载。
在开发单片机应用系统时,第一步就是单片机的选型,选择合适的单片机型号往往就能事半功倍。
单片机选型基本方法是选择功能模块最接近项目需求的系列,然后根据程序复杂程度估算存储器和RAM 空间,并留有适当的余量,最终决定选用的单片机型号。
本章节以MSP430F249单片机为学习目标,介绍单片机的基本结构和工作原理,读者可以举一反三、触类旁通,而不必每种型号都去学习却无法深入掌握。
2.1 MSP430F249单片机基本结构与原理2.1.1MSP430F249的主要结构特点供电电压范围1.8V~3.6V 。
超低功耗:活动状态270uA(1MHz,2.2V);待机模式0.3uA;关机模式0.1uA。
16位RISC精简指令集处理器。
时钟系统:多种时钟源,可灵活使用。
时钟频率达到16MHz ;具有内部振荡器;可外接32kHz 低频晶振;外接时钟输入。
12位A/D转换器,内部参考电压,采用保持电路。
16位定时器A,3个捕获/比较寄存器。
16 位定时器B,7 个捕获/比较寄存器。
MSP430入门

MSP430入门硬件初步这只是我在学习TI公司生产的16位超的功耗单片机MSP430的随笔,希望能对其他朋友有所借鉴,不对之处还请多指教。
下面,开始430之旅。
讲解430的书现在也有很多了,不过大多数都是详细说明底层硬件结构的,看了不免有些空洞和枯燥,我认为了解一个MCU的操作首先要对其基础特性有所了解,然后再仔细研究各模块的功能。
1.首先你要知道msp430的存储器结构。
典型微处理器的结构有两种:冯。
诺依曼结构——程序存储器和数据存储器统一编码;哈佛结构——程序存储器和数据存储器;msp430系列单片机属于前者,而常用的mcs51系列属于后者。
0-0xf特殊功能寄存器;0x10-0x1ff外围模块寄存器;0x200-?根据不同型号地址从低向高扩展;0x1000-0x107f seg_b0x1080_0x10ff seg_a 供flash信息存储剩下的从0xffff开始向下扩展,根据不同容量,例如149为60KB,0xffff-0x11002.复位信号是MCU工作的起点,430的复位信号有两种:上电复位信号POR和上电清除信号PUC。
POR 信号只在上电和RST/NMI复位管脚被设置为复位功能,且低电平时系统复位。
而PUC信号是POR信号产生,以及其他如看门狗定时溢出、安全键值出现错误是产生。
但是,无论那种信号触发的复位,都会使msp430在地址0xffff处读取复位中断向量,然后程序从中断向量所指的地址开始执行。
复位后的状态不写了,详见参考书,嘿嘿。
3.系统时钟是一个程序运行的指挥官,时序和中断也是整个程序的核心和中轴线。
430最多有三个振荡器,DCO内部振荡器;LFXT1外接低频振荡器,常见的32768HZ,不用外接负载电容;也可接高频450KHZ -8M,需接负载电容;XT2接高频450KHZ-8M,加外接电容。
(经验中发现,接XT2时,需要注意自己开启XT2,并延时50us等待XT2起振,然后手工清除IFG1中的OFIFG位,其操作顺序为:打开XT2->等待XT2稳定->切换系统时钟为XT2)430有三种时钟信号:MCLK系统主时钟,可分频1 2 4 8,供cpu使用,其他外围模块在有选择情况下也可使用;SMCLK系统子时钟,供外围模块使用,可选则不同振荡器产生的时钟信号;ACLK辅助时钟,只能由LFXT1产生,供外围模块。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
SMBus Library for MSP430FR5xx6xx Devices User’s GuideDOCNUM-1.10.00.00Copyright©2015T exas Instruments Incorporated.1 CopyrightCopyright©2015Texas Instruments Incorporated.All rights reserved.MSP430and MSP430Ware are trademarks of Texas Instruments Instruments. ARM and Thumb are registered trademarks and Cortex is a trademark of ARM Limited.Other names and brands may be claimed as the property ofbe aware that an important notice concerning availability,standard warranty,and use in critical applications of Texas Instruments semi-conductor products and disclaimers thereto appears at the end of this document.Texas Instruments13532N.Central Expressway MS3810Dallas,TX75243/Revision InformationThis is version1.10.00.00of this document,last updated on Fri Feb13201511:59:30.Table of Contents2Table of ContentsCopyright (1)Revision Information (1)1Introduction (3)1.1Introduction (3)1.2SMBus (3)1.3The MSP430™SMBus Library Package (4)2Introduction to the MSP430™SMBus API (5)2.1Overview (5)2.2Supported Device Families (5)2.3Supported Development Environments (5)2.4Stack Organization (5)2.5Usage of MCU Peripheral Resources (6)2.6Release Notes and Migration from Previous Versions (6)3SMBus API Usage (7)3.1Introduction (7)3.2Usage (7)3.3Examples (8)IMPORTANT NOTICE (9)1Introduction1.1IntroductionThs SMBus(Sytem Management Bus)API(application programming interface)stack forMSP430™microcontrollers is a turnkey API.It includes support for applications where theMSP430™microcontroller is acting as the master or a slave.The API is designed to minimize the SMBus knowledge required to write an application:All SMBus protocol is handled automatically by the APIThe data interface presented to the application is simple to use,abstracting the applicationfrom SMBus protocolThe user should not need to modify the API source.However,for experienced developers,thesource is open and available for editing.Accessing the API’s source can also be useful for systemdebug.Application examples are included in the MSP430™SMBus Library Package.1.2SMBusThe System Management Bus(SMBus)is a lightweight two-wire interface based on the principlesof I2C,commonly used as a control bus and for power management tasks in computing,mobilecomputing and battery operated applications.A device performing data transfers on the bus canbe considered a master,which is the device which initiates a transaction and drives the clock,or aslave,which is the target of a SMBus transaction driven by the master.Both the master and theslave can act as transmitters or as receivers.SMBus2.0shares a lot of similarities with I2C,but some of the most relevant differences include:Time-out detection when a device stretches the clock for too longPacket Error Checking(PEC)can be optionally appended at the end of each transaction,allowing the bus to automatically validate packetsI2C only defines a PHY and Data-Link layers,but SMBus defines a network layer withdifferent SMBus protocols which can be used to exchange data between devicesOptional use of additional lines such as SMBAlert#and SMBSUS#.For more information about SMBus,please refer to the SMBus2.0specification:/specs/.For more information about I2C,please refer to/documents/user manual/UM10204.pdf1.2.1Supported FeaturesThe following table details the SMBus features supported in the MSP430™SMBus library.SMBus Feature MSP430FR5xx6xx MSP430G2xx3Applicable SMBus2.0 Master Slave Master Slave specification sectionClock Timeout detection1Y es Y es Y es1Y es1 3.1.1.2Manual NACK on invalid address/data N/A Y es2N/A No 4.2Arbitration Y es N/A Y es N/A 4.3.2Clock stretching Y es Y es Y es Y es 4.3.3Multiple Slave address N/A No N/A No 5.2General Call address N/A No N/A No 5.2PEC Y es Y es Y es Y es 5.4Quick Command Partial3Partial3Parial3Partial3 5.5.1Send Byte Y es Y es Y es Y es 5.5.2Receive Byte Y es Y es Y es Y es 5.5.3Write Byte/Word Y es Y es Y es Y es 5.5.4Read Byte/Word Y es Y es Y es Y es 5.5.5Process Call Y es Y es Y es Y es 5.5.6Block Write/Read Y es Y es Y es Y es 5.5.7Block write-block read process call Y es Y es Y es Y es 5.5.8Host notify protocol No No No No 5.5.9ARP No No No No 5.6SMBAlert#No No No No Appendix ASMBSUS#No No No No Appendix ANotes:1.MSP430G2xx3USCI doesn’t have integrated timeout detection and requires a timer2.MSP430FR5x/6xx can optionally-use DMA to stretch SCL while deciding to ACK/NACK thecurrent byte3.Only QuickCommand Write is supported,not QuickCommand Read1.3The MSP430™SMBus Library PackageThis User’s Guide documents the SMBus API and examples.The contents of the package isdescribed below:smbuslib:T op level directory.Contains release notes and the manifestfile related to licensing.•docs:Contains the API and User’s Guides for the supported MSP430™devices•driverlib:Contains the standard MSP430™driverlib which is used in the libraryimplementation for device families that support driverlib(for example,MSP430FR5xx6xx)•examples:Contains the example projects for each of the supported MSP430™devices•src:Contains the source code for the SMBus Library stack2Introduction to the MSP430™SMBus API 2.1OverviewThe MSP430™SMBus API stack allows easy creation of MSP430™applications thatcommunicate with other system components over a SMBus interface.This API supports using the MSP430™microcontroller as the SMBus master or as a SMBusslave.2.2Supported Device FamiliesThe SMBus API stack is supported on the following MSP430™device families:MSP430FR5xx6xxMSP430G2xx32.3Supported Development EnvironmentsThe SMBus API stack and examples build and run on both the IAR and CCS environments forMSP430™microcontrollers.See the Release Notes HTMLfile in the SMBus Library Package forspecific IAR/CCS version information.IAR and CCS are both available in free,code-size-limited versions(8K and16K,respectively,ofobject code).Applications thatfit under8K of memory can be run on both free versions.Applications that are greater than8K cannot be built using the free IAR Kickstart tool.Instead,thefree version of CCS can be used;or a licensed version of either environment.See the Release Notes within the SMBus Library Package zipfile for additional informationspecific to a given release.2.4Stack OrganizationThe software stack is organized into three layers:The public API layer defines the API’s that should be called by application programs.Thesefunctions are defined in smbus.h.The network layer manages the SMBus protocol state machine and interfaces with thephysical layer.These functions are defined in smbus nwk.h and should not be called directlyfrom application programs.The physical layer contain all the device specific code to interact with the MSP430™microcontroller.These functions are defined in smbus phy.h and should not be called directlyfrom application programs.2.5Usage of MCU Peripheral ResourcesWithin the SMBus API,the resources shown below are considered owned by the API.If theapplication accesses them,it should be aware of how the API uses them.2.6Release Notes and Migration from Previous VersionsA Release Notes HTMLfile accompanies each release of the SMBus Library Package.Referencethisfile for any information specific to this release,including:All changes from the previous versionsInstructions for migration from previous versionsUpdated IDE configuration informationKnown issues3SMBus API Usage3.1IntroductionThis chapter contains the detailed documentation for the application API functions anddescriptions on using the API to create a SMBus master or slave application.3.2UsageThis section illustrates the basic application template for master and slave applications.See theexamples for complete applications,and the HTML API documentation for details on theindividual APIs.3.2.1Master Usage Outline//Declare master SMBus structureSMBus SMB;//Initialize GPIOs and clocks...//Initialize GPIO I2C pins...//Initialize SMBus Master using eUSCI B0always at100kbps per SMBus specSMBus masterInit(&SMB,EUSCI B0BASE,(MCLK MHZ*1000000));//Initialize I2C and enable SMBus InterruptsSMBus masterEnableInt(&SMB);//Send SMBus Sendbyte command(0x33)uint8t ret=SMBus masterSendByte(&SMB,//SMB struct0x40,//Slave Addr0x33);//SMB Command...3.2.2Slave Usage Outlinemain(){//Declare slave SMBus structureSMBus SMB;//SMBus receive and transmit buffersuint8t au8RxBuff[SMB MAX PACKET SIZE];uint8t au8TxBuff[SMB MAX PACKET SIZE];//Initialize GPIOs and clocks...//Initialize GPIO I2C pins...//Initialize SMBus Slave using eUSCI B0SMBus slaveInit(&SMB,EUSCI B0BASE);//Set the slave’s addressSMBus slaveSetAddress(&SMB,0x40);//Set the RX and TX buffers for SMBusSMBus slaveSetRxBuffer(&SMB,au8RxBuff,sizeof(au8RxBuff));SMBus slaveSetTxBuffer(&SMB,au8TxBuff,sizeof(au8TxBuff));//Initialize I2C and enable SMBus InterruptsSMBus slaveEnableInt(&SMB);...while(1){disable interrupt();{BIS SR(LPM3bits+GIE);//Go to sleep}enable interrupt();}//While(1)}#pragma vector=USCI B0VECTORinterrupt void eUSCI ISR(void){//Check the state of SMBusswitch(SMBus slaveProcessInt(&SMB)){case SMBus State Slave QCMD://If a Quick command was detected,execute function(if any)break;case SMBus State Slave CmdComplete://Get command using SMBus slaveGetCommand(&SMB)and process command//if command is not valid/supported//SMBus slaveReportError(&SMB,SMBUS ErrorCode Cmd);LPM3EXIT;//Exit to main loop if requiredbreak;default:break;}//Clear flags to be ready for next packetSMBus processDone(&SMB);}3.3ExamplesSeveral examples are provided with the release package that illustrate using the library toimplement both SMBus master and slave application.For each example,matching master and slave implementations are provided.ReadByte Echo-sends and echoes back a ReadByte commandWriteWord Dimmer-sends and echoes back a WriteWord commandAllProtocols-sequences through all the SMBus protocolsExamples are configured for the MSP-EXP430G2and MSP-EXP430FR5969launch pad boardsand CCS and IAR projects are provided.9 IMPORTANT NOTICET exas Instruments Incorporated and its subsidiaries(TI)reserve the right to make corrections,modifications,enhancements,improvements, and other changes to its products and services at any time and to discontinue any product or service without notice.Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete.All products are sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standard warranty.T esting and other quality control techniques are used to the extent TI deems necessary to support this warranty.Except where mandated by government requirements,testing of all parameters of each product is not necessarily performed.TI assumes no liability for applications assistance or customer product design.Customers are responsible for their products and applications using TI components.T o minimize the risks associated with customer products and applications,customers should provide adequate design and operating safeguards.TI does not warrant or represent that any license,either express or implied,is granted under any TI patent right,copyright,mask work right,or other TI intellectual property right relating to any combination,machine,or process in which TI products or services are used. Information published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a warranty or endorsement e of such information may require a license from a third party under the patents or other intellectual property of the third party,or a license from TI under the patents or other intellectual property of TI.Reproduction of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accom-panied by all associated warranties,conditions,limitations,and notices.Reproduction of this information with alteration is an unfair and deceptive business practice.TI is not responsible or liable for such altered rmation of third parties may be subject to additional restrictions.Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice.TI is not responsible or liable for any such statements.TI products are not authorized for use in safety-critical applications(such as life support)where a failure of the TI product would reasonably be expected to cause severe personal injury or death,unless officers of the parties have executed an agreement specifically governing such use.Buyers represent that they have all necessary expertise in the safety and regulatory ramifications of their applications, and acknowledge and agree that they are solely responsible for all legal,regulatory and safety-related requirements concerning their products and any use of TI products in such safety-critical applications,notwithstanding any applications-related information or support that may be provided by TI.Further,Buyers must fully indemnify TI and its representatives against any damages arising out of the use of TI products in such safety-critical applications.TI products are neither designed nor intended for use in military/aerospace applications or environments unless the TI products are specifically designated by TI as military-grade or“enhanced plastic.”Only products designated by TI as military-grade meet military spec-ifications.Buyers acknowledge and agree that any such use of TI products which TI has not designated as military-grade is solely at the Buyer’s risk,and that they are solely responsible for compliance with all legal and regulatory requirements in connection with such use.TI products are neither designed nor intended for use in automotive applications or environments unless the specific TI products are designated by TI as compliant with ISO/TS16949requirements.Buyers acknowledge and agree that,if they use any non-designated products in automotive applications,TI will not be responsible for any failure to meet such requirements.Following are URLs where you can obtain information on other Texas Instruments products and application solutions:ProductsAmplifiersData ConvertersDLP®ProductsDSPClocks and TimersInterfaceLogicPower Mgmt MicrocontrollersRFIDRF/IF and ZigBee®Solutions amplifi/clockswww.ti-rfi/lprfApplicationsAudioAutomotiveBroadbandDigital ControlMedicalMilitaryOptical NetworkingSecurityT elephonyVideo&ImagingWireless/audio/automotive/broadband/digitalcontrol/medical/military/opticalnetwork/security/telephony/video/wirelessMailing Address:T exas Instruments,Post Office Box655303,Dallas,T exas75265 Copyright©2015,T exas Instruments Incorporated。