AVR - DSP communication

Thread Starter

Chillian

Joined Mar 24, 2023
8
Hello, I have an university project that consists of two microcontrollers, an adsp2181 and an avr, both integrated on the Ez-kit Lite board. My job is to program the avr to receive a pulse waveform from the dsp, count the number of rising edges and display it. The problem is that I don’t know how they should communicate. I have read articles about I2C and SPI, but they had two identical microcontrollers communicating with each other, whereas I have two completely different ones. Can someone please give me some kind of advice? I would kindly appreciate it, thank you!
 

Papabravo

Joined Feb 24, 2006
21,225
The easiest thing to do would be to examine the datasheets to see if they have common peripherals. If they do, then that should be the easiest method. If they do not you can roll your own using parallel registers or serial shift registers.

A quick look at the datasheet reveals the ADSP2181 has two (count 'em two) serial ports. That is definitely the way to go. Most models from the ATmega series have multiple serial ports so that would be my first choice. If it is an ATtiny then you might be SOL.
 
Last edited:

DickCappels

Joined Aug 21, 2008
10,171
If all you have to do is count pulses, where does the requirement for communications beyond counting pulses come in?

If using a controller with a UART (or USART in the case of some AVR controllers) follow the datasheet example for sending and receiving data. It is mainly a matter of setting up the UART for a specific baud rate, which is usually only done when starting up the system, then whenever you want to send data load it into the transmit buffer and initiate the transmission per the datasheet. A status bit will be set when the transmission is complete.

At the receiving end, a status bit will be set when data is received and optionally an interrupt triggered by the event. The it is just a matter or looking in received data register and collecting the data. You may need to invent your own firmware level protocol to establish context for the data being passed around.

Edit: removed links to irrelevant examples.
 
Last edited:
Top