Wer hat Erfahrung mit DSP?

Gast #203808
Lesenswert?

Hi Leute,

ich steh voll auf dem Schlauch.
Wer hat ma mit DSP´s geschaft und kann mir helfen eine Applikation
hinzubekommen?

Das Problem ist eigentlich einfach:
ein Timer generiert jede 1ms ein Interrupt, dabei startet ein
AD-Wandler und ein 2. Timer.

Hier die Registereinstellungen:

#include "regs2407.h"
asm (" setc INTM"); /*Disable all interrupts  */
WSGR=0x0000; /* set the external waitstates WSGR */
WDCR=0x6F; /* Initialize Watchdog-timer   */
SCSR1=0x06DC; /* Initialize SCSR1     */
MCRA   = 0x1000;     /* Turn on T1PWM   */
T1CON   = 0x8142;    /* Turn off GPT1   */
GPTCONA |= 0x0A41;   /* Active low. PR starts ADC */
T1PR    = 5000;      /* Sample at 1 kHz   */
T1CMPR  = 5000/4;    /* Duty = 25%     */
T1CNT   = 0xFFFE;    /* Set to -2     */
T1CON   = 0x9142;    /* Start timer 1   */
EVAIMRA=0xFFFF;    /* enable T1 overflow IR*/
EVAIFRA=0xFFFF;    /* clear all flags  */
asm (" clrc INTM"); /*Enable all interrupts  */
  while(1){
  }
}
void c_int2()  // ISR for Timer 1
{
if (EVAIFRA==0x0400){  //OverFlow flag Timer 1
   EVAIFRA=0x0400;    // clear flag
   T2CON=0xD7C1;    // start T2 f=1MHz
   }
}

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren