You are on page 1of 18

CE644 Firmware manual v1.

2 March 5, 2013

Contents
Introduction........................................................................................................................................2
Licensing: ........................................................................................................................................2
More licensing: ...........................................................................................................................2
Using or testing the firmware ..........................................................................................................3
Connecting the controller to the DAC ..................................................................................................3
Non-Isolated I2C .............................................................................................................................3
Isolated I2C .....................................................................................................................................4
Pin states for input switching or indicating ..........................................................................................5
Connecting TPA's 4:1 S/PDIF Receiver/MUX module .......................................................................6
Pin's for rotary encoder, IR receiver and push buttons ........................................................................7
IR receiver.......................................................................................................................................7
Rotary encoder ...............................................................................................................................7
DIP switch ...........................................................................................................................................7
Jumpers J1, J2, J3 & J4.........................................................................................................................7
Jumpers J5, J6 & J7 .............................................................................................................................8
Potentiometer VR1 .............................................................................................................................8
The battery .........................................................................................................................................8
First time use ......................................................................................................................................8
Flow chart ...........................................................................................................................................9
GUI ................................................................................................................................................... 10
Main Screen .................................................................................................................................. 10
Input Settings Menu...................................................................................................................... 10
Save Settings ............................................................................................................................. 11
Main Menu ................................................................................................................................... 11
Display ...................................................................................................................................... 11
Date / Time ............................................................................................................................... 12
T°Monitor ................................................................................................................................. 13
Advanced .................................................................................................................................. 13
Sleep ......................................................................................................................................... 17
Special thanks to: .............................................................................................................................. 18

1 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

Introduction
This firmware manual is intended to be used as a simple guide that should help to understand all the
functions available. Besides that it should provide help with using the controller and it's firmware to
switch inputs, hooking up the IR receiver, rotary encoder and push buttons. Note that switching
inputs can be done in multiple ways, but only the most commonly used ways are supported by the
firmware. Future updates might add some more functions to the firmware. This manual and the may
change without any notice. Please check the version number at the bottom of each page.

Licensing:
Developed by CE-Designs especially for the CE644 controller. For more information visit:

http://ce-designs.net/

The CE644 Firmware by CE-Designs is licensed under a Creative Commons Attribution 3.0 Unported
License. http://creativecommons.org/licenses/by/3.0/legalcode

Based on a work at http://hifiduino.wordpress.com/code/

More licensing:
RTC library by Jeelabs

Date and time functions using a DS1307 RTC connected via I2C and Wire lib 2010-02-04
<jc@wippler.nl>

http://opensource.org/licenses/mit-license.php

LiquidCrystal Library by F. Malpartida

The LiquidCrystal Library by F. Malpartida is licensed under a Creative Commons Attribution-


ShareAlike 3.0 Unported License.

http://creativecommons.org/licenses/by-sa/3.0/legalcode

This work was inspired on the Arduino SKD "LiquidCrystal" library and the "LiquidCrystal_I2C" library
from Mario_H.

IR remote library by Ken Shirriff

For details on the library see the Wiki on github or the blog post http://arcfn.com/2009/08/multi-
protocol-infrared-remote-library.html

Copyright 2009-2012 Ken Shirriff

2 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

Using or testing the firmware


The firmware is written for my own use and tested with a Buffalo III DAC in stereo mode only.
Although it is tested it could still contain some errors. When these errors occur please report these to
me:

info@ce-designs.net

A guide on how to upload the firmware to the controller can be found here:

Programming the CE644's microcontroller

The firmware can also be used with Arduino's that have 64kB or more programming space, but some
parts of the code may possible be altered, due to the used port expander. When taking this journey I
expect you to have the needed knowledge on how to achieve this.

Using the firmware is at your own risk, although the risk of damaging your DAC is very unlikely.

Connecting the controller to the DAC


There controller communicates with the DAC using the two-wire-protocol (I2C). There are two
different outbreaks on the controller that can both be used to connect to the DAC.

Non-Isolated I2C
When using the non-isolated I2C breakout connect it to the DAC’s I2C header by means of a logic
level converter. The logic level converter from the image can be bought at Sparkfun.

3 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

Isolated I2C
When using the Isolated I2C breakout connect SDA, SCK, GND and 3.3V from the DAC's I2C header to
SDA, SCK, GND and Vin at the isolated I2C breakout at the controller. The isolated site is powered by
the DAC. When powering it with 3.3V also means that the AduM1250 I2C isolator does the needed
level conversion.

Note that when using the isolated I2C outbreak to connect to the DAC it is also needed to isolate the
controller’s I/O's used for input switching. Otherwise makes it no sense to use the I2C isolator. There
are multiple ways of achieving this by using for instance digital isolators, optocouplers or even relays.
This manual does not address these details.

