Button interface to Bordmonitor on BMW E39 and E46
Button interface to Bordmonitor on BMW E39 and E46
This thread will be used as communication channel as well as documentation of common project originally started on hacktheibus.
I will edit this initial post so that latest info always will be found here.
Code, schematics, gerber files etc will be shared. Maybe with copywrite.
By removing these connectors from the E39 and placing them onto own pcb to interface the buttons on the BM there will be room to do a screen upgrade since there is no use for original BMW electronics anymore. Goal is also to make it fit the E46 as the buttons in that BM are designed in a similar fashion.
Art has reversed enginered the button pcb's of the E39
Drawing over E39 button pcb here
I have reverese engineered button pcb's of the E46
Pictures and pinout of right pcb here
Pictures and pinout of left pcb here
Pictures and pinout of knobs here
Eagle files of BMW button pcb's here
E39 and E46 button pcb's are very similar
Originating from E46 I have added E39 specifics into Eagle project here
There are some differences in electronics between the E39 and E46
1) E39 has diodes on all inputs, E46 has it only on some.
2) There is one extra LED on E39 for FAN
3) The eject button is connected to GND on E39
4) The common wire for Phone and Clock has no series resistor on E39
5) Button layout differ
6) LED series resistor values differ. Probably different supply voltage.
In order to interface them both onto the same pc. Design suggestion and schematics
- Remove all diodes on button pcb's.
- Add zero resistor or jumper to set cpu in E39 or E46 mode. This is the only way I have come up with to change behaviour of INFO-DISPLAY-MODE buttons.
- Use analogue inputs for buttons that has parallel resistor ladder. Will save IO, and the switches have 250-1000ohm resistors.
- "Digital" IO input for eject button on E39
- Add digital logic to decode knob pulses into pulses according to direction
I have made an initial design with Eagle here.
It is not complete, but size of board, position of holes and connectors are correct.
schematics one here
schematics two here
The propriatory BMW Connectors
Milexis ibus chip here TH3122here
E46 BM button codes
Made as one piece to make it cheaper.
Now there is room for the LCD interface board! You can see the flat cable that interconnects the two pcb's, and the interface cables. 12V, 0V and IBus.
I had to make a new pcb for the E46, as holes overlaped. I also added a connector for the original buttons on the LCD panel (select input, brightness etc) so that I could throw those buttons away, and simulate them by propriatory ibus messages from the PC. What I will do is to add a menu to the front end. As you can see, I have also cut away the mid piece from the frame to make it easier to fit the LCD panel. 3 wire interface is not on picture. (12V, GND and iBus) Left and right pcb are connected with 20 pole flatcable (on picture)
C# application for test. One tab for E46 and E39, and a tab for simulating LCD panel button presses.
Excellent! Found a data cheet here.
But I doubt that it is optical. I got pure 0 ohm and --- ohm without power supply. Seems mechanical to me.
I think the sw would really benefit from some logic interfacing. Also with debouncing maybe.
If you detect these sequencies and generate a clockwise and counterclock pulse if you see what I mean, it would really offload cpu and require much less real time performance.
1) debounce with nand (here)
2) generate clock from any change in A and B to pulse a latch
3) detect red marked conditions above in two differnt signals. One-Step-Up and One-Step-Down. You can then just have a single positive edge interrupt on these inputs.
Hardware should do what it do best, and sw what it does best. Gates are cheap. :-)
I will post Eagle file with schematics for above logic, and mechanical dimensions for both E46 boards later tonight.
I have been looking at the E39 button pcb today. I am making an Eagle project that contains both E46 and E39 in one for reference. Common electronics, and two set of connectors. One set for E46 and one set for E39. This way it will be very clear how to make our pcb to fit both.
There is one concern that I have, and that is regarding the diodes on the button pcb. All inputs on E39 has diodes to LED GND, and some inputs on E46 has the same. Any push button terminal cannot have higher voltage than 0.7V (above LED-)
So with no lower voltages in the system but 0V that is the voltage on LED's, we have to detect 0V when button is closed and 0.7V when open. Very special IO will have to be used to read that. Please tell me if I am wrong.
I cannot see any way around this but to remove the diodes, do you?
I have looked ATMEGA32A briefly, and has found that it has 8 channel 10 bit ADC. Is this the correct spec? http://www.atmel.com/dyn/resources/p...ts/doc8155.pdf
To save IO I think using the AD inputs is a good ide. Ex. Use 0k, 2k, 6k, 14k, 30k and 62k in series with row 1-6 on left button board. Together with 2x1k serieresistors you will then be able to poll that chain and get unique combinations so that two buttons pressed simultaniously will not be detected as a third button.
If AD is set correctly only 6 bits will be significant, and 4 bits can make up for noise and tolerances. A "round robin" of button chains will have to be implemented in code and hardware. A current generator will have to be used to get a uniform voltage stairway. (A transistor with emitter resistor will do fine)
pcb received! edit in first post
Pcb built. Now its time to debug code. Edit in first post.
excellent work. how's this going?
Well, I do not like strapping pcb's so I am building rev 2 at the moment :-)
I went Art's way with the buttons using a PCF8574 instead of reistor ladder as the buttons resistans varies a lot.
A lot of code tested, so I will sone be sone with my combined E46&E39 board.
Art has finished his board for E39!
I've just actually been in touch with Art to figure out how on earth he "cut" the screen. As it turns out, he cut the footprint by cutting the frame, but not the glass itself.
I'm going to be doing the same with mine (just bought an E46 vert) so I can get a transflective high res in there, however I'll be keeping the buttons as they are as I want to use the existing OEM setup. I'm hoping to achieve that by using an RGsB converter for the OEM stuff and getting that on the higher res monitor, then switching to use a PC. Worklog currently here
So just to understand 100% your project, the reason you're replacing the buttons with a custom board, is so that you can fit a bigger screen in there?
Will the buttons broadcast on the ibus directly or will they be CarPC inputs, which then you're free to do what you want with, including ibus broadcasts?