Power Control

Start Up PowerControl ver 1.4 Power Control ver 2.2 Power Control ver 3.0

 

Linkes from this page:

PowerControl ver 1.4
Power Control ver 2.2
Power Control ver 3.0

 

 

Updated 10 May  08


Specifications
Functional Requirements
PC boot timing
Hibernation
Power on and off
System Status

Hardware
IDE


Software
IBus com driver
The State Machine
IBus Congestion
Watchdog

 

Functional Requirements

The old version 1.4 built on devkit Version 2.0 with my own pcb

The PC will boot when...
- ignition is turned on 
- opening the car with remote key
- rearview camera is turned on manually
- system is turned on manually

This circuit detects those events and depending on the system was on or off last time car was driven, the screen and sound system is turned on when boot is completed.

If the system is "turned off" during driving it will only make screen and amp go inactive. It will never turn the PC off as long as the ignition is on.

When ignition is turned off  the screen and amp goes inactive but the PC remains on for another 30s (default. All timings are configurable in version 2.0). If the left knob is pressed or rearview camera is turned on within this time the screen and amp becomes active again and the pc does not go into hibernation. 

In this position the steering wheel buttons have no effect (design by BMW). The PC remains on for 30 minutes, until voltage is too low or the knob is pressed again.

To be able to turn on VGA mode it can never exit from rearview camera. It has to enter and exit camera mode via VGA mode. This very much complicates the sw design.

All in all the 8051 pcb will handle this:

Rear: The rear view camera enable (both signal to LCD and power to the camera itself)

LCD. Will turn LCD panel and power amplifier on.

USB. The enable signal to the 5V DC/DC converters for the USB hubs.

PC. On and off of PC. It will actually listen to IBus traffic at all times. For this reason this pcb is designed for extremely low power consumption.

The Red and Yellow LED's. It sends the IBus messages for turning them on and off

PC Boot timing

As mentioned all timing is configurable in version 2.0 but these are timings that apply to my PC:

3s after "ignition" the pc starts to boot.

This idle time is there to let the power supply stabilize.

After 20s the PC is ready to boot operating system

Stepping thru the bios menus to speedup things is fairly straight forward. Make sure any hw that you are not going to use is disabled and turn any automatic settings off if possible. Especially boot order and floppy's.

After 48s it is up

Booting normally takes about 60s. That is including start of navigator, Mediaplayer, GooPS and all the drivers. By using hibernation this time was cut in less than half to 28s. 

Hibernation

When you put your computer into hibernation, everything in computer memory is saved on your hard disk, and your computer is switched off. When you turn the computer back on, all programs and documents that were open when you turned the computer off are restored on the desktop. 

This is a lot faster than starting all apps and services individually, and the PC will return to the same state that it left off in (more or less).

Enter "Power options" in control panel. Check "enable" in hibernation tab. In advanced tab select "hibernate" in "when I press power button on my computer".

Power on and off

Since it takes close to a minute to start the system, the PC is always on during driving. If the system is turned off (as the driver might think) it is really just the LCD and the power amp that is turned off.

The PC is turned on by any IBus activity, i.e. opening the car with the remote key, or pushing the power on button. If the ignition isn't turned on, the PC will go off after 30min.

When ignition is off the PC will go off in 30s if not power-on button is pressed.

The monitor is turned on 5s after power-on and there is also a 5s delay when turned off. This is a delay internal to the monitor and not under my control.

System Status

On the top right corner of the Bordmonitor is three LED's that indicates system status.

    

None System is on or off
Yellow flash   System is booting
Red  System is standby. PC is on, but no LCD or Audio. In this state the reverse camera will be turned on during reverse.
Red flash  During the 30s in state Delay_off before state shutdown is entered
Yellow System is shutting down

(Green LED will indicate phone connected)

IDE

A very nice IDE came with the Development kit.

But the demo Kiel tool-chain that came with it is limited in code size and data. I used that up right away and now use SDCC, Small Device C Compiler. 

SDCC is free. Kiel has a limit of 2k code and 128 bytes data. (demo license). 8051F330 contains 7,5k code (8k) and 256 bytes of data.

IBus communication driver

I am synchronizing reception by resetting buffer when line has been idle for at least 12,5ms. Once I've received one correct message I regard the driver as synchronized. 

The 8051 handles retransmission as well as stacking up messages if there is more than one message that needs to be sent or there are collisions on the IBus. 

IBus Congestion

I've tested IBus congestion by setting IBusComm to respond with message 'A' when message 'A is received on its USB IBus interface.

On my MII 12000 that gives IBus signal above. About 20% bus- load. Below is the CTS signal. (faked, but accurate. I only have one probe)

I get plenty of congestions and therefore delayed transmissions in the 8051 system, but I do not receive a single corrupt message (crc error). 

The State machine

The complexity of this unit and the logic so vast that I've decided to split it into 3 state machines. Most complicated single task is that to be able to turn on VGA mode it can never exit from rearview camera. It has to enter and exit camera mode via VGA mode. I also wanted the rearview camera to be operational withor without running PC.

System State Machine - System state is if PC is booting, shutting down, on or off and if it is on with timeout because ignition is off. 

LCD State Machine - This state machine controls the LCD enable of the monitor. It is a service to System State and RearView State. 

RearView Camera State Machine - Independent on System State Machine (pc on or off) the rearview camera can be on or off. This state machine will manage this.

I will use watchdog kicked from main loop. If I detect an error I will starve the watchdog in eternal loop in error() function.

IBus Congestion

I've tested IBus congestion by setting IBusComm to respond with message 'A' when message 'A is received on its USB IBus interface.

On my MII 12000 that gives IBus signal above. About 20% load. Below is the CTS signal. (faked, but accurate. I only have one probe)

I get plenty of congestions and therefore delayed transmissions in the 8051 system, but I do not receive a single corrupt message (crc error). 

Watchdog

Watchdog is used to reboot if there within a 23.36s timeout is 

- main loop is halted (normally halted when IBus is busy waiting to send),
- error function is called that contains for ever loop, 
- or there is no timer interrupt.