streda 26. februára 2014

CD Changer emulator

PIC version based on vwcdpic project

 Edit: better look for this
 
UPDATE: simple boards are for sale (1Euro for board + shipping), also asembled emulators + simple cable with jack (tested wvcdpic + audio cable = 10euros + shipping ), contact me on email if you are interested, also I can send preprogramed pic +2E



I sell on Tindie

originaly this was on fritzing project page. There is lot of "files" so i make it clear here, I hope:

whole project is build around www.k9spud.com/vwcdpic/ project (mirror,mirror of devel site) , which was realease under gpl (2 I thing ...)

There are 3 firmware version:
v1: for large 16pin pic ... don't care
v2:
  • for pic12f629
  • source code provided
  • serial output, easy to handle with arduino
  • has bug with serial comuniaction, selecting CD3,4,5,6 send always command 0xd3 (cd3 selected), but fix is sipple,fixed pic asm is on my github
  • is buggy(don't use it!) on blaupunkt chorus1 and  concert1 not on philips concert1
v3:
  • for pic12f629
  • just hex
  • serial output but with bug in serial communication (can't fix, no source code)
  • is buggy(don't use it!) on blaupunkt chorus1 and  concert1 not on philips concert1

I don't know what's real diffrence in v2 and v3 code, except used pins.

I use buggy version 3 of fimrware only for emulating CD changer, without controling anything else and fixed version 2 to comunicate with arduino, which then I used to controling HTC phone and BT module.

When I start to search about this, I found that guys form cz skoda forum are doing this fake changer, they add power control to "switching" permament +12V ...... so I take their design and used it. After some builds, and research how to use this emulator with old audi chorus unit, I realize that BSP452 which is used to switch and provide stable 12V on ACC pin is capable of 0.7A as minimum, so I remove whole "power switch" and drive it whole directly from radio ACC pin.

Also audio amlifier is better not to be used, lot of noise etc... I try a lot of shielding, koax kables and design , and then I just give up. Best is to use simple emulator made on universal board, just like next picture, and connect audio directly to coresponding pins on radio CD changer connector. If you relly want to use regural PCB go with smd version down there and just "cut" audio part.
 
Simple version
for compiling pic asm: gpasm xxxx.asm

for burning I use http://rweather.github.io/ardpicprog/

Emulators with audio amlifier

kicad files
fritzing files
Schematics, for firmware v3
PCB is just remake of PCB which was on k9 site:


kicad version build


fritzing version

Separated audio ground filling, to try killing the noise comming from comunication PIC<->radio. but it don't fix it :(. This can be easy converted to "just emulator" version.
edit: after a while I connect audio ground with separate cable to chassis and it fix noise problem, so as always, problem was ground loop. ...




HTC support

files on gitbut, also with instruction

this use v3 of firmware, because there is just "play/pause" on headphone remote control, so bug in firmware is not problem

Bluetooth support

files on gitbut, also with instruction

problem with this BT module is in handling incoming call (or its bug in my HTC) after "pickup" it disconected from phone.




only pic I have :)


currently im doing "sniffer" for pic version,  so I can update shyd version of emulator on atmega. I do this because on chorus1 and concert1, there is som sort of bug, which some time lock radio in strance mode, when radio still send one command and do not want to recognize fake changer :)

ATMEGA version


based on SHYD work, ported to arduino (ATMEGA168,328 and also works with ATMEGA8 -1$ on ebay). Works with 16MHz Xtal and also with internal 8MHz RC oscilator (tested) - set CPU_SPEED to cpu clock value in MHz more about this in newer post

connection of arduino to HU


code on github

37 komentárov:

  1. Hi
    Great project, much respect :)
    Im wondering, will it work with Alfa Romeo/Fiat radio units?
    Pinouts are basically the same. I need to build sth like this for Alfa Romeo since there is no possibility to play any external source

    OdpovedaťOdstrániť
    Odpovede
    1. look at this

      https://github.com/Andrea81/CDCemu

      Odstrániť
    2. Thank you, I saw this before.
      If im right this is orginal site of that project http://forum.stiloclub.it/viewtopic.php?f=15&t=25667#wrapheader
      but I wanted something on avr or pic to be as simple as your project :)

      Odstrániť
  2. Hi
    Great project, much respect :)
    Im wondering, will it work with Alfa Romeo/Fiat radio units?
    Pinouts are basically the same. I need to build sth like this for Alfa Romeo since there is no possibility to play any external source

    OdpovedaťOdstrániť
  3. Dobry den mal by som zaujem o ten cd changer simulator na passat radio je delta 6. Potreboval by som vediet ci k hotovemu simulatoru je este potrebne pripojit kabel s jack conektorom osobitne dakujem.

    OdpovedaťOdstrániť
    Odpovede
    1. Ahoj,

      vidim, ze si uz zadal objednavku na tindie, poriesime to teda tam.

      t.

      Odstrániť
  4. hi,
    will it work with Renault Megane 2 Tuner list radio units?

    OdpovedaťOdstrániť
    Odpovede
    1. take a look on this post: http://www.instructables.com/id/AUX-Cable-for-Renault-Megane/

      I have green connector, so If you want one .....

      Odstrániť
  5. Hi Tomas! I tried your code with arduino and 3 button control android headphone. The code is very good, but the control android headphone do not work. I have to enable any line of your code to operate the buttons? What is my error?
    Thanks

    OdpovedaťOdstrániť
  6. Hi Tomas! I tried your code with arduino and 3 button control android headphone. Your code is very good but the android buttons do not work. I have to enable any line of your code to operate the buttons? What is my error?

    OdpovedaťOdstrániť
  7. Please tell me which code and schematics you used then i can help you

    OdpovedaťOdstrániť
    Odpovede
    1. I use arduino uno with your code "cdc_arduino_ported_k9spud_vwcdpic_just_8bit_timers.ino", radio audi concert 1 and htc hd with headphone 3 button control. Thanks!

      Odstrániť
    2. ok, and schematics? this one? https://github.com/tomaskovacik/hw/tree/master/kicad/arduino_based_cdc_emulator/atmegax8_dip

      cose, there is used 4066 powered with 5V, this need to by changed to 12V, just for 4066, to have lover switch resistance. otherwise it should works. I made it on bench.

      Odstrániť
    3. Ok. Your code that I use is:
      https://github.com/tomaskovacik/arduino/blob/master/VWCDCemu/CDC_emulator/cdc_arduino_ported_k9spud_vwcdpic_just_8bit_timers/cdc_arduino_ported_k9spud_vwcdpic_just_8bit_timers.ino
      but my problem is that arduino no signal output pins 5 (play button), 9 (previous button) and 6 (next button). It is that the code I have to use?

      Odstrániť
  8. did you change //#define ANDROID_HEADPHONES to

    #define ANDROID_HEADPHONES
    ?

    OdpovedaťOdstrániť
    Odpovede
    1. Yes. but it still does not output signal.

      Odstrániť
    2. ok, and other connection to radio? which radio do you have?

      Odstrániť
  9. I have the radio audi concert 1. I connect cables data out, clock and data in, to pins 2,12,13 with the Arduino Uno.

    OdpovedaťOdstrániť
    Odpovede
    1. https://www.youtube.com/watch?v=rS1MFRZy9Uw

      here you have video of that feature working on bench, I use radio_emulator for emulating radio.

      2diodes are "prev" and "play" output, led on pin 13 of green arduino is "next"

      this is configuration in cdc_arduino_ported_k9spud_vwcdpic_just_8bit_timers.ino:

      * ANDROID HEADPRONES SUPPORT
      * HTC: 3buttons, 220ohm previous|0ohm play/pause|470ohm next
      */
      -//#define ANDROID_HEADPHONES
      +#define ANDROID_HEADPHONES

      /*
      * ANDROID HEADPHONES SUPORT
      @@ -134,9 +134,9 @@
      */
      //#define ANDROID_HEADPHONES_ONE_BUTTON

      -#ifdef ANDROID_HEADPHONES_ONE_BUTTON //just to be shure
      -#define ANDROID_HEADPHONES
      -#endif
      +//#ifdef ANDROID_HEADPHONES_ONE_BUTTON //just to be shure
      +//#define ANDROID_HEADPHONES
      +//#endif

      #if defined(__AVR_ATtiny85__)
      #include

      Odstrániť
    2. I moved all code here: https://github.com/tomaskovacik/vwcdavr/

      Odstrániť
    3. Ok. I'm sorry for my late answer. Thanks for your help.
      Your code work very well making the modifications indicated by you.
      https://youtu.be/tNRmCUwH-es

      but it does not work well on my radio concert 1.
      https://youtu.be/HvF-jwfxhLg

      What can I do?

      Odstrániť
    4. ok. try use this code

      https://github.com/tomaskovacik/vwcdavr/tree/master/CDC_emulator/cdc_arduino_ported_k9spud_vwcdpic

      DATAOUT on pin 8

      but this one is withou headphone support, need to make patch to this one

      loks like, INT0 code is somehow buggy make lot of dataerr, I try to look into it

      Odstrániť
    5. Also check ground, "just 8bit timers" works, but is buggy .... Or is just bad wire connection, i will try to test it tomorow

      Odstrániť
    6. Yes. Arduino gnd pin is connected to ground radio concert.
      Your code is very good. I do not think your code has some error. I think my radio concert has different pulse.

      I'll use the code: https://github.com/tomaskovacik/vwcdavr/tree/master/CDC_emulator/cdc_arduino_ported_k9spud_vwcdpic
      to see if it works on my radio without buttons.

      Thanks!

      Odstrániť
    7. https://www.youtube.com/watch?v=LWpjHIddfwc

      I put it on bench and it works, i do make same changes to tweek it, but changes are minor, check it out, also i used 16Mhz version. Is your standard arduino?

      everything works :)

      Odstrániť
  10. Yes, i used Arduino uno 16Mhz version. I'm sorry for my late answer.

    I used the code:https://github.com/tomaskovacik/vwcdavr/tree/master/CDC_emulator/cdc_arduino_ported_k9spud_vwcdpic

    and the code: https://github.com/tomaskovacik/vwcdavr/tree/master/CDC_emulator/cdc_arduino_ported_k9spud_vwcdpic_just_8bit_timers

    with the two codes, the display only show: CD1 TR01
    I think my radio concert works differently and the pulse signal is different but your code is correct and very well.
    thanks for the help!


    OdpovedaťOdstrániť
    Odpovede
    1. Connect andruido based logic analyzer on that line and chceck what you see

      Odstrániť
  11. I do not have oscilloscope but I'll seek an alternative to arduino.
    Your code (https://github.com/tomaskovacik/vwcdavr/tree/master/vw_cd_changer_sniffer) would help me check the signals?

    OdpovedaťOdstrániť
    Odpovede
    1. https://github.com/gillham/logic_analyzer

      Odstrániť
  12. Hi, great job! I would like to build only cd changer emulator for aux in (no amplifier). Do you have info if this emulator could work with Audi Symphony 1 head unit. Basically cd changer is the same for all head units from this year, correct?

    OdpovedaťOdstrániť
  13. Hi,great job!
    Do you know if cd changer emulator could work with Audi Symphony I head unit? I think cd changer stayed the same no matter which head unit was used (in that range of year).

    OdpovedaťOdstrániť
  14. Hi, I have an Audi A4 B6 with Concert 2 unit. I have connected a bluetooth module on the CD-R/L/GND pins, it starts, I can connect to it with my phone, but I cannot select it. Pressing CD button - no luck, pressing CD + starting the HU I get message "NO CDC". Is there any gadget that you built that can help me with that? I would really like to also connect a microphone to it, if possible

    OdpovedaťOdstrániť
    Odpovede
    1. Hi, you need emulator, buy one or make one with arduino

      T.

      Odstrániť
  15. Hello congratulations nice application software can you modify it this way

    https://plus.google.com/photos/photo/101899105574100522850/6450115710770141154?icm=false&authkey=CN_-i8XHirX3vAE

    OdpovedaťOdstrániť
    Odpovede
    1. sorry, but I'm not into PIC assambly, but i actualy do something similar here: https://github.com/tomaskovacik/hw/tree/master/fritzing/vwcdpic/HTC

      Odstrániť
  16. It is possible to do it with Windows Phone Lumias?

    OdpovedaťOdstrániť