in am new to ccs and tiva and hence i cant able to find the real problem
the compilation has done with no errors but the error in the output
the output has been in the fault isr
the code given by
#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>
#include <math.h>
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/sysctl.h"
#include "driverlib/interrupt.h"
#include "driverlib/pin_map.h"
#include "driverlib/adc.h"
#include "driverlib/gpio.h"
#include "driverlib/comp.h"
#include "driverlib/rom_map.h"
#include "driverlib/debug.h"
#include "driverlib/fpu.h"
#include "driverlib/timer.h"
#include "driverlib/uart.h"
#include "utils/uartstdio.h"
#include "driverlib/rom.h"
uint32_t g_ui32SysClock;
void ConfigureUART(void);
void
ConfigureUART(void)
{
//
// Enable the GPIO Peripheral used by the UART.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
//
// Enable UART0.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
//
// Configure GPIO Pins for UART mode.
//
GPIOPinConfigure(GPIO_PA0_U0RX);
GPIOPinConfigure(GPIO_PA1_U0TX);
GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
//
// Initialize the UART for console I/O.
//
UARTStdioConfig(0, 115200, g_ui32SysClock);
}
void main (void)
{
uint32_t v[1],x[1],vtotal,xtotal;
float vrms;
g_ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN |
SYSCTL_USE_PLL |
SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
GPIOPinTypeADC(GPIO_PORTD_BASE, GPIO_PIN_2);
ADCSequenceConfigure(ADC0_BASE,3,ADC_TRIGGER_PROCESSOR,0);
ADCSequenceStepConfigure(ADC0_BASE,3,0,ADC_CTL_CH13 | ADC_CTL_END);
ADCSequenceEnable(ADC0_BASE,3);
ADCIntClear(ADC0_BASE,3);
//ConfigureUART();
UARTprintf("\033[2J\033[H");
UARTprintf("adc values\n");
while(1)
{int i;
for(i=0;i<512;i++)
{
ADCIntClear(ADC0_BASE,3);
ADCProcessorTrigger(ADC0_BASE,3 );
while(!ADCIntStatus(ADC0_BASE,3,false)){}
ADCIntClear(ADC0_BASE,3);
uint32_t adc0buffer[512];
ADCSequenceDataGet(ADC0_BASE,0,&adc0buffer[i]);
v[i] = adc0buffer[i];
UARTprintf("%d\n",v[i]);
}
for (i=0;i<512;i++)
{
vtotal = vtotal + v[i];
x[i] = v[i]*v[i];
}
for (i=0;i<512;i++)
{
xtotal = xtotal + x[i];
}
vrms = sqrt(xtotal / 512);
UARTprintf("%d",vrms);
}
}