Jun 21, 2010 2:40 PM
n00b question (starting the main loop)
-
Like (0)
I've been trying to figure out what is going on with the filter example, and just make the LED's blink. The problem I am seeing is that the main "LOOP" subroutine is not being called if I take out the interrupt code (everything below the main loop) and make the vectors4.inc file only JMP to the main loop. To make it more succinct, how/where/when is the vectors subroutine being called in vectors4.inc?
let me know if you guys need any more info
I'm not sure I quite follow what you're trying to do but without the interrupt code you'll find very little works. The GUI debug variables and the audio in/out functionality are both interrupt-driven.
I'm realizing my ASM is rustier than I originally believed compounded by the fact that I don't have a good understanding of what is going on with the various chips in the system as far as manipulating them programmatically.
I want to do a bit of "hello world" type code by just manipulating the LED and then do simple things like changing the volume...adding simple LFO type filters...etc.
I wrote a walkthru of the example code a while back, you may find it useful:
http://www.tcddk.com/wiki/index.php?title=GettingStarted
I suggest putting tweaks in the RX "even" ISR. The main loop is really just an idle loop.
If you want to turn the TwoBandStereoEQ example into a "hello world" without actually digging through the interrupt code, here is where the audio processing happens within the interrupt handler (in main.asm):
;Process Left Channel (left input sample is in a)
move #>Switch_1,r6 ; point to x:mem (switch states)
move #>Filter_1_K,r4 ; point to x:mem (coefficients)
move #>Filter_1_A_Left,r3 ; point to y:mem (filter mem)
bsr TwoBand_EQ ; input in a, output in a
move a,y:LeftOutput
;Process Right Channel (r6 is currently pointing to Switch 1)
move y:RightInput,a ; load right input sample in a
move #>Filter_1_K,r4 ; point to x:mem (coefficients)
move #>Filter_1_A_Right,r3 ; point to y:mem (filter mem)
bsr TwoBand_EQ ; input in a, output in a
move a,y:RightOutput
The simplest pass-through example is to replace the above code with:
;Process Left Channel
move y:LeftInput,a
nop ; replace with left audio processing
move a,y:LeftOutput
;Process Right Channel
move y:RightInput,a
nop ; replace with right audio processing
move a,y:RightOutput
ahh helpful stuff, I guess I eventually want to be able to develop my own effects "from scratch" so to speak and figured I'd learn about what is going on exactly in the kit...
I'm just not getting how the
ahh helpful stuff, I guess I eventually want to be able to develop my own effects "from scratch" so to speak and figured I'd learn about what is going on exactly in the kit...
I'm just not getting how the vector table (vectors4.inc) is being utilized. Does it just go to whatever is in p memory first?
To really understand what's going on, you should download the DSP56300 Family Manual. Section 2.3.2 "Exception Processing State (Interrupt Processing)" of the DSP56300 Family Manual describes the interrupt vectors, and chapter 11 describes the startup procedure and memory map. Table 2-2 on page 2-7 (35 of 512 in the PDF) corresponds to vectors4.inc.
Does it just go to whatever is in p memory first?
Essentially, yes. The hardware reset vector is the first entry in the vector table and the vector table is at p:0. In your first message you mentioned jumping to the main loop. If you set the reset vector to jump to LOOP (instead of START), I think you'd be skipping the code that sets up the SHI communication with the microcontroller. The microcontroller is what controls the LED, so you wouldn't see anything happen. One other trick is that turning on LED_Red in the DSP code will only cause the LED to glow faintly, so if that's what you are doing to test your code, you won't see what you expect. Here is a workaround for that:
http://uk.line6.com/supportarchive/thread/45045
What I would suggest is starting from the TwoBandStereoEQ just to explore, since you can start with a working example and tweak one thing at a time. You could first manipulate the LED in the sample processing code, then move it to the main LOOP, then get rid of the sample processing code, disable ESAI interrupts, then start commenting out initialization code in the START section until you get to the bare minimum. At that point you'll know enough to build up your own code from scratch.
Thanks RedPandaCurt, I had found those passages before, but for some reason documents of that level of technical jargon always leave me thinking "okay...and then what?" I was actually thinking of doing something close to what you said in your previous post, probably best to just to do something that involves manipulating the sound and then go from there. Thanks
Stay in the mix and in the know.
Latest offers, special deals and insider updates.