PDA

View Full Version : Using the HOME0 pin on a DSP-0803-MINI


Jonnhybob
07-23-02, 03:58 PM
Hi everyone !

I'm trying to use the HOME0 pin on a DSP-0803-MINI as an input clock for the timer A0.
Unfortunately, even my simplest code (shown below) does not seem to work.

Everythng works fine, however, if I use INDEX0 instead of HOME0 as input. I first thought my DSP HOME0 pin was broken, but I tested my code on two different DSP-0803-MINI and it does not work.

Is there a register to modify or something special to do to enable the HOME0 pin ?

/*-----------------------------------------------------------------------*
Program : main.c
(using codewarrior)

Use Home0 as primary source for TimerA0
(use codewarrior debugger to look at the counter through the variable POSITION)

Latest Update : 23/07/02
Stéphane Dominique
*-----------------------------------------------------------------------*/

#define TMRA0_CTRL (short *)0x0d06 //Timer Control Register
#define TMRA0_CNTR (short *)0x0d05 //Timer Counter

unsigned POSITION;

void main(void)
{
// Count rising edge
// A0 primary source is input pin#3 = home0
// if you replace the input by index0 (*TMRA0_CTRL = 0x2400), everything works fine

*TMRA0_CTRL = 0x2600;

while(1)
{
POSITION = *TMRA0_CNTR; //use debugger to see the global variable POSITION
}
}