This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430FR5994: SDCARD with MSP430fr5994

Part Number: MSP430FR5994

Hi There,

I was trying to interface micro SDcard with MSP430FR5994. I was using msp430fr5994 OUT OF BOX DEMO example. I wanted to write and read a sensor data from SDCARD. But before that I wanted to write some positive and negative values into SDCARD and read them. I have run the program upto FRAM LOG and read in document that the SDCARD LOG MODE is also same as FRAM LOG MODE. But I'm not able to get to know that how to write the values i.e., In which function I can to pass the values? Can some one help me please?  

Thanks in advance.

  • Hi there,

    Section 3.1 of the Launch-Pad User's Guide will help you understand out of box demo.

    And as for data writing and reading, I suggest you focus on the file "HAL_SDCard.c", it describes the API function of Send/Read a frame of bytes via SPI.

    Best Regards

    Sal

  • Hi sal,

    I could able to write and read the temperature and voltage values. But if I try to write the data in the function call the code is not working. When I debug the code It is stopping at the interrupt __bis_SR_register(LPM3_bits | GIE); . Interrupt is not triggering. I'm sharing the piece of code here please help me. And the SDCard_sendFrame(99,2); , SDCard_readFrame(2); function looks similar so i have removed 1st argument from readFrame function. I'm not sure that I was correct. So please help me. 

               case SDCARD_LOG_MODE:
                   // printf("SDCARD_LOG_MODE\r\n");
                	storeTimeStampSDCard();
    
                	for (i=0;i<3;i++)
                	{
                        GPIO_setOutputHighOnPin(GPIO_PORT_P1, GPIO_PIN0);
                        __delay_cycles(300000);
                        GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0);
                        __delay_cycles(2000000);
                	}
    
                	while (mode == SDCARD_LOG_MODE) {
                		Init_RTC();
                		sdcardLog();
                	}
                	break;
                case TRANSMIT_SDCARD_DATA_MODE:
    
                    SDCard_init();
                    SDCard_fastMode();
                	sendCalibrationConstants();
                	sendTimeStampSDCard();
                	sendDataSDCard();
                	SDCard_sendFrame(99,2);
                	//__delay_cycles(8000000);
                	//SDCard_readFrame(2);
                	break;
                default:
                	break;
            }
    
            if (noSDCard) {
            	__delay_cycles(900000);
                GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN0, GPIO_SECONDARY_MODULE_FUNCTION);
    
                // Send Temp Sensor Calibration Data
                EUSCI_A_UART_transmitData(EUSCI_A0_BASE, 'N');
                EUSCI_A_UART_transmitData(EUSCI_A0_BASE, 'O');
                EUSCI_A_UART_transmitData(EUSCI_A0_BASE, ' ');
                EUSCI_A_UART_transmitData(EUSCI_A0_BASE, 'S');
                EUSCI_A_UART_transmitData(EUSCI_A0_BASE, 'D');
                EUSCI_A_UART_transmitData(EUSCI_A0_BASE, 'C');
                EUSCI_A_UART_transmitData(EUSCI_A0_BASE, 'A');
                EUSCI_A_UART_transmitData(EUSCI_A0_BASE, 'R');
                EUSCI_A_UART_transmitData(EUSCI_A0_BASE, 'D');
    
                while(EUSCI_A_UART_queryStatusFlags(EUSCI_A0_BASE, EUSCI_A_UART_BUSY));
    
                GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN0);
            	GPIO_setAsOutputPin(GPIO_PORT_P2, GPIO_PIN0);
            	noSDCard = 0;
            }
    
            __bis_SR_register(LPM3_bits | GIE);       // Enter LPM3 and wait for PC commands
            __no_operation();
        }

**Attention** This is a public forum