今日热门

3

回答

本人使用的是MSP430F5529单片机,IAR6.3版本的编译器。因为内部8KRAM不太够用,然后发现F5529的USB通信模块具有2KB的RAM缓冲区,当USB通信模块禁止使用时,这2KB的RAM缓冲区也可作为系统的RAM存储器使用,所以想请问一下有谁做过这块,麻烦提供一个例程或者技术文档,非常感谢!!

60134d4fc195c105 2018-08-16 阅读:609

9

回答
MSPG2553写矩阵键盘 MSP430单片机

我用G2553驱动了一个12864,和4*4的矩阵键盘,电源是共用了一个电源,可是不知道为什么,每当按下矩阵键盘的时候,12864的屏幕就一直闪个不停,程序能正常的跑,功能也正常,就是屏幕闪烁。

本人帅男 2018-08-16 阅读:506

7

回答

如题这款单片机是不是没有位操作,只有字节操作啊。最不明白的是这款单片机管教是如何配置的,怎样配置才是输入和输出。

是风风不是雨 2018-08-16 阅读:522

13

回答

虽然知道看门狗的作用,不过还是不太明白看门狗要如何使用。看门狗的作用是在程序跑飞的情况下让系统能够及时复位重新开始执行程序,道理很简单,但是程序如何跑飞呢?如果是一段程序需要延时等待,这个不算跑飞吧,应该是正常执行。所以这种情况是不用看门狗的。那这种情况的看门狗要如何使用才合理呢?

FGHJd 2018-08-15 阅读:529

19

回答

如题

5bc7f930163cd877 2018-07-31 阅读:1023

5

回答

请问这个默认上电时钟是多少呢

序缘阿斌 2018-07-30 阅读:637

7

回答

使用的官方的MSP430G2553开发板。板子上P1.3原来是作为按键的IO使用。我自己把P1.1-P1.5这5个IO引出控制5个马达。同样配置情况下,其他4个都是好的,只有P1.3不能输出PWM波形。​

我是爆米花啊 2018-07-28 阅读:560

10

回答

MSP430是否有ISP下载功能

菜鸟冷虎 2018-07-26 阅读:450

20

回答

nrf24l01最远能达到多远,淘宝上有几千米的,是真的吗?

8c0991419eab45b6 2018-07-25 阅读:1138

14

回答

nrf24l01最远能达到多远,淘宝上有几千米的,是真的吗?

8c0991419eab45b6 2018-07-25 阅读:461

4

回答

msp430捕获事件输入源怎么理解啊

菜鸟冷虎 2018-07-23 阅读:444

7

回答

程序用的是TI提供的官方例程板子是官方的launchpad波特率也配置成相应的波特率了但是,不论用串口助手发送什么数据,得到的都是相同的乱码。。。网上有不少人问这个问题,但是提供的解决方法都不能解决具体代码如下此外UCA0TXBUF是只要给他一个数值,串口上就会直接得到相应的数据吗?不用额外写什么别的东西吗??

Chauncey 2018-07-22 阅读:672

2

回答

