Main Site Documentation

How to control SPI using PD8 pin on FEZ Cerbuino


#1

Hi,

I try to control Yamaha NSX-1 chip(Vocaloid Chip:http://jp.yamaha.com/news_release/2013/13102301.html) by FEZ Cerbuino. This board can be connected to FEZ Cerbuino via Arduino shield (http://jp.yamaha.com/news_release/2013/13102301.html).
NSX-1 chip can be played by sending MIDI file via PD8 pin as SPI.

But I don’t know how to write code to send byte data stream via PD8 by SPI.
Any suggestion is welcome.

Regards


#2

Quoted so your links appear.


#3

Checkout the catalogue and find a module that is spi based and look through it’s code… i think the music module is SPI based…
Also checkout the docs on SPI, and codeshare… the search is located at the top of the forum.


#4

The code to initialize SPI port on PD8 pin is like following, isn’t it?

SPI.Configuration config = new SPI.Configuration(GHI.Hardware.FEZCerb.Pin.PD8, …, SPI.SPI_module.SPI1);
SPI spi = new SPI(config);

If so, I have 2 questions.

1)Which SPI_module should I select for last parameter of SPI constructor.
2)How to specify Rate_KHelz parameter 31.25 KHz. 31.25KHz is MIDI’s baud rate.


#5

Have you used SPI in any of your other projects? If you take a look at the SPI general page, https://www.ghielectronics.com/docs/14/spi you need to know more about SPI than you have shared with us.

For a start, you need to understand SPI uses as a minimum 4 pins, a Chip Select pin (CS), and three “bus” pins, the CLK, MOSI, and MISO pins. The constructor example you show above uses PD8 as the CS pin, and the CLK/MOSI/MISO pins are from SPI1.

The press releases you link to http://jp.yamaha.com/news_release/2013/13102301.html do not appear to show how this chip would be connected, and as my Japanese skills are very weak I can’t see if that’s detailed in the release or the PDF from that site. We also don’t know whether you have this on an Arduino shield or if you have it on a board you’ve created. Ultimately you need to get the connections sorted out by knowing, not guessing, which pin on the Cerbuino is connected to the SPI port on the Yamaha chip - without that, anything else is likely to be shooting in the dark.

Do you know if there are English equivalents to the data sheet for this chip?