DSPRelated.com
Forums

LED blinking.... on ADSP-21364 EzKit

Started by mskodacek April 22, 2009
Hi Everybody,

I have an ADSP-21364 EZKIT LITE, And I want to make an Amplitude
(volume) meter application. So low volume signal no led lightning,
hiw volume signal all leds lightning. I want to build it on Talkthru
Analog IN-OUT example. I start to modify SPORTisr.asm, but it doesn't
work and I cant move on. Can someone help me please?

Here is modified SPORTisr from Analog In-Out(asm) from ADSP-21364
examples.
source code I modified... :( but doesn't work. I started with blink
if there is an input signal.
I don't understand how to make correct contidion: if there is low
sound - no led lights,
if there is high
amplitude sound - turn on led.
Hope the explanation what I want is clear.
Thank to everybody who can help me. Martin

//////////// ///////// ///////// ///////// ///////// ///////// ///////// ////////
// Configure the SW9 switch position 6 to OFF to use the LEDs as
Flags.

#include
#define LED_address 0x1400000

.section /pm seg_pmco;
.global _talkThroughISR;

_talkThroughISR:

ustat1=dm(SYSCTL) ; //SYSCTL
bit set ustat1 PPFLGS|FLG0EN| FLG1EN|FLG2EN| FLG3EN;
dm(SYSCTL)=ustat1;
bit set FLAGS FLG8O |FLG9O | FLG10O | FLG11O | FLG12O |
FLG13O | FLG14O | FLG15O;//
nop;
bit clr FLAGS FLG8 |FLG9 | FLG10 | FLG11 | FLG12 | FLG13 |
FLG14 | FLG15;//
nop;nop;nop; nop;

r10=dm(RXSP0A) ; // read new left sample from ADC

dm(TXSP1A)=r10; // write to DAC1
dm(TXSP1B)=r10; // write to DAC2
dm(TXSP2A)=r10; // write to DAC3
dm(TXSP2B)=r10; // write to DAC4

r11 = 0; // this is problem
r11= PASS r10; // this is problem
if eq jump ledlight;

ledlight:
nop;
bit tgl FLAGS FLG8 ;//|FLG9 | FLG10 | FLG11 | FLG12 | FLG13 |
FLG14 | FLG15

rti;
_talkThroughISR. end:
//---------- --------- --------- --------- -------
Howdy Martin,

Without going into the details of your code, the first thing I'd suggest
is not to do anything in the interrupt. Start with talkthru and get that
to work. Then add a compare in the interrupt to set or clear a memory
location to tell your main program that a specific level has been crossed.
Let the main program change the LED based on the flag.

The idea is to isolate actions. It is much easier to debug programs if
each action is in its own routine, and the data that goes to it or comes
from it is only written by one routine. In this case you have several
things you want to do (lots of LED's), so you want to isolate each one.

I can think of many ways to do this - there is no "right way". But the
fundamentals of isolation are the same for every solution. Interrupts
should be fast, and they should tell the main routine it has something to
do. Really try to avoid doing things in interrupts other than deal with
periferals, and then just one at a time.

Patience, persistence, truth,
Dr. mike
On Wed, 22 Apr 2009, mskodacek wrote:

> Hi Everybody,
>
> I have an ADSP-21364 EZKIT LITE, And I want to make an Amplitude
> (volume) meter application. So low volume signal no led lightning,
> hiw volume signal all leds lightning. I want to build it on Talkthru
> Analog IN-OUT example. I start to modify SPORTisr.asm, but it doesn't
> work and I cant move on. Can someone help me please?
>
> Here is modified SPORTisr from Analog In-Out(asm) from ADSP-21364
> examples.
> source code I modified... :( but doesn't work. I started with blink
> if there is an input signal.
> I don't understand how to make correct contidion: if there is low
> sound - no led lights,
> if there is high
> amplitude sound - turn on led.
> Hope the explanation what I want is clear.
> Thank to everybody who can help me. Martin
>
> //////////// ///////// ///////// ///////// ///////// ///////// ///////// ////////
> // Configure the SW9 switch position 6 to OFF to use the LEDs as
> Flags.
>
> #include
> #define LED_address 0x1400000
>
> .section /pm seg_pmco;
> .global _talkThroughISR;
>
> _talkThroughISR:
>
> ustat1=dm(SYSCTL) ; //SYSCTL
> bit set ustat1 PPFLGS|FLG0EN| FLG1EN|FLG2EN| FLG3EN;
> dm(SYSCTL)=ustat1;
> bit set FLAGS FLG8O |FLG9O | FLG10O | FLG11O | FLG12O |
> FLG13O | FLG14O | FLG15O;//
> nop;
> bit clr FLAGS FLG8 |FLG9 | FLG10 | FLG11 | FLG12 | FLG13 |
> FLG14 | FLG15;//
> nop;nop;nop; nop;
>
> r10=dm(RXSP0A) ; // read new left sample from ADC
>
> dm(TXSP1A)=r10; // write to DAC1
> dm(TXSP1B)=r10; // write to DAC2
> dm(TXSP2A)=r10; // write to DAC3
> dm(TXSP2B)=r10; // write to DAC4
>
> r11 = 0; // this is problem
> r11= PASS r10; // this is problem
> if eq jump ledlight;
>
> ledlight:
> nop;
> bit tgl FLAGS FLG8 ;//|FLG9 | FLG10 | FLG11 | FLG12 | FLG13 |
> FLG14 | FLG15
>
> rti;
> _talkThroughISR. end:
> //---------- --------- --------- --------- -------
Hi,
I have the same problem with ADSP-21364. I want to blnk LED1 when i detect the message but, my case is defferent, I use blockprocess in in c-language.
Could anybody have idiea.

Hi Everybody,
>
>I have an ADSP-21364 EZKIT LITE, And I want to make an Amplitude
>(volume) meter application. So low volume signal no led lightning,
>hiw volume signal all leds lightning. I want to build it on Talkthru
>Analog IN-OUT example. I start to modify SPORTisr.asm, but it doesn't
>work and I cant move on. Can someone help me please?
>
>Here is modified SPORTisr from Analog In-Out(asm) from ADSP-21364
>examples.
>source code I modified... :( but doesn't work. I started with blink
>if there is an input signal.
>I don't understand how to make correct contidion: if there is low
>sound - no led lights,
>if there is high
>amplitude sound - turn on led.
>Hope the explanation what I want is clear.
>Thank to everybody who can help me. Martin
>
>//////////// ///////// ///////// ///////// ///////// ///////// ///////// ////////
>// Configure the SW9 switch position 6 to OFF to use the LEDs as
>Flags.
>
>#include
>#define LED_address 0x1400000
>
>.section /pm seg_pmco;
>.global _talkThroughISR;
>
>_talkThroughISR:
>
>ustat1=dm(SYSCTL) ; //SYSCTL
>bit set ustat1 PPFLGS|FLG0EN| FLG1EN|FLG2EN| FLG3EN;
>dm(SYSCTL)=ustat1;
>bit set FLAGS FLG8O |FLG9O | FLG10O | FLG11O | FLG12O |
>FLG13O | FLG14O | FLG15O;//
>nop;
>bit clr FLAGS FLG8 |FLG9 | FLG10 | FLG11 | FLG12 | FLG13 |
>FLG14 | FLG15;//
>nop;nop;nop; nop;
>
>r10=dm(RXSP0A) ; // read new left sample from ADC
>
>dm(TXSP1A)=r10; // write to DAC1
>dm(TXSP1B)=r10; // write to DAC2
>dm(TXSP2A)=r10; // write to DAC3
>dm(TXSP2B)=r10; // write to DAC4
>
>r11 = 0; // this is problem
>r11= PASS r10; // this is problem
>if eq jump ledlight;
>
>ledlight:
>nop;
>bit tgl FLAGS FLG8 ;//|FLG9 | FLG10 | FLG11 | FLG12 | FLG13 |
>FLG14 | FLG15
>
>rti;
>_talkThroughISR. end:
>//---------- --------- --------- --------- -------