Expanding the functionality of the standard audio system
Hello. I am the owner of a ten-year-old Japanese, in which I was satisfied with everything, except for the standard audio system - there was no Bluetooth in it. There are three ways to solve this problem:
1. Buy a plug in the cigarette lighter and do not show off.
Minuses: ')
Sound quality
Management is absent
The title of the songs is also missing
There are no pluses.
2. Buy for disassembly for a lot of money regular unit Bluetooth + head newer.
Minuses:
Compatibility issues for different blocks
Mono audio output (on some blocks)
The price with the replacement of the head and wiring is almost equal to the abnormal radio tape recorder
In addition to Latin support is not
Pros:
Staffing equipment
3. To do something myself, but not to cut down the existing functionality.
Minuses:
Need time
Money was spent more than if you choose the first two options together
Pros:
Satisfaction from the work done
Support lossless audio
Cyrillic support, albeit in translite, because the screen does not know how.
As you understood from the name, I chose path number 3. Initial data.
The standard audio system, which consists of a head unit and a panel that looks like this:
It has AUX mode, which allows you to connect external devices to listen to music. Why not use it for your own purposes? To make it so that a certain key combination starts the AUX mode, but at the same time all the data on the screen completely passed under our control and the sound in AUX was redirected from the Bluetooth module. Fortunately, in the public domain you can find a manual with a scheme, from which it becomes clear that the interface between the head and the panel is a regular UART.
Using a logic analyzer, the speed and protocol of the exchange between the head and the panel was determined. (The refresh rate of the screen is 10 frames per second, the scan frequency of clicks is 30 ms, 14400E2). Together with arduinka, the result was obtained in the form of Hello World.
The next step was to select the microcontroller for implementation. The choice fell on the STM32F103, on board which as many as 3 UART and there is support for CAN bus (why not add it). As a Bluetooth module, CSR8645 was originally purchased, the first version was with him, but he could not display the track names (or I didn’t figure it out to the end), and also did not have control over the digital bus, so the module called Bluegiga was bought directly from USA WT32i, which had everything that was needed and even more - support for digital audio output and the AptX codec. During a couple of months, when there was free time, a prototype was developed. All the horrors of HAL and the delights of SPL were known. UART and DMA in the microcontroller are thoroughly studied, since it was necessary to tie it all together so that it worked without brakes and glitches.
Some photos of the process
Then all this stuff was introduced into the head unit, but so that it was possible to flash and remove without problems for refinement. An HDMI cable and a connector from a dead laptop were used as an interface.
Photos at the time of debugging, it is better not to watch
Inside view:
Outside view:
The case made the old power supply from a laptop.
The time has come to plant a printed circuit board for this business, and also to bring it all beyond the limits of the head, so that at any moment you can remove this collective farm and not disrupt the operation of the machine. The result was such a beauty:
I bred for the first time in my life, you can criticize, but moderately. Soldering evening and it all worked the first time, to which I was very surprised.
Next, the CAN transceiver TJA1051 was added, with which you can receive a bunch of interesting and not very data from the car's CAN bus. I still use only the output of fuel consumption per hour, because Staff BC does not have such a function.
Video, how it works:
As you can see, the Russian text is displayed in transliteration, more or less clever. For example, the letter h is replaced with ch, etc., which could not be achieved by standard means. Well, in addition, support for lossless audio.
Those who crave the details. All 3 UARTs are involved. One on the display, one on the keys and one on the Bluetooth module. Audio stream is switched by analog multiplexer. CAN is also used from STM32. There is an external PCM5102 DAC, the sound is very good. Connects between the head and the wiring of the car. The connectors were found in the disassembly.
It turned out more expensive than buying a full-time Bluetooth system, but it brought much more pleasure from the development.
The plans to make it possible to customize the functions of customization of the car (the owners of Mitsubishi 2008+ will understand what they mean), the protocol is already there, everything is checked, it remains to be implemented in the firmware.