Part Number:CC3200MODLAUNCHXL
Tool/software: Linux
Hi, i have a problem with my CC3200 Lauchpad using Energia.
I have defined the timer using the API functions in the /energia-0101E0017/hardware/cc3200/cores/cc3200, and when i want to call a SPI.transfer() or print more than 2 characteres by serial port in the interruption function, the timer doesn't work and stop the lauchpad. This is my code:
#include "inc/hw_ints.h" #include "inc/hw_memmap.h" #include "inc/hw_timer.h" #include "inc/hw_types.h" #include "prcm.h" #include "debug.h" #include "interrupt.h" #include "timer.h" #include <SPI.h> bool ystate = HIGH; void setup() { pinMode(PUSH2,INPUT_PULLUP); pinMode(RED_LED,OUTPUT); pinMode(GREEN_LED,OUTPUT); pinMode(YELLOW_LED,OUTPUT); digitalWrite(RED_LED,LOW); digitalWrite(GREEN_LED,LOW); digitalWrite(YELLOW_LED,LOW); Serial.begin(115200); SPI.begin(); SPI.setClockDivider(SPI_CLOCK_DIV2); SPI.setDataMode(SPI_MODE1); PRCMPeripheralClkEnable(PRCM_TIMERA0, PRCM_RUN_MODE_CLK); PRCMPeripheralReset(PRCM_TIMERA0); TimerConfigure(TIMERA0_BASE,TIMER_CFG_A_PERIODIC); TimerPrescaleSet(TIMERA0_BASE,TIMER_A,0); TimerIntRegister(TIMERA0_BASE,TIMER_A,start); TimerIntEnable(TIMERA0_BASE,TIMER_TIMA_TIMEOUT); TimerLoadSet(TIMERA0_BASE,TIMER_A,20000000); TimerEnable(TIMERA0_BASE,TIMER_A); } void loop() {} void start() { static bool gstate = HIGH; static int count = 0; TimerIntClear(TIMERA0_BASE,TimerIntStatus(TIMERA0_BASE,true)); digitalWrite(GREEN_LED,gstate); gstate = !gstate; count++; if(count == 10){ task(); count = 0; digitalWrite(YELLOW_LED,ystate); ystate = !ystate; } } void task(){ SPI.transfer(16); Serial.print("HELLO WORLDS\n"); }
I appreciate your help !