on debugging the code on the board , the flow control of the code is going into the fault isr infinte loop when the it entering into the SysCtlClockFreqSet
the code given below
#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.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"
void ConfigureUART(void);
uint32_t g_ui32SysClock;
void
ConfigureUART(void)
{
//
// Enable the GPIO Peripheral used by the UART.
//
MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
while(!(SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOA)));
//
// Enable UART0.
//
MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
while(!(SysCtlPeripheralReady(SYSCTL_PERIPH_UART0)));
//
// Configure GPIO Pins for UART mode.
//
MAP_GPIOPinConfigure(GPIO_PA0_U0RX);
MAP_GPIOPinConfigure(GPIO_PA1_U0TX);
MAP_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);
//
// Initialize the UART for console I/O.
//
UARTStdioConfig(0, 115200, 16000000);
}
int main (void)
{
uint32_t v[8],x[8],vtotal,xtotal;
float vrms;
// SysCtlClockSet(SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); //20 MHz clock
g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 200000000);
SysCtlDelay(g_ui32SysClock/12);
// ConfigureUART();
SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
while(!(SysCtlPeripheralReady(SYSCTL_PERIPH_ADC0)));
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
while(!(SysCtlPeripheralReady(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 |ADC_CTL_IE);
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<8;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<8;i++)
{
vtotal = vtotal + v[i];
x[i] = v[i]*v[i];
}
for (i=0;i<8;i++)
{
xtotal = xtotal + x[i];
}
vrms = sqrt(xtotal / 512);
UARTprintf("%d",vrms);
SysCtlDelay(g_ui32SysClock / 12);
}
}