Hi,
I worked on the timer tutorials and tried a few things.
And suddenly the CCS crashed during debug and after restarting i cannot connect to my target.
Iam not sure if it is because of the code that i uploaded last session.
I set down the SystemClock to test the 16bit timer to see toggleing of the led.
If clicking on debug the CCS presents a Messagebox Window with the text: Error connecting to the target.
If clicking on Retry it distplays "Frequency is out of range."
If clicking Cancel it shows one additional box, returns to edit perspective and then it crashes.
How can i recover my Launchpad?
here is the code:
#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/gpio.h"
#include "driverlib/timer.h"
#include <inttypes.h>
int main(void) {
uint32_t ulPeriod;
SysCtlClockSet( SYSCTL_SYSDIV_50 | SYSCTL_USE_OSC | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3);
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
TimerConfigure(TIMER0_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PERIODIC);
ulPeriod = (SysCtlClockGet() ) / 2;
TimerLoadSet(TIMER0_BASE, TIMER_A, 0xffFF);//);ulPeriod -1);
TimerPrescaleSet(TIMER0_BASE, TIMER_A, 10);
TimerControlStall(TIMER0_BASE, TIMER_BOTH, true);
IntEnable(INT_TIMER0A);
TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
IntMasterEnable();
TimerEnable(TIMER0_BASE, TIMER_A);
while (1) {
}
}
void Timer0IntHandler(void)
{
// Clear the timer interrupt
TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
// Read the current state of the GPIO pin and
// write back the opposite state
if(GPIOPinRead(GPIO_PORTF_BASE, GPIO_PIN_2))
{
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0);
}
else
{
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 4);
}
}