Skocz do zawartości

Rekomendowane odpowiedzi

Opublikowano

Tekst po angielsku, ja nie ogarniam elektroniki, ale może ktoś będzie pionierem na naszym forum i ulepi taki adapter ;)

 

This chapter describes how to build a D-CAN/K-Line adapter with bluetooth support.

If you have problems building the adapter please contact me.

 

http://download-codeplex.sec.s-msft.com/Download?ProjectName=EdiabasLib&DownloadId=1478010

Basically two components are required: A standard D-CAN/K-Line Adapter. There are multiple manufactures who sell such adapters which are basically identical. I have used one with a PLCC AFT16V8B, because it's easier to replace the chip.

A HC-05 bluetooth board. It's important that it has an integrated 5V to 3.3V power regulator.

 

Step1: Replace the PLD

A big problem of the standard adapters is the high power consumption which results in a very high inner temperature. The main reason for this is the used PLD type. The ATF16V8B requires 50mA in standby. It's possible to replace this chip with a ATF16V8BQL type, which only requires 5mA. You could remove the existing PLD with hot air and attach a PLCC20 socket instead. With a PLC programmer program the custom.jed file into the ATF16V8BQL (The standard.jed file is the original program). The custom program adds an additional RXD input to the unused pin 1.

 

http://download-codeplex.sec.s-msft.com/Download?ProjectName=EdiabasLib&DownloadId=1478011

Step2: Program the processor

There is a replacement firmware available that has the following advantages over the standard firmware: Faster CAN communication (block size 0 and no separation time).

Allows configuration of CAN mode all the time, not only after power on.

Allows configuration of the CAN parameters (block size and separation time)

Correctly displays the ignition status (only available for K-line mode).

Allows to read the ignitions status with a telegram, this is required if you want to communicate over bluetooth.

Contains a bootstrap loader that allows firmware update without opening the device.

Reduced power consumption due to use of sleep mode.

For the first programming of the new firmware you have to connect the MISO, MOSI, SCK, RESET, GND and +5V to a standard AVR programmer (also supply the adapter with 12V). The 'combined.hex' file contains the bootstrap loader and the firmware. The fuses have to be set as follows:

 

 

 

Fuse

 

Value (hex)

 

Low 0xFD

High 0xDC

Extended 0xF9

 

The next time the firmware update is possible with UpdateLoader.exe (using CanAdapter.hex).

 

http://download-codeplex.sec.s-msft.com/Download?ProjectName=EdiabasLib&DownloadId=1478012

Step3: HC-05 connector

Now it's time to add an connector for the HC-05 board. The board requires only GND, +5V, TXD and RXD. But be beware of one problem: The HC-05 operates with 3.3V logic, whereas the converter uses 5V. For TXD signal (output from HC-05) this is no problem, the high level is detected correctly by the ATF16V8, but the RXD signal generated by the ATF16V8 has be be adjusted. I have used a voltage divider with 1K and 2K connected to ground. The HC-05 TXD signal could be now connected the Pin1 of the PLD (when using the custom.jed file).

 

http://download-codeplex.sec.s-msft.com/Download?ProjectName=EdiabasLib&DownloadId=1478013

Step4: HC-05 configuration

The HC-05 has now to be set into the correct operation mode. Connect it to an USB-TTL converter and attach the KEY pin to 3.3V or press the button on the board (depends on board type) during power on.

Use a terminal program with the following parameters: Baud 38400, 8, N, 1. Make sure that all commands are terminated with ! Now test the connection with the command: AT. The device must respond with OK. Now use the following commands to set the operation mode (also see HC-05 specification): Role slave: AT+ROLE=0

Baud rate: AT+UART=115200,0,0

Device name: AT+NAME=

Password: AT+PSWD=

 

Step5: Replace HC-05 pin header

The pin header of the HC-05 board normally point into the wrong direction, so it will not fit into the adapter case. Remove the pin header and replace it with a new one that points into the opposite direction. Additionally you may have to replace the shrinking tube.

 

http://download-codeplex.sec.s-msft.com/Download?ProjectName=EdiabasLib&DownloadId=1478019

http://download-codeplex.sec.s-msft.com/Download?ProjectName=EdiabasLib&DownloadId=1478015

Step6: Add a power switch

If you want to leave the adapter plugged into the OBDII socket, you need a possibility to switch it off. You have to disconnect the pin header as shown in the picture below and add a switch that could be mounted in the empty USB cable space.

 

http://download-codeplex.sec.s-msft.com/Download?ProjectName=EdiabasLib&DownloadId=1478016

Step7: Mount everything together

Plug the modified HC-05 into it's socket and close the adapter. You should now be able to connect to the adapter via bluetooth from the PC. Make sure you are using a bluetooth chip in the PC and not a USB-TTL converter with HC-05 in master role because this will result in incorrect timing!

When sending strings to the adapter you should at least get an echo from the adapter, otherwise there is a problem with the connections.

You could test reading the ignition pin with the following command (hex values):

82 F1 F1 FE FE 60

The response is (additionally to the echo):

82 F1 F1 FE with state bit 0 set to 1 if ignition is on.

 

Firmware update

With UpdateLoader-win32.exe (application is only in german language) it's possible to update the firmware via bluetooth. Simply select the COM port and the hex file (CanAdapter.hex, not Combined.hex!) and start update.

The update can only be initiated if there is a valid application in the adapter. When the update via bluetooth is not possible any more, connect the adapter via USB, start the update process and power on the adapter (12V).

 

http://download-codeplex.sec.s-msft.com/Download?ProjectName=EdiabasLib&DownloadId=1478018

 

Last edited Nov 8, 2015 at 2:14 PM by uholeschak, version 4

 

LINK

https://ediabaslib.codeplex.com/wikipage?title=Build%20Bluetooth%20D-CAN%20adapter&referringTitle=Home

Opublikowano
Nie znam się na elektronice i tego nie ukrywam. Nie wiem czy jest sens w przypadku aut ze złączem pod kierownicą, bo fizycznie masz wszystko w aucie(złącze kable kompa), ale np w moim przypadku takie rozwiązanie byłoby dla mnie ułatwieniem np podczas sprawdzania live data. Mam dwa złącza w swoim e46 , gdzie pod maską robię wszystko , zaś w kabinie to jak dobrze pamiętam miałem jedynie obsługę modułu SM.
Opublikowano
Niestety, nie tykam się elektroniki, to dla mnie czarna magia :/ Temat bardziej jako ciekawostka, daję radę działać na zwykłym kablu, ale jakbym miał czas, umiejętności i wiedzę to bym sobie zrobił tuning kabla :D
  • 7 lat później...

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.