Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Microcontroller Interface ??

Status
Not open for further replies.

Infinytus

Member level 2
Joined
Jul 20, 2009
Messages
49
Helped
13
Reputation
26
Reaction score
3
Trophy points
1,288
Location
Bangalore,India
Activity points
1,607
microcontroller interfaces

Hi all,

I need to Interface W6810 PCM voice codec from WINBOND to a MSP430 microcontroller from TI. MSP430F1611 to be precise.

how do u go about interfacing W6810 codec to the MSP430 microcontroller ?

I have the evaluation kit for the codec also.

pls help me.:cry::cry:
 

how to load firmware in cc2400 microcontroller

Infinytus said:
Hi all,
I need to Interface W6810 PCM voice codec from WINBOND to a MSP430 microcontroller from TI. MSP430F1611 to be precise.
how do u go about interfacing W6810 codec to the MSP430 microcontroller ?
use MSP USART as SPI master, connect SCLK to both BCLKT and BCLKR, PCMR -> MOSI, PCMT -> MISO, and one GPIO pin to both FSR and FST to generate frame sync.
 

    Infinytus

    Points: 2
    Helpful Answer Positive Rating
winbond msp430

Hi _PV !


Thank you so much for replying....yes I completely agree that its fair enough to use the 4-wire SPI to interface the codec with the micro. But in my application a radio transceiver (TI's CC2400 chip) is also connected to the micro via SPI. My purpose here is to transmit voice using wireless link. So I need to interface both codec and radio transceiver to the micro. The PCM codec W6810 takes voice input and gives digitized voice to the micro and the micro sends it to the radio via SPI for wireless transmission. Actually the micro uses the SPI to configure the radio and also to send transmission data to the radio. Similarily, the radio uses the SPI it send the received data to the micro. So, MSP is SPI master and CC2400 is SPI slave.

Therefore I need to figure out a way to send the codec data to the micro without the SPI.

So, I was just wondering if we can interface the codec using the unbuffered mode of the microcontroller (MSP430F1611) using their DIO and DCLK pins. If I can manage to get the digitized voice data from the codec, it can be given to the DIO pin of the micro. We also need to connect BCLKR and BCLKT pins of codec to DCLK pin of micro.

will this work out?? :idea:
If not, pls suggest me an alternative.
I need your views on this kind of implementation...:D


pls help me..:cry::cry:
 

msp430f1611 4mhz

Hi Infinytus ,

I think this may help if above constraints are there in your circuit .

Connect your codec with the inbuilt SPI of the microcontroller .

Then code the SPI protocol in the firmware and use IO pins as MISO , clk .., etc Pins ...

Transfer your data to the RF module by the SPI protocol you have created in firmware.

This will be your perfect solution.

Because., Codec is a highspeed device . If your protocol makes any time delay there may be a chance to miss any data . So connect it to the inbuilt SPI .

The RF Module , U can provide the data with some tollerace as you are going to gice the data. So connect it to the I/o lines made as SPI lines(By Firmware protocol)

Regards,
S.Vigneshwaran
 

    Infinytus

    Points: 2
    Helpful Answer Positive Rating
cc2400 module

Hi

vigneshwara_s said:
Connect your codec with the inbuilt SPI of the microcontroller .

Then code the SPI protocol in the firmware and use IO pins as MISO , clk .., etc Pins ...

Transfer your data to the RF module by the SPI protocol you have created in firmware.

This will be your perfect solution.
Thank you for replying. I appreciate that. A really good alternative.

vigneshwara_s said:
Then code the SPI protocol in the firmware and use IO pins as MISO , clk .., etc Pins ...
Yeah I quite get your point, but can u explain me in detail, how do we go about doing this ?

vigneshwara_s said:
The RF Module , U can provide the data with some tollerace as you are going to gice the data. So connect it to the I/o lines made as SPI lines(By Firmware protocol)
Can you please explain about the tolerance for data?
 

Infinytus said:
vigneshwara_s said:
Then code the SPI protocol in the firmware and use IO pins as MISO , clk .., etc Pins ...
Yeah I quite get your point, but can u explain me in detail, how do we go about doing this ?

just set GPIO pins according to spi timing diagram.

something like this:

//if MSB comes first
Code:
u8 SPITransfer(u8 data){
  u8 dataIn = 0;
  u8 cnt = 8;
  while (cnt--){
    SetGPIOPin(PIN_DATAOUT, data & 0x80);
    data <<= 1;
    SetGPIOPin(PIN_CLK, 1);
    SetGPIOPin(PIN_CLK, 0);
    dataIn <<= 1;
    if (GetGPIOPin(PIN_DATAIN)) dataIn += 1;
  }
  return dataIn;
}

Infinytus said:
vigneshwara_s said:
The RF Module , U can provide the data with some tollerace as you are going to gice the data. So connect it to the I/o lines made as SPI lines(By Firmware protocol)
Can you please explain about the tolerance for data?

cc2400 RF module has input buffer for data and you could load it whenever you want without any strict timing requirments on frame sync and even on clock.

But as i know MSP430F1611 has 2 USART ports, whats the problem to use one for RF and other for codec?

Also may be it is possible to use one hardware SPI for both RF and codec, separating access in time.
frame sync of 8Khz and SPI clock of 4MHz means SPI would be busy by codec only for 2 microseconds every 125 microseconds. it means you have more than 100 microseconds to use SPI for communicating CC2400. this time is enough to send mroe that 400 bytes to CC2400, per one received byte from codec.
 

    Infinytus

    Points: 2
    Helpful Answer Positive Rating
Thank you _pv.

_pv said:
frame sync of 8Khz and SPI clock of 4MHz means SPI would be busy by codec only for 2 microseconds every 125 microseconds. it means you have more than 100 microseconds to use SPI for communicating CC2400. this time is enough to send mroe that 400 bytes to CC2400, per one received byte from codec.

Can u pls explain me the logic used to derive the above numbers using frequency?
Pls...pls don mind. I am really new to this thing.

Pls help me..:cry::cry:
 

Infinytus said:
Can u pls explain me the logic used to derive the above numbers using frequency?
Pls...pls don mind. I am really new to this thing.

well, the codec sampling frequency is 8KHz. right?
It means that every 125us new byte could be downloaded/uploaded to codec.
Downloading/uploading speed at BCLKR/BCLKT could be up to 4MHz.
transfering 8 bits using 4MHz clock requires 8/4000000 = 2 microseconds.
And the next byte will arrive only at next 8KHz sync pulse, i.e. after 1/8000 = 125microseconds.
All this time in between, SPI interface could be used to communicate with cc2400.

Also i think it is better to generate frame sync from MSP timer using pwm output.
And also in this timer interrupt start the SPI transfer.
 

    Infinytus

    Points: 2
    Helpful Answer Positive Rating
Hi

You will need to operate the MSP at full speed e.g 8MHz in order to free some processing time

Working at this speed will consum more energy(operating volatge must be higher the 3.6V see DS) - So my advice is not to use the MSP430 since you lose the advantage of low power consumption

You can aslo use the MSP DMA to move data from SPI port to memory - it might save you some proccsing time

All the best

Bobi
 

    Infinytus

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top