Talking to Peripheral Hardware
-- In order to talk to peripheral hardware,
-- you must perform the following initializations.
-- (lab4 of c60001day shows how this is done)
1) System Initialization
1a) call CSL_Init();
1b) call BSL_init(); // watch case! :-(
2) Codec Initialization
2a) codec_init();
codec initialization involves (see lab 4)
opening the hardware to obtain a handle
resetting the codec using the handle
configuring the codec using the handle and parameter structure
the AD535 codec is programmed through the BSL API
this approach should be duplicated for the
MULTI-CNVTR_EVM daughter board,
and specifically the TLC2551 12-Bit, 4000 kSPS ADC.
talk to TI about this.
3) Hardware Interrupt Initialization
3a) IRQ_Map(IRQ_EVT_XINT0, 9); // tie MacBSP transmit interrupt to HW interrupt
9
3b) IRQ_Enable(IRQ_EVT_XINT0); // for the specific interrupt enable register
(IER)
3c) HWI_enable() ; // for the global master switch control register (CSR)
Additional interrupts can be handled using pairs of IRQ_Maps and IRQ_Enables
-------- OTHER APPLICATION NOTES
-- from bsl_suggestions.h:
/***************************************************\
* When writing to the AD535 codec, the LSB of the
* 16-bit data output sample is used to initiate
* a command to the codec. That is, if the LSB
* is 1, then the next 16-bit value written to
* the codec will be a codec command (as opposed
* to data to be converted by the DAC).
*
* The codec commands are used to set its
* control registers. These registers are used
* for setting the input and output gains,
* among other things.
*
* When the DSP is halted during emulation for
* breakpoints and such, the McBSP normally also
* halted. Unfortunately, this means the data
* stream from the McBSP to the codec is halted.
* Since the McBSP0 data transmit line (DX0) is
* not being driven, it is allowed to float.
* While this is nice feature in production, it
* isn't desirable during development. In the
* case of the DSK, the DX0 pin will often float
* to 1. If it floats to 1 when the AD535 is
* expecting the LSB command bit, the codec will
* often cease to function as expected. Usually,
* the only way to recover from this is to close
* the debugger (CCS) and remove power-cycle the
* DSK.
*
* The McBSP contains a yet-to-be documented FREE
* bit (bit 25). The next revision of the 'C6000
* Peripherals Guide should describe this bit.
* OR'ing the McBSP SPCR (serial port control
* register) with 0x200_0000 sets the FREE bit.
\***************************************************/