Ethernut Home Hardware Firmware Tools Download Community
 
 
Search | Legals | Deutsch

Medianut 2

Medianut 2 is a small MP3 decoder add-on board for Ethernut. After the VS1001K decoder chip used on its predecessor Medianut 1 became obsolete, a new enhanced version 2 had been designed.

Features





Medianut 2 mounted on Ethernut 3



Hardware Documentation

Schematic Sheet 1
MP3 Decoder and audio connectors.

Schematic Sheet 2
CPU, LCD interface and Ethernut extension connector.

Schematic Sheet 3
Power supply.

Medianut 2 Connectors
Lists all signals.

medianut20d.zip
Eagle CAD Files of Medianut 2.0 Rev-D. You can use this as a start point for creating your own hardware. The original design may look a bit overdone for your purpose and could be easily minimized.

Part Function
74LVC244 Used for voltage level translation. It is not required if your host board is 3.3V logic only. However, you also need run the ATmega168 MCU with 3V. Also take care of SPI bus sharing.
ATmega168 Required for LCD and keyboard only. Both may be controlled directly by the Ethernut Board.
LT1616 This switching regulator can be avoided, if you feed the Medianut from the Ethernut's regulated power supply.

Medianuts equipped with the VS1011E (output only, as shown in the picture above) are available at your local Ethernut Distributor or can be ordered directly from www.egnite.de.

Software Support

Support had been added in Nut/OS Beta Release 4.3.2, which is still available in the Archive. This release provides configurable serial peripheral interfaces, which are required for Medianut 2. Earlier Nut/OS releases will not work.

Unfortunately there is a bug in Nut/OS 4.6.2, which makes it impossible to configure Ethernut 3 for Medianut 2. This issue is solved in Release 4.6.3.

A new library module vs10xx.c and an associated header file vs10xx.h had been created, which is compatible to the previous module vs1001k.c. It's not really state-of-the-art, but should allow to run existing applications for the older Medianut 1 on the new board.

Nut/OS Configuration

Nut/OS configuration and building is explained in detail in the Ethernut Software Manual. This chapter will explain the Medianut 2 specific settings only.

Fortunately Nut/OS contains pre-configured configurations for Ethernut 2 and Ethernut 3, which are most often used with Medianut. If you are using Ethernut 1, please follow the configuration for Ethernut 2.

The SPI settings will be specified first. Medianut 2 has two SPI devices, one is the MP3 decoder and the second one is the ATmega168 MCU.

On Ethernut 2, SPI is implemented in hardware. We will configure the first three chip selects, for the Ethernut 2 on-board Dataflash and the two Medianut devices.

CS Ethernut 2 SPPI0 Device Port
0 Ethernut 2 Serial Dataflash PB4
1 Medianut 2 VS1011E MP3 Decoder PB0
2 Medianut 2 ATmega168 MCU PD7
3 Not used  

Furthermore, PB4 and PD4 will be used to reset the MP3 decoder and the Medianut MCU resp. The following screen shot shows the required SPI configuration for Ethernut 2. You will find the settings in the Configurator's component tree below
Architecture -> AVR -> Polled SPI.


The same configuration will work with Ethernut 1, though chips select 0 is not used because this board has no Dataflash Memory.

Ethernut 3 doesn't provide a hardware SPI. We could have implemented one in the CPLD, but the ARM7 CPU is probably fast enough for doing software SPI, also known as bit banging. We will configure the chip selects for the first two devices of SPI 0.

CS Ethernut 3 SBBI0 Device Port
0 Medianut 2 VS1011E MP3 Decoder P0
1 Medianut 2 ATmega168 MCU P18
2 Not used  
3 Not used  

For resetting the decoder and the ATmega168 we choose port bits P6 and P23 resp. Last not least, P1 (SCK), P2 (MOSI) and P3 (MISO) are used for the SPI implementation. The related settings in the Configurator's component tree are below
Device Drivers -> Serial Bit Banged Interface 0.


In Nut/OS 4.7 and later this looks more tidy.


After having done the general SPI configuration, we are ready to specify the decoder settings. They are available below
Device Drivers -> VS10XX Audio Decoder.

The following screen shot shows the configuration for Ethernut 2.


The configuration for Ethernut 3 is only slightly different.


Here's a screenshot from Nut/OS 4.7.


We are almost done with the configuration. The last part is the interface to the ATmega168. Actually, everything had been specified already during SPI configuration. However, the Ethernut Board will also be able to upload the firmware into the ATmega168 program memory by using the AvrTarget API (which is new in Nut/OS 4.3.2). This module is not quite smart yet. For example, we need to specify the target's Flash Page Size.

The related settings are the same for all Ethernut Boards and can be found below
Device Drivers -> AVR Serial Programming.


If most items are grayed out, you need to edit conf/dev/dev.nut near line 1960. Remove the line containing

requires = { "HW_MCU_AVR" },

below the macro definition

macro = "AVRTARGET_SPI0_DEVICE",

After properly configuring all parts, build the Nut/OS libraries and create an application tree as described in the Ethernut Software Manual.

Creating an MP3 Application

For many developers the most interesting project will be the Internet Radio. This link is a bit outdated, but should work with our new Medianut as well. Just two important changes must be considered.

  1. The MCU on Medianut 2 needs to be loaded with the proper firmware in order to get an LCD or keyboard running.

  2. Due to its compatibility with the vs1001k module, the new vs10xx driver can't coexist in the same library. You need to add a copy of nut/dev/vs10xx.c in your application directory and add this file to your application's Makefile.

More...

I'm aware, that this page leaves you in the dark, if you are a complete newbie. We will add more information soon. In the meantime you may try one of the ready-to-use samples. Copy them to the application directory which you created with the Nut/OS Configurator.

enut21b-media2vs10xx.zip
Plays three simple MP3 files located in the UROM file system. Also contains the Medianut 2 MCU firmware and all required routines to burn it into the device. The binaries for Ethernut 2 are included. For Ethernut 1 you can create them with make clean followed by make install or make burn.

enut30e-media2vs10xx.zip
Like enut21b-media2vs10xx.zip, but pre-build for Ethernut 3.

enut30e-musicbox.zip
Plays all MP3 files found in the root directory of the MultiMedia or SD Card inserted into the Ethernut 3 card socket.