TFT HiFiDuino Code

This is the home page for the TFT HiFiDuino Project.

Version 2:


Version 1:

Here you will find the latest available version of the code, along with the revision history and some notes on the code. This entire project is based on the HiFiDuino project. Had there not been for HiFiDuino, none of this would have been possible.

The current version of the code (v2.13):  TFT_HiFiDuino_v2.xx (12302 downloads )

Here is a features list:

  • Enable full control over the parameters of the ES9018 chip.
  • Full IR remote control functionality. Supports a large range of remote manufacturers.
  • Switch between all 8 of the supported s/pdif inputs, as well as between I2S sources (2 x USB in the current version).
  • Save parameter settings for each input.
  • Display incoming signal sampling rate and type.
  • Minimal display mode as default. Goes into full display when changes are to be made to parameters.
  • Full graphics support in the minimal display.
  • Option of displaying white text & graphics on black background as well as the familiar “v2” look.
  • Option to set 0db as default (power-on) volume for connection to a preamp.
  • Remote power on/off functionality (or always on – configurable in the code).
  • Compatible with Buffalo 3 and Buffalo 3 SE (plus the 32s and the Buffalo II). Just comment out the relevant statement.

Here is a short video of the code in action:

Software Requirements:

Basic Hardware Requirements:

  • Arduino Due
  • 3.2″ TFT with resolution of 240 x 400, compatible with the UTFT library
  • 24LC256 EEPROM chip
  • Rotary Encoder
  • IR Receiver
  • Compatible IR remote control (Apple Remote or other)

I am including the necessary fonts and bitmaps in the ZIP. The fonts should go into your UTFT & UTFT_DLB directories, usually found in the Windows user’s Documents folders (for example, here: c:\Users\<user name>\Documents\Arduino\libraries\UTFT_DLB\).

The bitmaps should go into your sketch’s folder.

I have included in several places in the code SerialUSB output for debugging purposes. It is commented out in this release for performance purposes. However, it is very easy to re-enable for either debugging or viewing of the IR codes sent to the Arduino. You may use these IR codes to customize the code to support your remote by changing the relevant #define statements in the Remote control definitions section.

You should keep in mind that this code is designed to be used with the shield that I have developed for this purpose. The shield has its own page: Universal Signal Isolator Shield

However, the shield is not necessary if you are willing to hardwire in a few necessary components, like the 24LC256 EEPROM chip.

Here is the revision history:

v2.13 23/08/15:

  • Added support for white text on black background. Added the necessary graphics.
  • Changed the rotary encoder code. Now it works exactly as it should.

v2.01 02/01/15:

  • Bugfixes (Exact SR not displaying, SR redrawing every 2 sec).

v2.00 31/12/14:

  • Official release of v2 code!
  • New graphics in limited display mode. Code size is now definitely over 256KB.

v1.20 22/12/14 :

  • !! Very ALPHA !! now defaults to a limited display. Goes into full display when changes are made to parameters.
  • Outputs debugging data to SerialUSB (optional – usualy commented out).
  • Sidecar signalling changed from LOW->HIGH for B3 to support new switching circuit.

v1.14 28/11/14:

  • Changed IR code to IRremote library. Now supports a lot more remote controls.
  • Beta support for proportional fonts via UTFT_DLB library (add-on to UTFT).

v1.08 19/11/14:

  • Added code to use MCP23008 to control misc devices.
  • Added option to set 0db as default (power-on) volume.

v1.06 01/12/13:

  • Compatible with Buffalo 3 and Buffalo 3 SE. Just comment out the relevant statement.
  • Fixed “OS Filt” & “SR disp”.. They were not working correctly.
  • Blue select boxes are gone.. they looked quite bad.
  • Some other minor (mainly aesthetic) fixes.

v1.03 30/11/13:

  • Buffalo IIISE edition. Just 3 inputs: S/PDIF + 2xUSB.

v1.00 03/09/13:

  • Finished with aesthetics (new fonts, selection grid, etc). First official release.

v0.96 25/03/13:

  • Changed all pins so as to be compatible with the new Buffalo Shield.

v0.95 25/02/13:

  • Added IR codes for select, left, right. Everything now works on MEGA & Due! Display still buggy (no functional problems though).

v0.93 17/02/13:

  • Changed the rot encoder code. Should be compatible with Due & Mega but only works on the MEGA for the time being.

v0.91g 22/12/12:

  • Added code to support rotary encoder on Due & added relevant option for selecting either MEGA or Due board (!! still not working!!).
  • Fixed s/pdif frequency display.