用的例程是ti提供的官方例程什么也没改过波特率选择的也是115200但是串口助手不论发送什么收到的都是相同的一串乱码#include "msp430.h" #include <stdbool.h> #include <stdint.h> //****************************************************************************** // UART Initialization ********************************************************* //****************************************************************************** #define SMCLK_11500 0 #define SMCLK_9600 1 #define ACLK_9600 2 #define UART_MODE SMCLK_115200 void initUART() { // Configure USCI_A0 for UART mode UCA0CTLW0 = UCSWRST; // Put eUSCI in reset #if UART_MODE == SMCLK_115200 UCA0CTLW0 |= UCSSEL__SMCLK; // CLK = SMCLK // Baud Rate calculation // 16000000/(16*115200) = 8.6805 // Fractional portion = 0.6805 // Use Table 24-5 in Family User Guide UCA0BR0 = 8; // 16000000/16/9600 UCA0BR1 = 0x00; UCA0MCTL |= UCOS16 | UCBRF_11 | UCBRS_0; #elif UART_MODE == SMCLK_9600 UCA0CTLW0 |= UCSSEL__SMCLK; // CLK = SMCLK // Baud Rate calculation // 16000000/(16*9600) = 104.1667 // Fractional portion = 0.1667 // Use Table 24-5 in Family User Guide UCA0BR0 = 104; // 16000000/16/9600 UCA0BR1 = 0x00; UCA0MCTL |= UCOS16 | UCBRF_3 | UCBRS_0; #elif UART_MODE == ACLK_9600 UCA0CTLW0 |= UCSSEL__ACLK; // CLK = ACLK // Baud Rate calculation // 32768/(9600) = 3.4133 // Fractional portion = 0.4133 // Use Table 24-5 in Family User Guide UCA0BR0 = 3; // 32768/9600 UCA0BR1 = 0x00; UCA0MCTL |= UCBRS_3; //0x0300 is UCBRSx = 0x03 #else # error "Please specify baud rate to 115200 or 9600" #endif UCA0CTLW0 &= ~UCSWRST; // Initialize eUSCI UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt } //****************************************************************************** // Device Initialization ******************************************************* //****************************************************************************** void initGPIO() { P3SEL = BIT3 + BIT4; // P3.45 = USCI_A0 TXD/RXD P5SEL |= BIT4+BIT5; // Select XT1 } void initClockTo16MHz() { UCSCTL3 |= SELREF_2; // Set DCO FLL reference = REFO UCSCTL4 |= SELA_0; // Set ACLK = XT1CLK __bis_SR_register(SCG0); // Disable the FLL control loop UCSCTL0 = 0x0000; // Set lowest possible DCOx MODx UCSCTL1 = DCORSEL_5; // Select DCO range 16MHz operation UCSCTL2 = FLLD_0 + 487; // Set DCO Multiplier for 16MHz // (N + 1) * FLLRef = Fdco // (487 + 1) * 32768 = 16MHz // Set FLL Div = fDCOCLK __bic_SR_register(SCG0); // Enable the FLL control loop // Worst-case settling time for the DCO when the DCO range bits have been // changed is n x 32 x 32 x f_MCLK / f_FLL_reference. See UCS chapter in 5xx // UG for optimization. // 32 x 32 x 16 MHz / 32768 Hz = 500000 = MCLK cycles for DCO to settle __delay_cycles(500000);// // Loop until XT1XT2 & DCO fault flag is cleared do { UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG); // Clear XT2XT1DCO fault flags SFRIFG1 &= ~OFIFG; // Clear fault flags }while (SFRIFG1&OFIFG); // Test oscillator fault flag } uint16_t setVCoreUp(uint8_t level){ uint32_t PMMRIE_backup SVSMHCTL_backup SVSMLCTL_backup; //The code flow for increasing the Vcore has been altered to work around //the erratum FLASH37. //Please refer to the Errata sheet to know if a specific device is affected //DO NOT ALTER THIS FUNCTION //Open PMM registers for write access PMMCTL0_H = 0xA5; //Disable dedicated Interrupts //Backup all registers PMMRIE_backup = PMMRIE; PMMRIE &= ~(SVMHVLRPE | SVSHPE | SVMLVLRPE | SVSLPE | SVMHVLRIE | SVMHIE | SVSMHDLYIE | SVMLVLRIE | SVMLIE | SVSMLDLYIE ); SVSMHCTL_backup = SVSMHCTL; SVSMLCTL_backup = SVSMLCTL; //Clear flags PMMIFG = 0; //Set SVM highside to new level and check if a VCore increase is possible SVSMHCTL = SVMHE | SVSHE | (SVSMHRRL0 * level); //Wait until SVM highside is settled while((PMMIFG & SVSMHDLYIFG) == 0) { ; } //Clear flag PMMIFG &= ~SVSMHDLYIFG; //Check if a VCore increase is possible if((PMMIFG & SVMHIFG) == SVMHIFG) { //-> Vcc is too low for a Vcore increase //recover the previous settings PMMIFG &= ~SVSMHDLYIFG; SVSMHCTL = SVSMHCTL_backup; //Wait until SVM highside is settled while((PMMIFG & SVSMHDLYIFG) == 0) { ; } //Clear all Flags PMMIFG &= ~(SVMHVLRIFG | SVMHIFG | SVSMHDLYIFG | SVMLVLRIFG | SVMLIFG | SVSMLDLYIFG ); //Restore PMM interrupt enable register PMMRIE = PMMRIE_backup; //Lock PMM registers for write access PMMCTL0_H = 0x00; //return: voltage not set return false; } //Set also SVS highside to new level //Vcc is high enough for a Vcore increase SVSMHCTL |= (SVSHRVL0 * level); //Wait until SVM highside is settled while((PMMIFG & SVSMHDLYIFG) == 0) { ; } //Clear flag PMMIFG &= ~SVSMHDLYIFG; //Set VCore to new level PMMCTL0_L = PMMCOREV0 * level; //Set SVM SVS low side to new level SVSMLCTL = SVMLE | (SVSMLRRL0 * level) | SVSLE | (SVSLRVL0 * level); //Wait until SVM SVS low side is settled while((PMMIFG & SVSMLDLYIFG) == 0) { ; } //Clear flag PMMIFG &= ~SVSMLDLYIFG; //SVS SVM core and high side are now set to protect for the new core level //Restore Low side settings //Clear all other bits _except_ level settings SVSMLCTL &= (SVSLRVL0 + SVSLRVL1 + SVSMLRRL0 + SVSMLRRL1 + SVSMLRRL2 ); //Clear level settings in the backup registerkeep all other bits SVSMLCTL_backup &= ~(SVSLRVL0 + SVSLRVL1 + SVSMLRRL0 + SVSMLRRL1 + SVSMLRRL2); //Restore low-side SVS monitor settings SVSMLCTL |= SVSMLCTL_backup; //Restore High side settings //Clear all other bits except level settings SVSMHCTL &= (SVSHRVL0 + SVSHRVL1 + SVSMHRRL0 + SVSMHRRL1 + SVSMHRRL2 ); //Clear level settings in the backup registerkeep all other bits SVSMHCTL_backup &= ~(SVSHRVL0 + SVSHRVL1 + SVSMHRRL0 + SVSMHRRL1 + SVSMHRRL2); //Restore backup SVSMHCTL |= SVSMHCTL_backup; //Wait until high side low side settled while(((PMMIFG & SVSMLDLYIFG) == 0) && ((PMMIFG & SVSMHDLYIFG) == 0)) { ; } //Clear all Flags PMMIFG &= ~(SVMHVLRIFG | SVMHIFG | SVSMHDLYIFG | SVMLVLRIFG | SVMLIFG | SVSMLDLYIFG ); //Restore PMM interrupt enable register PMMRIE = PMMRIE_backup; //Lock PMM registers for write access PMMCTL0_H = 0x00; return true; } bool increaseVCoreToLevel2() { uint8_t level = 2; uint8_t actlevel; bool status = true; //Set Mask for Max. level level &= PMMCOREV_3; //Get actual VCore actlevel = PMMCTL0 & PMMCOREV_3; //step by step increase or decrease while((level != actlevel) && (status == true)) { if(level > actlevel) { status = setVCoreUp(++actlevel); } } return (status); } //****************************************************************************** // Main ************************************************************************ // Enters LPM0 if SMCLK is used and waits for UART interrupts. If ACLK is used * // then the device will enter LPM3 mode instead. The UART RX interrupt handles * // the received character and echoes it. * //****************************************************************************** int main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop Watchdog initGPIO(); increaseVCoreToLevel2(); initClockTo16MHz(); initUART(); #if UART_MODE == ACLK_9600 __bis_SR_register(LPM3_bits + GIE); // Since ACLK is source enter LPM3 interrupts enabled #else __bis_SR_register(LPM0_bits + GIE); // Since SMCLK is source enter LPM0 interrupts enabled #endif __no_operation(); // For debugger } //****************************************************************************** // UART RX Interrupt *********************************************************** //****************************************************************************** #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) #pragma vector=USCI_A0_VECTOR __interrupt void USCI_A0_ISR(void) #elif defined(__GNUC__) void __attribute__ ((interrupt(USCI_A0_VECTOR))) USCI_A0_ISR (void) #else #error Compiler not supported! #endif { switch(__even_in_range(UCA0IV4)) { case 0:break; // Vector 0 - no interrupt case 2: // Vector 2 - RXIFG while (!(UCA0IFG & UCTXIFG)); // USCI_A0 TX buffer ready? UCA0TXBUF = UCA0RXBUF; // TX -> RXed character break; case 4:break; // Vector 4 - TXIFG default: break; } } ​

Chauncey 2018-07-21 阅读:883

14

回答

单片机中空指针怎么表示

菜鸟冷虎 2018-07-21 阅读:704

8

回答

MSP430其外围晶振如何选择?

菜鸟冷虎 2018-07-20 阅读:434

23

回答

MSP430系列那个型号更热呢,   CC无线系列那个型号可以推荐,现在都用stm32开发,430用的人多吗

huihui163 2018-07-09 阅读:900

3

回答

请问__even_in_range函数在MSP430的作用是什么?

菜鸟冷虎 2018-07-05 阅读:538

3

回答

请推荐一下合适的型号

菜鸟冷虎 2018-07-03 阅读:568

10

回答

同时挂载了两个设备 一个是存储器 一个是ELMOS 的USB 快充IC 跟USB 快充IC通信时ACK 拉不低 请问这是什么原因造成的?

hangtao 2018-06-23 阅读:618

10

回答

做低功耗产品msp430适合吗

勇哥来巡山 2018-06-20 阅读:578
  • 帮助人数
  • 0
  • 获得赞数
  • 0
  • 一周积分
  • 0

问题达人换一批

本月问答

排名
用户名
问答积分
11
30
12
22
13
20
14
20
16
12
17
10
18
6
19
4
20
4
< 123 >