Wiznet makers

chcbaram

Published July 20, 2023 © MIT license (MIT)

0 UCC

0 VAR

2 Contests

0 Followers

0 Following

WIZNET-IOT-SPEAKER

W5300 칩을 사용하여 네트웍으로 사운드 데이터를 실시간으로 전달해서 스피커로 출력을 하고 IoT 제어를 위한 기능을 포함한 시스템이다.

COMPONENTS Hardware components

WIZnet - W5300

x 1


PROJECT DESCRIPTION

Overview 

  • WIZnet's W5300 chip is a hardware TCP/IP chip that supports a 16-bit bus and can transmit and receive data at high speed. Therefore, the WIZ-IOT-SPEAKER project takes full advantage of these features and uses the W5300 chip to transmit audio data as streaming on a PC for playback.

 

Project Goals

  • This is what you get at the end of the project so you can at least move on.
    • A system that uses the W5300 chip to transmit sound data to the network in real time and output it to the speaker.
    • Design and build  boards using the W5300 and MCUs
    • Write circuit designs, artwork, firmware, and complete PC programs

 

Requirements

  • Organize the requirements to achieve the goal and define and schedule detailed tasks based on them.
    • Utilize the high-speed characteristics of the W5300 chip.
    • Be able to deliver audio data in real time.
    • It should be able to output data from the network to the speaker.
    • It should be possible to check necessary information such as IP using an information display device such as an LCD.
    • Build own board and share the data.
    • Audio data can be sent from a PC or to the same board.
    • The development environment must be multiplatform. (Windows/Mac/Linux)
    • W5300 Control reads datasheets and uses registers to build libraries by hand.

 

Considerations

  • As you progress through the project, feel free to draw out and reflect on things to consider.
    • I make my own boards and enjoy the process.
    • Create additional I/O on the board beyond the basic functions so that it can be utilized as a development board.
    • How do you want to send audio data from the PC?
    • If you're creating a PC program, should it be a GUI?
    • Do I need a microphone sensor, and if so, should I mount it on the board?
    • Can we send video data as well?
    • Could you send motion data to control a remote robot?

 

Development Environments

Hardware

  • Schematic and Artwork Online with EasyEDA
  • SMT directly through JLCPCB

Firmware

  • Build Environments
    • CMake, GCC, Make
  • Editing Tools
    • Visual Studio Code
  • Libraries
    • STM32CubeH7
      • MCU library provided by ST
    • LittleFS
      • File system for embedded with failsafe features
    • LVGL
      • Free GUI library for embedded use
    • WIZnet ioLibrary_Driver
      • dhcp, sntp, socket
  • MCU code generator
    • STM32CubeMX

Software

  • PySide6
    • A Python version of Qt6
  • MinGW GCC
    • For creating PC programs to update firmware

 

Basic Specifications

Specifications

ItemItem nameSpecification Remarks 
MCUSTM32H723ZGT6FLASH : 1MB, SRAM : 564KBExternal SRAM bus 16-bit
Ext. FLASHW25Q128JVSIQTR16MBytesFor firmware updates, data storage
NetworkW5300 16bit bus
Audio H/W #1MAX98357AI2S Codec/AMPConnect to Speakers
Audio H/W #2ES8156I2S CodecConnect to AMP 
Buzzer   
LCD1.3인치 IPS240x240https://ko.aliexpress.com/item/33021695448.html

Block Diagram

 

Progress Calendar

  • Derive action items

  • Task scheduling

 

Hardware Results

  • The board consists of two boards, the main board contains the MCU including the W5300 chip and the audio output function, and the extended IO connector implements functions such as LCD and rotary encoder.

Build Board

  • Main Board
    • Designing on four levels to reduce board size and increase artwork convenience
    • Circuit design and artwork

  • I/O Board
    • Circuit design and artwork

 

Assembling the Board

  • Main Board + I/O Board

  • Assembling a 3D Cube

 

Firmware Results

  • Memory Map
    • Separate the bootloader and firmware areas and securely update the firmware via external memory.
    • Apply the LittleFS PySystem to external memory to manage parameter storage.

  • Communication Packet Structure
    • When communicating with a PC, communication packets are defined for data exchange, and commands and data are delivered through them.
  • Bootloader Commands

  • Audio Streaming Commands

 

  • Safe Firmware Update Structure
    • The firmware update is designed to utilize additional memory to ensure that it can be recovered or not affected if something goes wrong in the middle.
    • Update Process
      • Download the firmware from the PC to the external memory.
      • The bootloader updates the firmware by copying the firmware from the external flash memory to the internal flash memory.
      • Run the updated firmware.
  • Firmware Update over UDP
    • The communication driver structure allows the firmware to be updated equally over UART and UDP.
    • UDP Update Log
    • The progress of the update is displayed on the LCD.
  • Audio Output Structure
    • Use a double buffering structure and DMA to ensure uninterrupted audio output.
  • Streaming Audio
    • Receives audio data blocks from the PC and buffers them before outputting the audio.

 

Software Results

  • Downloader Program
    • A PC program written in C++ that allows firmware updates over UART or UDP and tests audio streaming.

  • Audio Streaming GUI
    • It is a GUI program using PySide6 and transmits audio data to the WIZ-IOT-SPEAKER board in real time through socket communication.

 

Demo Video

Show audio spectrum

 

Update UDP Firmware

 

Audio streaming and OSD volume control

 

Configuring a GIT repository

  • Firmware
    • STM32CubeMX Project
    • Bootloader
    • Firmware

  • Hardware
    • Schematic, Gerber files, BOM

  • Software
    • PC Download Program
    • GUI Program

 

Youtube videos

 

Blog posts

 

In closing...

For the past three months, I've been working on artwork all night, and it was not easy to proceed from project planning to hardware, firmware, and software, but by working together, I was able to implement the interconnected parts faster than I thought, and I think I experienced a lot of things, such as socket communication using Wiznet's W5300.

The project ends here, but we will continue to add features with this hardware. For reference, I think there are many things that can be done, such as updating the firmware with the GUI or interlocking with Home Assistant using MQTT.

Finally, I would like to thank everyone who has been interested in the project and provided feedback.

Documents
  • wiznet-iot-speaker-boot

    wiznet-iot-speaker 보드의 부트로더 펌웨어

  • wiznet-iot-speaker-fw

    wiznet-iot-speaker 보드의 메인 펌웨어

  • wiznet-iot-loader

    펌웨어 다운로드 및 테스트를 위한 PC 프로그램

  • wiznet-iot-speaker

    PC용 GUI 프로그램

  • MAIN B/D

    MAIN B/D 회로도

  • IO B/D

    IO B/D 회로도

Comments Write