View Single Post
      02-09-2014, 04:04 PM   #1
alexwhittemore
Lieutenant Colonel
110
Rep
1,951
Posts

Drives: 2009 Crimson 328i
Join Date: Oct 2012
Location: Los Angeles

iTrader: (0)

More Radio signal details

I'm back to working on my Nexus7 install. Software-wise, the N7 will go into deep sleep when power is removed, and will wake back up as soon as power is reapplied. Basically, that means I need to switch power to its USB port, while it's still plugged in.

The question is, what signal should I use to do the switching? I'd like to have the N7 come alive as soon as the headunit does, and go to sleep as soon as the headunit does. The problem is, the headunit's wake state is controlled by the CAN bus. Power is supplied from Terminal 30g, which turns on when the car is unlocked and turns off 30m later. That's not ideal - having a glowing nexus for 30m after I leave the car.

Unfortunately, the amp remote line isn't exactly the answer either. In WDS this signal is labeled RAD_ON. Unfortunately, the radio turns on as soon as the car is woken up (ANY event - door open, lock, unlock) and turns off between 40s and 1m after the car is left (the last to occur of key out, lock, unlock, etc). So if you're tapping off the remote line, whatever you're switching will remain on for a minute after you leave.

So on the turn-on side, the amp remote line is useful - I wouldn't mind if the N7 came on as soon as I unlocked the car. But the turn off isn't ideal - I'd like the N7 to turn off as soon as the key comes out of the car.

The last promising line I looked at was the illumination signal on pin 14. I thought, man, this would be perfect if the N7 powered on as soon as the radio lit up, and powered off when it went dark. That's basically exactly what I want. Unfortunately, that's not what this pin does. It's known as Terminal 58G, and it's actually used to signal BRIGHTNESS of the interior dash lights. It's set by the "brightness" setting in the BC. Sadly, it's also only on when the headlights are (which is the only time dash brightness settings come into play, with the headlights off they're always max).

But let's look into this more, how does it work? It turns out, 58G is a pulse width modulated (PWM) signal determining desired lighting brightness from 0 to 100%, with arbitrary apparent brightness at the 0 and 100 marks.

The signal itself is an 80hz (12.5ms period) square wave, roughly 12v peak to peak (zero volts to ground low, actually between 10.5 and 12 volts to ground high, about what you'd expect).

The minimum brightness setting corresponds to a high time of 1.04ms, or ~8.25% duty cycle. Name:  0.bmp
Views: 931
Size:  225.1 KB

The 1 notch brightness setting corresponds to a high time of 2.64ms, or 21% duty cycle. Name:  1.bmp
Views: 901
Size:  225.1 KB

The 2 notch brightness setting is a high time of 4.32ms, or 35% duty cycle.Name:  2.bmp
Views: 912
Size:  225.1 KB

And so on: 3=5.92ms(47%), 4=7.6ms(60%), 5=9.36ms(75%), 6=10.9ms(87%) then 7 notches is actually max brightness at 100%, even though there are two notches left to go in the setting. Not QUITE linear, but close enough.

Sadly, after all that, the signal still isn't super useful to me, since it's only on when the headlights are on, and also doesn't exactly follow radio-on timing like one might hope. When my power switching PCB comes back in a couple days, I'll probably just tap off the remote line and call it good enough, it's probably not going to kill me if the nexus glows for another minute after I lock the car. Though I'm still looking for something a bit better (and I'd rather not open up the headunit to tap off the backlight power itself).

Name:  IMG_1394.jpg
Views: 904
Size:  92.7 KB
__________________
Appreciate 0