历史上的今天
今天是:2025年04月05日(星期六)
2020年04月05日 | MSP432 开发环境
2020-04-05 来源:eefocus
安装CCS9.2,SDK包。
https://e2echina.ti.com/question_answer/microcontrollers/msp430/f/55/t/179621
SDK开发查找函数:
http://dev.ti.com/tirex/content/simplelink_msp432_sdk_1_30_00_40/docs/driverlib/msp432p4xx/html/driverlib_html/modules.html
开ADC 和开1s定时器A中断:
// * --|RST P5.5 |<--- A0 (Analog Input)
// * | P1.0|-->LED
/* DriverLib Includes */
#include /* Standard Includes */ #include #include /* Statics */ static volatile uint16_t curADCResult; static volatile float normalizedADCRes; /* Timer_A UpMode Configuration Parameter */ const Timer_A_UpModeConfig upConfig = { TIMER_A_CLOCKSOURCE_ACLK, //aclk TIMER_A_CLOCKSOURCE_DIVIDER_1, //32768hz 32768, // 1 s clock TIMER_A_TAIE_INTERRUPT_DISABLE, // Disable Timer interrupt TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE, // Enable CCR0 interrupt TIMER_A_DO_CLEAR // Clear value }; int main(void) { /* Halting the Watchdog */ MAP_WDT_A_holdTimer(); /* Initializing Variables */ curADCResult = 0; /* Setting Flash wait state */ MAP_FlashCtl_setWaitState(FLASH_BANK0, 1); MAP_FlashCtl_setWaitState(FLASH_BANK1, 1); /* Setting DCO to 48MHz */ MAP_PCM_setPowerState(PCM_AM_LDO_VCORE1); MAP_CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_48); /* Enabling the FPU for floating point operation */ MAP_FPU_enableModule(); MAP_FPU_enableLazyStacking(); //![Single Sample Mode Configure] /* Initializing ADC (MCLK/1/4) */ MAP_ADC14_enableModule(); MAP_ADC14_initModule(ADC_CLOCKSOURCE_MCLK, ADC_PREDIVIDER_1, ADC_DIVIDER_4, 0); /* Configuring GPIOs (5.5 A0) */ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P5, GPIO_PIN5, GPIO_TERTIARY_MODULE_FUNCTION); /* Configuring ADC Memory */ MAP_ADC14_configureSingleSampleMode(ADC_MEM0, true); MAP_ADC14_configureConversionMemory(ADC_MEM0, ADC_VREFPOS_AVCC_VREFNEG_VSS, ADC_INPUT_A0, false); /* Configuring Sample Timer */ MAP_ADC14_enableSampleTimer(ADC_MANUAL_ITERATION); /* Enabling/Toggling Conversion */ MAP_ADC14_enableConversion(); MAP_ADC14_toggleConversionTrigger(); //![Single Sample Mode Configure] /* Enabling interrupts */ MAP_ADC14_enableInterrupt(ADC_INT0); MAP_Interrupt_enableInterrupt(INT_ADC14); /* Configuring Timer_A1 for Up Mode */ MAP_Timer_A_configureUpMode(TIMER_A1_BASE, &upConfig); /* Enabling interrupts and starting the timer */ MAP_Interrupt_enableSleepOnIsrExit(); MAP_Interrupt_enableInterrupt(INT_TA1_0); MAP_Timer_A_startCounter(TIMER_A1_BASE, TIMER_A_UP_MODE); /* Configuring P1.0 as output */ MAP_GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0); /* Enabling MASTER interrupts */ MAP_Interrupt_enableMaster(); while (1) { //MAP_PCM_gotoLPM0(); } } void ADC14_IRQHandler(void) { uint64_t status = MAP_ADC14_getEnabledInterruptStatus(); MAP_ADC14_clearInterruptFlag(status); if (ADC_INT0 & status) { curADCResult = MAP_ADC14_getResult(ADC_MEM0); normalizedADCRes = (curADCResult * 3.3) / 16384; //normalizedADCRes就是最后电压 MAP_ADC14_toggleConversionTrigger(); } } void TA1_0_IRQHandler(void) { MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN0); MAP_Timer_A_clearCaptureCompareInterrupt(TIMER_A1_BASE,TIMER_A_CAPTURECOMPARE_REGISTER_0); }
史海拾趣
|
本人有一套无线控制设备一时难以实现,请有经验的厂家或个人给于帮助.具体功能请见下面WORD文档.XX机配套遥控器使用说明书.doc,遥控产品功能要求.doc.非常感谢!!!w有代开发者请与本人联系. … 查看全部问答> |
|
can\'t find compiler component. This is typically caused by the compiler not being able to find the configuration file, ...\\VERS\\conf\\dtools.conf file. Reinstalling the tools might help. make: *** [sysALib.o] Error 0x1 … 查看全部问答> |
|
用windriver好像收中断效率不高,怎么样设置才能编写PlugIn?按文档上说的操作试了试好像不行。总是报KP_wdapi921.lib 以及KP_NTapi921.lib(好像是这两个)库的链接错误。还有一堆在哪都找不到的函数的链接错误。err 2019. 用 driverstudio如何能 ...… 查看全部问答> |
|
请教:因为之前安装限时版的430调试软件,时间到期之后,重新安装 iar embeded workbench evaluation for msp430 4.21 是否可以继续使用? 可有哪位兄台曾经这么做过?… 查看全部问答> |
|
最近弄了一个用MSP430F2001加两个HEF4904BT来驱动电子纸广告牌,从市面上买了一个MSP430F2001的ic回来,可是却驱动不了,不知道是怎么了,可以确定其它的东西都没问题,是不是里面要再写入一些程序进去呢?请高手指教!谢谢!… 查看全部问答> |
|
本帖最后由 dontium 于 2015-1-23 13:13 编辑 大家好: 我最近在用TI的PGA112,有两路信号需要送到pga112。两路信号都是双极的,大约都是+/-100mv的信号,正在参考pga112技术手册图 77中Ch0的接法连接,就是两路信号分别通过两个CA,连到Ch0和Ch1. ...… 查看全部问答> |
|
在做无线数据采集的时候,由于节点的数据需要经过远距离传输至检测中心,为了满足远距离无线传输的需求,需要增加额外的中继设施,随着3G业务的日趋成熟,各家电信公司都有相应的业务开放,本文选取的就是中国联通的3G ...… 查看全部问答> |




