Designed by: Vassilis Serasidis on 5 September 2015
Published on: 17 September 2015
Main web page: WIZwiki-W7500 WebRadio player
Programming language: C++
IDE: mbed
Target MCU: WIZwiki-W7500 board
Extra used hardware: VS1053 MP3 decoder
Introduction
On 31 August 2015 I got the new WIZnet platform board, the WIZwiki-W7500 that is based on a Cortex-M0 cpu at 48MHz with 128 kBytes of flash memory and 48 kBytes of RAM shared with the hardwired TCP/IP core. The RAM amount used by the TCP/IP core can be upto 32 kBytes leaving the rest 16 kBytes to the user (32 + 16 = 48 kBytes of RAM). The W7500 is a 3.3V device but according to the WIZnet the board's I/O pins are 5V tolerate. Moreover, the board has the same pinout with the Arduino UNO. Combining this board with a VS1053 mp3 decoder board you can build a very nice Icecast Internet streams player (WebRadio player) that can plays internet audio streams upto 320 kbits/second (320 kbps). Of course the limited RAM on W7500 receiver side (16 kBytes) is not enough to cover big data delays between your internet connection gateway (your ADSL router) and the Icecast server.
The circuit
The circuit is very simple and combines only two boards. The WIZwiki-W7500 (W7500 for short) and the VS1053 mp3 decoder module. The W7500 board makes a connection to the Icecast server, requests the audio data stream and sends the received data to the the VS1053 module for decoding. The VS1053 module, receives the data stream from the W7500 and auto-recognize the audio data format. It recognizes if the data stream is midi or wav or mp3 or aac file format and decodes it. The user can listen to the music stream over the VS1053 audio jack that leads the head phones. The circuit is powered with 5V DC from the USB port of the W7500 board. The W7500 ethernet connector is connected to the ADSL router or to any ethernet device that can provide Internet connection (router, hub, switch). The connection diagram is based on a real boards photo for being recognized from any person that wants to build the circuit but he doesn`t have any experience in electronic circuit schematic diagrams. Just connect the two end points accross every colored line by following the picture 1 connection digram.
The circuit does not contain any LCD screen for hardware simplicity. Instead of printing the information on LCD, the WebRadio station information is printed on the USB_Serial port that provides the W7500 board. Just connect the W7500 USB port to your computer, install the drivers and open your favorite Serial Terminal. In my case, I used the Termite v3.1 with settings 115200 bps.
The source code
The source code has been written in mbed online compiler and the programming language is used is C++. There are many comments on the source code to help you understand the meaning of almost every line of the source code.
The mbed has a VS1053 library that was written by Kaoru Onoe and has been modified from me (Vassilis Serasidis) for supporting the W7500 board and adding a patch [ modeSwitch() function] for some LC-Technology VS1053 board that have some chip pins disconnected. Without that patch there is no sound out of these VS1053 modules.
The Ethernet library (WIZnetInterface) is provided by WIZnet and can be found in mbed libraries. To that library you have to change the default settings of 8 Sockets, 2 kBytes Transmitter and 2 kBytes receiver buffer for each socket. The settings we want are: Only one socket with 16 kBytes transmitter and 16 kBytes receiver buffer. These settings can be changed by editing the file:
WIZnetInterface/arch/int/W7500x_toe.cpp
Before
/* * set RX and TX buffer size * for (int socket = 0; socket < MAX_SOCK_NUM; socket++) { * sreg<uint8_t>(socket, Sn_RXBUF_SIZE, 2); * sreg<uint8_t>(socket, Sn_TXBUF_SIZE, 2); * } */
After
/* * set RX and TX buffer size * for (int socket = 0; socket < MAX_SOCK_NUM; socket++) { * sreg<uint8_t>(socket, Sn_RXBUF_SIZE, 2); * sreg<uint8_t>(socket, Sn_TXBUF_SIZE, 2); * } */ /** * Use only one socket with 16 kBytes of RAM for Tx and 16 kBytes of RAM for Rx */ sreg<uint8_t>(0, Sn_RXBUF_SIZE, 16); //Vassilis Serasidis sreg<uint8_t>(0, Sn_TXBUF_SIZE, 16); //Vassilis Serasidis
Created and published by Vassilis Serasidis on 17 September 2015
Comments