4 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

Pin states for input switching or indicating

5V=HIGH, Output, GND=LOW, Output,


D8 S/PDIF indicator
SPDIF PCM/DSD
D9 GND GND, Output GND, Output
5V=HIGH, Output, GND=LOW, Output,
D10 I2S/DSD indicator
PCM/DSD SPDIF
D11 GND GND, Output GND, Output
GND=LOW, Output,
D20 Power Relay 5V=HIGH, Output, ON
OFF
5V=HIGH, Output, GND=LOW, Output,
D21 Sidecar (“B”)
PCM/DSD SPDIF
5V=HIGH, Output, GND=LOW, Output,
D22 OTTO II (“S”)
INPUT2 INPUT1
D23 4:1 S/PDIF Receiver/MUX (“Terminal 1”) GND=LOW, Output * 5V=HIGH, Output *
D24 4:1 S/PDIF Receiver/MUX (“Terminal 0”) GND=LOW, Output * 5V=HIGH, Output *
GND=LOW, Output, 5V=HIGH, Output,
D25 Buffalo IIISE, IP_S (SPDIF or PCM/DSD)
SPDIF PCM/DSD
 The 4:1 S/PDIF Receiver/MUX module will switch inputs according to the next table (please also read the paragraph
about connecting the 4:1 MUX module)

When the firmware starts pin D20 is configured as output and set HIGH. This means that this pin can
be used to drive a relay that switches the power to the DAC and other modules. This pin is set LOW
when 'Standby Mode' or 'Sleep Mode' is entered, so the DAC and other modules are switched off
while the controller keeps powered. The relay does not have to be used in order for the firmware to
work, but because there is a 50ms delay there is a change for a split second of full volume at startup.
Remove the relay pin configuration and the 50 ms delay from the code when not using a relay to
switch on the DAC!! Just comment the following lines of code:

pinMode(STANDBY_RELAY_PIN, OUTPUT); // set relay pin as output


digitalWrite(STANDBY_RELAY_PIN, HIGH); // switch relay to power the DAC
delay(POWER_ON_TIME); // wait for a while so the DAC can start

Pin D9 and D10 can be used to connect a two LED's for indicating S/PDIF or I2S/DSD. Pin's D10 & D12
can be used as ground pins for the LED indicators. Do use resistors in series with the LED's to limit the
current!!!

All other pins from the table can be used to switch between different inputs. Which of these pins are
active depends on the used configuration at the “Main Menu → Advanced Menu → Config”

5 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

Connecting TPA's 4:1 S/PDIF Receiver/MUX module


When using TPA's 4:1 S/PDIF Receiver/MUX module a voltage divider or logic level converter is
needed to lower the logic level voltage from 5v to 3.3v. A simple logic level converter is an easy and
elegant solution to lower the logic level voltage. There are lots available on the market. The example
shows the logic level converter from freetronics

The next image shows how to build two voltage dividers and how to connect them to TPA's 4:1
S/PDIF Receiver/MUX module. This is a very cheap, but reliable solution. When using the non-
isolated I2C connection the ground line between the controller and 4:1 mux can be omitted.

6 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

Pin's for rotary encoder, IR receiver and push buttons

IR receiver
D1 Out from IR receiver
GND Ground
5V 5 Volts for IR receiver

Rotary encoder
D4 Channel B
D3 Switch
D2 Channel A
GND Ground
5V 5 Volts

The code for the push buttons is not available yet. This section will be added later on.

DIP switch
There is a 3-position DIP switch on the controller that when using this firmware has the function to
lock the 'IR Learn,' 'DAC Configuration' and/or 'Volume control' settings in a way that they cannot be
accessed from the menu. This can prevent that someone accidentally sets off the 'Volume Control' or
sets it to 'Stereo' while the DAC is a 'Dual Mono' setup or change your precious IR codes.

The firmware will read the DIP switch only at startup, so a power cycle is needed when changing the
DIP switch while the running the firmware.

When a position from the DIP switch is switched to ON it will lock the settings according to the table
below.

1 ON=Lock Volume Control


2 ON=Lock DAC Configuration
3 ON=Lock the Learn IR function

Jumpers J1, J2, J3 & J4


When a HD44780 LCD is used the jumpers J1 & J3 should both be installed. Jumper J1 connects 5V to
the first digital potentiometer of the MCP42010. Jumper J3 connects the potentiometer's output
(wiper) to the backlight of the LCD.

