|
|
Linkes from this page:
|
Functional Requirements
The PC will boot when... 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:
PC Boot timingAs 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.
After 20s the PC is ready to boot operating system
After 48s it is up
HibernationWhen 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 offSince 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 StatusOn the top right corner of the Bordmonitor is three LED's that indicates system status.
(Green LED will indicate phone connected)
IDEA 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 driverI 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 CongestionI'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 machineThe 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 CongestionI'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).
WatchdogWatchdog 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),
|