v0.9 13/12/12:

  • Fixed bug in volume control code. Now works as it is supposed to. 🙂
  • Remote works very well.
  • To do: TFT backlight control.

v.0.8.8 10/12/12:

  • Powerup and shutdown routines added (still need to configure IR code for power).
  • Aesthetic changes.

v.0.8.7 09/12/12:

  • Adapted most of HiFiDuino’s enhancements to the code. Display is buggy.

v.0.8.6 08/12/12:

  • Now saves settings into 24LC256 EEPROM instead of built-in EEPROM (beta, seems to be working OK).

v.0.8.5 07/12/12:

  • Addition of USB input (9th). To do: set as default input.
  • Now fully tested with I2S sources.

v.0.8.4 15/08/12:

  • Code cleanup, reordering of functions, etc.

v.0.8 28/04/12:

  • Now supports 240×400 instead of 240×320 TFT.

v.0.7 16/04/12:

  • Major revision. Now supports UTFT library for 240×320 TFT.

v.0.51 11/03/12:

  • Contains a few minor bugs but for the most part works.
  • Includes support of source selection on Buffalo III boards.
  • The Apple remote codes are changed to another device’s that I had handy.
  • Has not been tested with I2S sources.

A full list of the code revisions and notes can be found here :

9 thoughts on “TFT HiFiDuino Code

  1. Hi DimDim, I am totally new to this Arduino thing, I downloaded all the files in this page, then downloaded the Arduino IDE (version 1.6.5), connected Due (programming port) to Windows7, opened the IDE, installed SAM Broads.
    Then I opened Soekris_R2R_v0.5.ino again, compile, upload, all ok.

    On hardware side, I have done the shield with components soldered, so what should I do next? just connect the two broads together (with the encode rotary, IR receiver)? where should I give the power, how many volt in DC should I provide?

    Thanks a lot.

  2. Hi,
    I have error:
    B3_arduino_code_v2.13.ino: In function ‘void setAndPrintInput(byte, boolean)’:
    B3_arduino_code_v2.13:1863: error: invalid conversion from ‘short unsigned int*’ to ‘unsigned int*’ [-fpermissive]

    what is it ?
    thanks, Jerry

  3. Pingback: Yes, I put an ES9028Pro on my Buffalo III | Dimdim's Blog

  4. Pingback: DIY-DAC: Display Audio-params->already there->HiFiDuino-TFT.. – ES Sabre-90xx-Rpi

  5. I have some errors

    Arduino: 1.8.9 (Windows Store (Windows 10), Board: “Arduino Due (Programming Port)”

    Build options changed, rebuilding all
    In file included from C:\Users\ciuffoly\Documents\Arduino\libraries\UTFT/UTFT.h:167:0,

    from D:\CIUFFOLI\GEOCITIES\DSC2\Arduino\TFT_HiFiDuino_v2.13\B3_arduino_code_v2.13\B3_arduino_code_v2.13.ino:88:

    C:\Users\ciuffoly\Documents\Arduino\libraries\UTFT/hardware/arm/HW_ARM_defines.h:35:0: warning: “pgm_read_word” redefined [enabled by default]

    #define pgm_read_word(data) *data


    In file included from C:\Users\ciuffoly\Documents\ArduinoData\packages\arduino\hardware\sam\1.6.12\cores\arduino/Arduino.h:31:0,

    from sketch\B3_arduino_code_v2.13.ino.cpp:1:

    C:\Users\ciuffoly\Documents\ArduinoData\packages\arduino\hardware\sam\1.6.12\cores\arduino/avr/pgmspace.h:103:0: note: this is the location of the previous definition

    #define pgm_read_word(addr) (*(const unsigned short *)(addr))


    In file included from C:\Users\ciuffoly\Documents\Arduino\libraries\UTFT/UTFT.h:167:0,

    from D:\CIUFFOLI\GEOCITIES\DSC2\Arduino\TFT_HiFiDuino_v2.13\B3_arduino_code_v2.13\B3_arduino_code_v2.13.ino:88:

    C:\Users\ciuffoly\Documents\Arduino\libraries\UTFT/hardware/arm/HW_ARM_defines.h:36:0: warning: “pgm_read_byte” redefined [enabled by default]

    #define pgm_read_byte(data) *data


    In file included from C:\Users\ciuffoly\Documents\ArduinoData\packages\arduino\hardware\sam\1.6.12\cores\arduino/Arduino.h:31:0,

    from sketch\B3_arduino_code_v2.13.ino.cpp:1:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.