The jumper J2 connects 5V to the second potentiometer of the MCP42010. This can be useful when
one want to dim a LED or something. Note that controlling the second potentiometer is not covered
by the firmware.

7 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

Jumpers J5, J6 & J7


These jumpers set the address of the PCF8574AT port expander. The default address is 0x38. This
means that all jumpers or zero Ohm resistors need to be installed

|0|1|1|1|0|0|0| 0x38
|0|1|1|1|0|0|1| 0x39
|0|1|1|1|0|1|0| 0x3A
|0|1|1|1|0|1|1| 0x3B
|0|1|1|1|1|0|0| 0x3C
|0|1|1|1|1|0|1| 0x3D
|0|1|1|1|1|1|0| 0x3E
|0|1|1|1|1|1|1| 0x3F

Tip: Use the windows calculator in programming mode to convert binary numbers to hexadecimal
numbers or vice versa.

Potentiometer VR1
The small SMD potentiometer VR1 is there to adjust the contrast of the LCD display. When using the
controller for the first time it is most often needed to adjust the contrast to be able to read the
display. Once the contrast is set the potentiometer is most probably never going to be used again.

The battery
The 3 volt coin cell battery is the backup supply for the DS1307 RTC. It ensures that the timekeeping
operation continues while the part operates from the backup supply

First time use


Firmware version 1.2 detects at startup if the firmware is running for the first time. When it is
running for the first time it will automatically write all default settings to the EEPROM.

When running the firmware version 1.1 or lower for the first time it is important to perform a factory
reset from the menu. By doing so you make sure that the default settings are written to the EEPROM
of the Atmega644. When at first use the factory reset is skipped, the input names will not be visible
and other settings will not work like they are supposed to work because the controller does not know
the settings yet.

Always test the controller first without it being connected to the DAC. When the controller responds
well then connect it to the DAC. Preferably use a pre-amplifier or integrated amplifier to test the
controller when it is connected to the DAC. This prevents some very loud music in case something
goes wrong. Please only connect it to a power amplifier when you’re sure that the controller mutes
the DAC’s fast enough.

Reminder: When not using a relay to switch to power the DAC do remove the corresponding
lines of code, see: Pin states for input switching or indicating.

8 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

Flow chart
After the controller has started and the DAC is configured the GUI starts. From that point the
controller allows user control.

9 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

GUI

Main Screen
The main screen shows the:

 Selected input by number, name and input format


 Current volume
 Current temperature
 Oversampling ON (^) / OFF (●)
 Sample rate or Lock state

Input Settings Menu


For the selected input the following settings are accessible. The default values are printed in bold.

 FIR: FIR filter (sharp roll off, Slow roll off)


 PLL: DPLL setting (Lowest, Low, Medium-Low, Medium, Medium-High, High, Highest,
Best)
 QTZ: Quantizer (6 bit, 7 bit, 7 bit pseudo, 8 bit, 8 bit pseudo, 9 bit)
 IIR: IIR filter (PCM or 47kHz, 50 kHz, 60 kHz, 70kHz)
 PLM: DPLL bandwidth multiplier (Normal, 128x, Off)
 NCH: Notch delay (No delay, MCLK/4, MCLK/8, MCLK16, MCLK/32, MCLK/64)
 INF: Input format (S/PDIF1, S/PDIF2, S/PDIF3, S/PDIF4, I2S/DSD1, I2S/DSD2)
 OSF: Oversampling (ON, OFF)

10 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

Save Settings
Each time when a settings menu is exited the next screen will show. The top row shows which setting
is associated. A choice has to be made whether to save the setting(s), leave with saving or return to
the setting(s). Use the up or down keys to select a menu item. Press the center key to select.

Main Menu
The main menu can only be accessed by using the remote.

Use the up or down keys to select a menu item. Press the center key to select the menu item.

Display

Backlight
The brightness of a LCD can be adjusted here. The controller uses the MCP42010 digital
potentiometer to control the current to the backlight LED. The brightness can be set in 32 steps. Use
the left or right keys to adjust the backlight. Press the center key to save the setting.

11 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

Auto Off
This is an 'auto display off' timer making the screen go off after the set amount of seconds. The DAC
keeps playing and all functions are accessible while the screen goes off. This function only works
when the Main Screen is shown. Use the left or right keys to switch between enable/disable and the
timer. Use the up and down keys to select the correct value. Then press the center key to save the
settings.

Auto Clock
When the timer expires the real time clock is shown on the screen. The DAC keeps playing and all
functions are accessible while the real time clock is shown. The clock will only be activated when the
'Main Screen' is shown. Use the left or right keys to switch between enable/disable and the timer.
Use the up and down keys to select the correct value. Then press the center key to save the settings.

