Skip to content

Latest commit

 

History

History
139 lines (102 loc) · 6.22 KB

Readme.md

File metadata and controls

139 lines (102 loc) · 6.22 KB

Alfa romeo 166 tape emulator (aux audio enabler) and bluetooth interface bridge

Latest update fixes compatibility issues with some phones!

Video:

IMAGE ALT TEXT

Project description

The cassette (or tape) is nowadays something extinct and it's presence has no useful value.
The Alfa Romeo 166 ships with the ICS solution (Integrated Control System), which is a Siemens IDIS / Becker BE2569/2580/2582 (Also used in Porsche PCM1).
Since the tape is not going to be used, it's a potential audio input that could be used for something else.

This firmware fully emulates the tape presence, its states and sensors.

While in play mode, if the user pushes the "1-2" button (change tape play direction), this is detected and the CALL output is activated.
This is useful if your bluetooth module has hands-free function and button input to pick up or hang up a call.

To provide the best compatibility there are some adjustable options:

  • POL (Button polarity).
    Open = Button idle state 0V (Low Level).
    Closed = Button idle state VCC (High level).

  • AR (Auto resume).
    Make a test on your phone: Start playing a song. Put in pause and then skip to the next song.
    Adjust as follows:
    Open = In pause state, cellphone resumes playback automatically after skipping tracks.
    Closed = In pause state, cellphone doesn't resume playback automatically after skipping tracks.

  • Play/Call.
    This inputs selects the working mode of the ICS 1-2 button.
    Open = 1-2 button works as play/ pause button.
    Closed = 1-2 button works as call button

  • No Repeat.
    If pushing the same button quickly causes issues with your phone, disable skip repeat functionality.
    Open = Button repeat is enabled (Double skip when hitting fast).
    Closed = Button repeat is disabled

The pins can be left floating (open) or connect to ground (closed).

There is an additional pin, Play-pause-call output.
Some bluetooth modules use play button for all functions.
In that case, use this output instead CALL or PLAY-PAUSE.

Some phones or bluetooth modules don't like pressing the buttons too fast.
If you have issues with the fastest (400mS), then try slower options (600, 800mS).
If it always fails when quickly pressing ICS buttons, and none of the builds fixes it, it means the phone or bluetooth module can't take two consecutive next/prev pulses.
Use a NoRepeat build in that case.

The outputs that handle the pulses for the buttons are set as open-drain (They only pull to ground, but don't put out voltage).
You will need to connect pull-up resistors to the working voltage of the bluetooth module.
This way, any voltage level is compatible. STM32 handles max 5V, don't exceed that!

To debug the state of the board, the led is used.

  • Slow, heart beat-like blinks: The board is working but tape not active
  • Fast blinking: The tape is in play mode.
  • Steady lit: The tape is in fast rewind / fast forward mode.

The firmware is implemented in a cheap STM32F103 "blue pill" board ($3).
The code doesn't use any special peripheral and can be very easily ported to other devices.
All needed are some GPIOs and a timer to provide timing control.

How to use

  • Connect to the bluetooth module to the phone.
  • Set ICS in Tape mode. It will send Play command to the bluetooth module.
  • Now the music should be playing. Use the steering wheel or ICS controls to skip tracks.
  • When exiting tape mode in the ICS, it will pause the playback in the bluetooth too.

Limitations

The controller is unable to know if the song is playing, or the current song playback time.
Due that, it might stay in pause when skipping backwards.
In that case just skip forwards, wait for the song to start and skip backwards again.
The tape system is slow. If you skip very quick, it will miss some steps. Nothing to worry about.

Firmware

You can download already compiled binaries in the Release folder (tape_btnOff_200mS.bin)
If you want to compile your own:

  • Download STM32 Cube IDE
  • Clone or download the code
  • Open STM32 Cube IDE, import existing project and select the folder where the code is.
  • It should recognize it and be ready for compiling or modifying for your own needs.

    Check "tape.h" and "tape.c", the code is very well commented and readable.

Requirements

You will need, at least:

  • Soldering iron
  • Resistors:
    • 2x 470ohm
    • 4x 1K
    • 1x 6K8
    • 1x 2K2
    • 5x 10K...100K (any value will be ok)
  • STM32 "blue pill" board with STM32F103C8 / STM32F103CB
  • Bluetooth module
  • Some wire
  • Steady hand to not mess things up!
  • I strongly recommend applying some glue/silicone to the soldered wires.
    The car vibrations can break them and cause serious damage!

    I call the experience, 2 years ago, while fitting a previous bluetooth module, a 12V wire splitted, touched the 5V supply and blowed the whole board!

Connection diagram

(Click for full size picture)

The 5V and 8.5V points are only active when the ICS is on, so there's no need to worry about the battery draining overnight!
8.5V were more than enough for my bluetooth module, althought it could handle 12V. Much more convenient!
IMAGE

This was my approach (Adding a physical button to reset the pairing list, in case the module goes mad :) ):
IMAGE