Forums

Create SPI interface for ADSP 21065L

Started by Roman Arnet July 22, 2004
Hi
I'm designing a mixer where 4 audio channels are digitized and mixed 
together in an ADSP 21065L. The human interface has got a lot of 
switches and potentiometer to control level, attacktimes ect.
- Im using low cost AD converters (12Bit) with an SPI interface to 
digitize the potentiometer signals.
- A LED driver chip is accessed by SPI as well
- Some preamplifiers are daisy chained by SPI too

What I want do is to decoupelate these components from the DSP by a CPLD 
because of the (rather slow) mentioned peripheral components.


++++++++++
+        +                  �---PREAMP
+  ADSP  +----++++++        �
+        +----+CPLD+------------LED	
+        +----++++++        �
++++++++++                  �---SWITCHES
                             �
                             �---12Bit AD

The DSP accesses the CPLD  by it's data/adress bus. The CPLD sends the 
received data to the rigth component by SPI.

Does anybody have experiance in such a solution?
Maybe there is a better way to do that (I hope so). It would be nice if 
someone would know a already existing chip doing this...
Best regards
Roman
On Thu, 22 Jul 2004 11:24:31 +0200 Roman Arnet wrote:

> What I want do is to decoupelate these components from the DSP by a CPLD > because of the (rather slow) mentioned peripheral components. > > > ++++++++++ > + + �---PREAMP > + ADSP +----++++++ � > + +----+CPLD+------------LED > + +----++++++ � > ++++++++++ �---SWITCHES > � > �---12Bit AD > > The DSP accesses the CPLD by it's data/adress bus. The CPLD sends the > received data to the rigth component by SPI. >
Why don't you want to use a small microcontroller with an internal SPI interface? E.g. Atmel AVR series (ATmega8)? Alexander
Alexander Peter schrieb:
> On Thu, 22 Jul 2004 11:24:31 +0200 Roman Arnet wrote: > > >>What I want do is to decoupelate these components from the DSP by a CPLD >>because of the (rather slow) mentioned peripheral components. >> >> >>++++++++++ >>+ + �---PREAMP >>+ ADSP +----++++++ � >>+ +----+CPLD+------------LED >>+ +----++++++ � >>++++++++++ �---SWITCHES >> � >> �---12Bit AD >> >>The DSP accesses the CPLD by it's data/adress bus. The CPLD sends the >>received data to the rigth component by SPI. >> > > Why don't you want to use a small microcontroller with an internal SPI > interface? E.g. Atmel AVR series (ATmega8)? > > > > Alexander
Actually there were several points which I was considering about: - Communication between ADSP-ATmega8 is not easy to handle - ADSP does not have a SPI port left - How could I access several peripherals with the same SPI interface? I have to generate chip selects by myself. - Price: CPLD costs <2$ - controller >10$ Roman
Am Thu, 22 Jul 2004 13:03:58 +0200 schrieb Roman Arnet:

> Alexander Peter schrieb: >> On Thu, 22 Jul 2004 11:24:31 +0200 Roman Arnet wrote: >> >> >>>What I want do is to decoupelate these components from the DSP by a CPLD >>>because of the (rather slow) mentioned peripheral components. >>> >>> >>>++++++++++ >>>+ + &#2013266086;---PREAMP >>>+ ADSP +----++++++ &#2013266086; >>>+ +----+CPLD+------------LED >>>+ +----++++++ &#2013266086; >>>++++++++++ &#2013266086;---SWITCHES >>> &#2013266086; >>> &#2013266086;---12Bit AD >>> >>>The DSP accesses the CPLD by it's data/adress bus. The CPLD sends the >>>received data to the rigth component by SPI. >>> >> >> Why don't you want to use a small microcontroller with an internal SPI >> interface? E.g. Atmel AVR series (ATmega8)? >> >> >> >> Alexander > > Actually there were several points which I was considering about: > - Communication between ADSP-ATmega8 is not easy to handle > - ADSP does not have a SPI port left > - How could I access several peripherals with the same SPI interface? I > have to generate chip selects by myself. > - Price: CPLD costs <2$ - controller >10$ > > Roman
I don't know where you usually buy your electronics, but the ATmega8 is available for 1.50 to 4 EUR (depends on quantity). The communication between uC and DSP is much more simple than it looks like. I would build a 4-8bit host communication between the ADSP and the ATmega, then i have a free SPI interface on the ATmega. Most of the peripherals can be done without any extra SPI device! The ATmega (or any other suitable uC) contains the desired AD converters for potentiometers, LED outputs, GPIO pins etc. This is the most common way to control a DSP... Alexander
Roman Arnet <user242@hotmail.com> wrote in news:cdo0po$1r3$1
@newshispeed.ch:

> Hi > I'm designing a mixer where 4 audio channels are digitized and mixed > together in an ADSP 21065L. The human interface has got a lot of > switches and potentiometer to control level, attacktimes ect. > - Im using low cost AD converters (12Bit) with an SPI interface to > digitize the potentiometer signals. > - A LED driver chip is accessed by SPI as well > - Some preamplifiers are daisy chained by SPI too > > What I want do is to decoupelate these components from the DSP by a
CPLD
> because of the (rather slow) mentioned peripheral components. > > > ++++++++++ > + + &#2013266086;---PREAMP > + ADSP +----++++++ &#2013266086; > + +----+CPLD+------------LED > + +----++++++ &#2013266086; > ++++++++++ &#2013266086;---SWITCHES > &#2013266086; > &#2013266086;---12Bit AD > > The DSP accesses the CPLD by it's data/adress bus. The CPLD sends the > received data to the rigth component by SPI. > > Does anybody have experiance in such a solution? > Maybe there is a better way to do that (I hope so). It would be nice if > someone would know a already existing chip doing this... > Best regards > Roman
We use the SPI interface for control all the time. Sometimes I implement everything in a PLD but this eats up PLD resources quickly since you need two macrocells for each bit. We also use PIC microcontrollers for expansion. This is a very inexpensive way to expand peripherals in a flexible way. Of course, similiar microcontrollers such as AVR are also good choices. Shameless Plug: Have you looked at our dspstak 21262sx and dspstak I/O modules? The dspstak platform might be a perfect fit for your project. The 21262 is much faster, has more I/O and includes SPI ports. Details at www.danvillesignal.com -- Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- comp.dsp conference July 28 - Aug 1, 2004 details at http://www.danvillesignal.com/index.php?id=compdsp email: compdsp@danvillesignal.com Who says you can't teach an old dog a new DSP trick?
That's quite easy. 

state machine + shift register

Yuri
Roman Arnet wrote:
> Alexander Peter schrieb: > >> On Thu, 22 Jul 2004 11:24:31 +0200 Roman Arnet wrote: >> >> >>> What I want do is to decoupelate these components from the DSP by a >>> CPLD because of the (rather slow) mentioned peripheral components. >>> >>> >>> ++++++++++ >>> + + &#2013266086;---PREAMP >>> + ADSP +----++++++ &#2013266086; >>> + +----+CPLD+------------LED >>> + +----++++++ &#2013266086; >>> ++++++++++ &#2013266086;---SWITCHES >>> &#2013266086; >>> &#2013266086;---12Bit AD >>> >>> The DSP accesses the CPLD by it's data/adress bus. The CPLD sends >>> the received data to the rigth component by SPI. >>> >> >> Why don't you want to use a small microcontroller with an internal SPI >> interface? E.g. Atmel AVR series (ATmega8)? >> >> >> >> Alexander > > > Actually there were several points which I was considering about: > - Communication between ADSP-ATmega8 is not easy to handle
If you have GPIOs it's usually possibly to comeup with some sort of bitbanged interface especially since its for a UI so it doesn't have to be that fast
> - ADSP does not have a SPI port left
You can always do it with GPIOs often its actually simpler than using a SPI interface, when you don't need the speed
> - How could I access several peripherals with the same SPI interface? I > have to generate chip selects by myself.
you often have to do that anyways since many devices accesses which is more than the usual 8bits lots of SPI interfaces support with automatic chipselect it's just a matter of setting and clearing pins before and after the SPI accesses
> - Price: CPLD costs <2$ - controller >10$
there's lots of 8bit MCUs in the <2$ range with both adc converters, key matrix support, enough drive for LEDs, SPI and/or enough GPIOs for bitbanging and chipselects And it will truely offload the UI from the DSP and provide a path for remotecontrol ....
> > Roman
-Lasse
Doing SPI communication directly by GPIO's on the ADSP won't work fine. 
The peripheral devices communicates much slower than the ADSP would do - 
during this process, no signal processing could be done on the ADSP!

The problem is indeed, that I have to send bit's of different 
communication formats to the devices:
Preamplifiers (up to 8)
	send 64 Bit and recive 64Bit at the same time
LED Driver(total 40 LED's)
	send 16 Bit
AD Converter (up to 12 channels &#2013265920; 12Bit)
	send 5Bit and recive 12Bit

I think the best solution is to implement a configurable shift register 
within a CPLD. Data can be written from the ADSP to the CPLD very fast. 
I dont have to take care to the communication speed at all beause the 
CPLD would handle the task (comm. to devices). When the communication 
has been done, the CPLD generates an interrupt which is catched by the 
ADSP. Afterwards new data can be sent or data can be read out from the 
CPLD (AD sample).
I hope I can handle clock deviders and chip select's with the same CPLD 
as well. I don't know jet how many macrocells I will use...

With the aid of this schema I can easely enlarge the system. The CPLD 
could be used for different types of DSP too.

Regards
Roman
Roman Arnet wrote:
> Doing SPI communication directly by GPIO's on the ADSP won't work fine. > The peripheral devices communicates much slower than the ADSP would do - > during this process, no signal processing could be done on the ADSP! >
Sure it can, if communcation is done in the mainloop and the dsp is in interrupts it'll work just fine and thats just one way of doing it, theres lots of way to do "multitasking" even if you don't have an OS
> The problem is indeed, that I have to send bit's of different > communication formats to the devices: > Preamplifiers (up to 8) > send 64 Bit and recive 64Bit at the same time > LED Driver(total 40 LED's) > send 16 Bit > AD Converter (up to 12 channels &#2013265920; 12Bit) > send 5Bit and recive 12Bit > > I think the best solution is to implement a configurable shift register > within a CPLD. Data can be written from the ADSP to the CPLD very fast. > I dont have to take care to the communication speed at all beause the > CPLD would handle the task (comm. to devices). When the communication > has been done, the CPLD generates an interrupt which is catched by the > ADSP. Afterwards new data can be sent or data can be read out from the > CPLD (AD sample). > I hope I can handle clock deviders and chip select's with the same CPLD > as well. I don't know jet how many macrocells I will use...
For the chipselects and dividers a CPLD makes sense, but I'm not convinced about the rest, its too simple to do in SW and I take that as an indication that doing it in HW is not a good idea :)
> > With the aid of this schema I can easely enlarge the system. The CPLD > could be used for different types of DSP too. > > Regards > Roman
-Lasse