No picture available.

Date / Time

Clock
Shows the current date and time

12 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

Set Date
The date can be set in this menu. Use the left or right keys so select the day of the week, day of
month, month, or year. Use the up or down key to select the correct value. Then press the center key
to save.

Set Time
Time can be set in this menu. Use the left or right keys so select the hours or minutes. Use the up or
down key to select the correct value. Then press the center key to save.

T°Monitor
This function shows the temperature measured by the LM35 temperature sensor. The default setting
shows the temperature in degrees Celsius. Use the left or right keys to switch between degrees
Celsius and degrees Fahrenheit. Then press the center key to save.

Advanced
The Advanced menu gives you access to some more DAC and controller related settings. Most of
these settings need to be set just once.

13 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

Learn IR
A function to teach the controller the commands of any remote, so any remote can be used with the
controller.

Press the key that you want to use for the asked function as short as possible. Depending on the
type of remote it can be necessary to press the key for up to four times before the firmware is sure
that it stored the correct code. Just make sure that you follow the directions of the controller and
make the key presses are as short as possible!

When all keys are stored the firmware verifies the codes. If it turns out that the code are not usable
than the firmware will start the IR learn function again.

The rate at which the controller responds depends on the used remote. With some remotes it might
respond too slow or too fast. To tune the speed you can change the “IR_SPEED_LIMITER” value. Look
for this line of code:

#define IR_SPEED_LIMITER 30 // Raise this number if controller responds too fast


// or lower it if responds to slow

Config
Gives access to the DAC configuration. After changing any of these setting a power cycle of the
controller + DAC is required for the setting to take effect.

14 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

Output
The output mode can be set here. Possible options are 'Stereo' or 'Dual Mono'. Use the up or down
key to select the correct value. Then press the center key to save.

Phase
The output phase can only be set when in 'Dual Mono' mode. Possible options are 'In Phase' or 'Anti
Phase'. Use the up or down key to select the correct value. Then press the center key to save.

Clock (f)
The clock frequency of the DAC needs to be selected here for correct of the sample rate. Possible
options are '80 MHz' or '100 MHz'. Use the up or down key to select the correct value. Then press the
center key to save.

Version
The Buffalo version needs to be set in order to achieve the correct selecting of the inputs. Note that
only the most common ways of switching inputs for each version is handles by the controller.
Possible options are 'Buffalo II', 'Buffalo III' or 'Buffalo IIISE'. Use the up or down key to select the
correct value. Then press the center key to save.

15 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

Vol Ctrl
The volume control can be enabled or disabled here. The default startup volume can also be set here.
Use the left or right keys to select the between enabling/disabling the volume control or the default
startup volume. Use the up or down key to select the correct value. Then press the center key to
save. WARNING: disabling the volume control will set the volume at 0 dB attenuation! Only disables
this when using a pre-amp or integrated amplifier!!!

Inputs
Each of the 6 input names can be changed here. Each input can also be enabled or disabled. The
disabled input will be skipped when switching between inputs. Use the left or right keys so select
each character of the input name or the enabling/disabling of the input. Use the up or down keys to
select the correct character or value. Then press the center key to save.

16 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

Reset
The reset function restores all factory default settings. The summary below shows all default settings.

 Input names: INPUT1, INPUT2, INPUT3, INPUT4, INPUT5, INPUT6


 All inputs: enabled
 Selected input: 1
 Temperature mode: degrees Celsius
 Volume control: enabled
 default startup volume: 50
 DAC output: Stereo
 DAC phase: In Phase
 Clock frequency: 100 MHz
 DAC version: Buffalo III
 Backlight intensity: maximum
 Display auto off: disabled
 Display auto off timer: 4 seconds
 Auto clock mode: disabled
 Auto clock timer: 4 seconds
 Sleep timer: disabled
 Sleep timer: 60 minutes

Sleep
This is a sleep timer. Once the timer is enabled and the sleep timer has expired the controller will
switch a relay that switches off the DAC. Use the left or right keys so select the between
enabling/disabling and the sleep timer. Use the up or down key to select the correct value. Then
press the center key to save. To wake the DAC up press and hold the center key for a few seconds.

Note that this function will only work when a relay that is controlled by the controller is used to as a
switch to turn the DAC on/off.

17 CE644 Firmware manual v1.2 | CE-Designs


CE644 Firmware manual v1.2 March 5, 2013

Special thanks to:


Twisted Pear Audio, HiFiDUINO, F Malpartida, JeeLabs, Gwikse, LeonVB and all others I forgot to
mention.

18 CE644 Firmware manual v1.2 | CE-Designs

You might also like