Tool/software: Code Composer Studio
Hi there,
I am writing this code and trying to print out array when it is all filled (16000 indices). Is there any driverlib functions that I can print out variables or arrays (basically values that store in memory) as a txt file automatically?
Here is the code that I wrote,
#include <ti/devices/msp432p4xx/driverlib/driverlib.h>
/* Standard Includes */
#include <stdint.h>
#include <stdbool.h>
//s#include <stdio.h>
volatile float array[16000];
int count = 0;
volatile int index;
int main(void)
{
/* Halting the Watchdog */
MAP_WDT_A_holdTimer();
//![Simple CS Config]
/* Configuring pins for peripheral/crystal usage and LED for output */
MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(
GPIO_PORT_PJ,
GPIO_PIN3 | GPIO_PIN2,
GPIO_PRIMARY_MODULE_FUNCTION);
MAP_GPIO_setAsInputPinWithPullUpResistor(GPIO_PORT_P1, GPIO_PIN1);
MAP_GPIO_interruptEdgeSelect(GPIO_PORT_P1, GPIO_PIN1,
GPIO_HIGH_TO_LOW_TRANSITION);
/* Just in case the user wants to use the getACLK, getMCLK, etc. functions,
* let's set the clock frequency in the code.
*/
CS_setExternalClockSourceFrequency(32000, 36000000);
/* Starting HFXT in non-bypass mode without a timeout. Before we start
* we have to change VCORE to 1 to support the 48MHz frequency */
MAP_PCM_setCoreVoltageLevel(PCM_VCORE1);
MAP_FlashCtl_setWaitState(FLASH_BANK0, 1);
MAP_FlashCtl_setWaitState(FLASH_BANK1, 1);
CS_startHFXT(false);
/* Initializing MCLK to HFXT (effectively 48MHz) */
MAP_CS_initClockSignal(CS_MCLK, CS_HFXTCLK_SELECT, CS_CLOCK_DIVIDER_1);
//![Simple CS Config]
/* Configuring SysTick to trigger at 12000000 (MCLK is 48MHz so this will
* make it toggle every 0.025s) */
MAP_SysTick_enableModule();
MAP_SysTick_setPeriod(1200000);
MAP_Interrupt_enableSleepOnIsrExit();
MAP_SysTick_enableInterrupt();
/* Enabling MASTER interrupts */
MAP_Interrupt_enableMaster();
while (1)
{
}
}
void SysTick_Handler(void)
{
volatile float subarray[6];
volatile float sum;
int i;
count++;
subarray[count] = MAP_GPIO_getInputPinValue(GPIO_PORT_P1, GPIO_PIN1);
if (count % 6 == 0)
{
for (i = 0; i < 6; i++)
{
sum += subarray[i];
}
array[index] = sum;
sum = 0;
i = 0;
count = 0;
index++;
}
}