Hey everybody,
I am working on evaluating CCSV4, because I change my system to Win7. Therefore I am trying to import my CCSV2.2 projects (with CSL, and Bios 4.9) to CCSV4 and that works now quite fine (see also here and here). Now I tried to debug my old project file on my hardware (C6713), which worked on CCSV2.2 very well.
Unfortunately I have now the problem that it looks like the device does not perform the interrupts. I already checked the registers of the MUXH and the global interrupt flag, which both are set. I added as example my 'Timer1.c' file which use a hardware interrupt as well as a software interrupt afterward, but all other hardware/software interrupts (see picture below) didn't occur as well.
After start of program the dsp runs in the idle functions of bios. So far the CSL settings seems for me to work, because the registers getting set correctly. Did I forgot something else?
Here is the code of the 'Timer1.c':
// Include files ===============================================================
#include <csl.h> //Include Chip Support Library
#include <csl_timer.h> //Include Timer chip support
#include "timer.h"
#include "flash.h"
#include "gpio.h"
#include "c6713cfg.h" //Generated by DSP/BIOS
// Global Variables ============================================================
// Define Timer handle
TIMER_Handle hTimer1; //Handle for Timer1 device
// Configuration Structure for Timer registers -----------------------------
TIMER_Config timerCfg1 = {
// Timer Control Register (CTL)
TIMER_FMKS(CTL, TSTAT, 0) | //Timer status bit
TIMER_FMKS(CTL, INVINP, NO) | //TINP inverter control bit
TIMER_FMKS(CTL, CLKSRC, CPUOVR4) | //Timer clock source
TIMER_FMKS(CTL, CP, CLOCK) | //Set timer to Clock- or Pulse-Mode
TIMER_FMKS(CTL, HLD, YES) | //Counter hold bit
TIMER_FMKS(CTL, GO, NO) | //Timer GO Bit. Resets and starts counter
TIMER_FMKS(CTL, PWID, ONE) | //Pulse width bit
TIMER_FMKS(CTL, DATIN, 1) | //Define TINP to be logic high or low
TIMER_FMKS(CTL, DATOUT, 1) | //Data output bit
TIMER_FMKS(CTL, INVOUT, NO) | //TOUT inverter control bit
TIMER_FMKS(CTL, FUNC, TOUT), //Define function of TOUT
// Timer Period Register (PRD)
TIMER_FMKS(PRD, PRD, OF(0)), //Define timer period
// Timer Count Register (CNT)
TIMER_FMKS(CNT, CNT, OF(0)) //Holds current counter value
};
// initTimer1() ============================================================
void initTimer1(void){
hTimer1 = TIMER_open(TIMER_DEV1, 0); //Open Timer1 device
TIMER_config(hTimer1, &timerCfg1); //Load configuration structure into Timer1
TIMER_setPeriod(hTimer1, TIMER_PRD); //Load PRD register with period time
TIMER_start(hTimer1); //Kick off Timer1
}
// HWI_Timer1() ============================================================
void HWI_Timer1(void){
TIMER_pause(hTimer1); //Pause Timer1
SWI_post(&processTimer1Swi); //Call software interrupt
TIMER_start(hTimer1); //Reset and restart timer
}
/****************************************************************************************************************
* *
* ========= processTimer1() ========== *
* *
* Processing function that gets called out of HWI_Timer1() in Timer1.c, which is called every 125ms *
* after Timer1 generated a hardware interrupt. *
* *
* Furthermore, every 5 seconds the function will check the save2flash flag, that *
* indicates if an important setting that should be saved for next startup has bee changed. If yes, all recent *
* variables needed for audio processing will be stored on flashposition 0x90020000 of the 29LV400 memory. *
* On the next bootup, the DSP will restore these settings by reading out the FLASH at beginning of main(). * *
* *
***************************************************************************************************************/
void processTimer1(void){
static Uint8 pin_toggle = FALSE;
static Uint16 count1 = 0;
static Uint16 count2 = 0;
if (++count1>LED_TIME) { //Toggle 'Still Alive'-LED
count1 = 0;
if (pin_toggle) {
GPIO_pinWrite(hGPIO, GPIO_PIN15, 0);
pin_toggle = FALSE;}
else {
GPIO_pinWrite(hGPIO, GPIO_PIN15, 1);
pin_toggle = TRUE;}
}
if ((++count2>SAVE_TIME)&(save)) { //Save settings to Flash
count2 = 0; save = FALSE;
save_settings();
}
}
I added my *.tcf file as well, maybe there is something I must now activate compared to the old *.cdb file but is not imported correct?
I am happy about any idea regarding that issue. Thanks...
Regards,
Max
P.S: Please rename the *.txt to *.tcf.