Turning on LEDs on the ADSP-21364 EZ-KIT Lite development board in C language
Hi i'm new to programming SHARC DSPs and I have recently acquired an ADSP-21364 EZ-KIT Lite development board for my university project. I'm hoping to do some effects processing later on but for now I'm interesting in getting some LEDs to light up on the board. I was wondering if anyone could talk me through how to achieve this in C language? I've had a look at the example code given in the installation package but some of the code is quite intimidating and i'm having trouble understanding some of it. Thanks Nick.
Audio Signal Processors
coding
led
adsp-21364
SHARC Audio Processors/SoCs
Hi Nicholas.
The EZkit Push Button (C) example is the framework for blinking LEDs. Is this the example you are referring to? I am more of a Blackfin guy but am familiar with SHARC. That said, I am very familiar with initialization code and general GPIO management at the C level, so I cannot identify where you might be having troubles sorting through that code. I will try to give a general overview here:
To blink LEDs via an asynchronous external event (such as via a push-button, as is the case on the eval board), you need to configure interrupts on the core to react when the button is pushed. This requires a couple levels of initialization in the processor. First, you have to enable internal interrupt signals at the core and system levels, which is done by writing to the MODE2 and SYSCTL registers, respectively. You also have to enable interrupt-generation capabilities at the system level in the DAI_IRPTL registers. With the system/core setup to handle interrupts coming from the buttons, you next need to assign your interrupt service routines so that the processor will take specific action when an interrupt is generated...this is done using the interrupt() function, which maps a specific handler to each unique event. Then, you also need to configure the internal signal routing unit (SRU) to multiplex the pins of the package, which requires initialization to enable the push-buttons as inputs and the output drivers to manage the LEDs (done in that series of SRU calls. You can obtain the meanings of all these macros in the sru21363.h header file in the \include directory, but you will also need to consult the Hardware Reference to gain a full understanding of what each call is actually doing under-the-hood. The infinite for loop at the bottom is just the means of making the processor idle while waiting for the push-button interrupts once everything is properly configured (i.e., the application itself does nothing except respond to these interrupts). Finally, the interrupt routines themselves actually change the state of the LEDs by writing the parallel pattern out via a 1-word DMA operation.
If you have specific questions, feel free to respond here or send to processor.support@analog.com, and we'll get you the information you need.
-Joe
Please log in to reply.