The PIC16L
written by Michael Steil, 26 June 2002
Little is known about how to program the PIC. Basically, the PIC is an independent 16 bit microprocessor with its own RAM and I/O lines, connected to the CPU through the SMBus. Its own firmware makes it possible for the PIC to be talked to on a very high level. Flashing of the LED, for instance, is completely controlled by the PIC.
Command overview
Reading:
Command | Description |
00 | |
04 | |
06 | |
0F | |
10 | |
28 | |
3B | |
50 | |
63 | |
CB |
Writing:
Command | Description |
01 | |
02 | sent with data = 1 just before kernel panic |
03 | |
04 | |
07 | Start new LED flashing (data = 1) |
08 | Set LED flashing sequence |
0B | |
0C | |
0D | |
0E | Sent by Xbox kernel with data = 2, 5 or 6 before setting LED flashing sequence |
11 | |
12 | |
13 | |
19 | Possible data: 0 or 1; sent by Xbox kernel with value = 0 to disable reset on eject |
1A | |
1B | |
1C | |
1D | |
1E | |
1F | |
20 | |
21 |
The LED
The PIC has its own timer to flash the LED: The LED color goes through four phases, 0 to 3. In each phase, the color of the LED can be different. The LED can bei either off, red, green, or (by turning on red and green) orange. All the CPU has to do to make the PIC control the LED in a specified way is to transmit a byte containing the color sequence to it.
Every phase consists of two bits for each red and green, so four phases fit into a byte. Thus the control byte looks as follows:
Bit # | Description |
7 | Red (Phase 0) |
6 | Red (Phase 1) |
5 | Red (Phase 2) |
4 | Red (Phase 3) |
3 | Green (Phase 0) |
2 | Green (Phase 1) |
1 | Green (Phase 2) |
0 | Green (Phase 3) |
To set an LED code, the command code "8" and the LED code as data has to be sent to the I2C device 0x20, followed by the command code "7" with a "1" as data, both in byte mode.
SMBusWriteCommand(0x20, 8, false, states);
SMBusWriteCommand(0x20, 7, false, 1);
These are some examples for possible values:
Code | Description |
0x00 | Off |
0xf0 | Permanent red |
0x0f | Permanent green |
0xff | Permanent orange |
0xc0 | Slow red flashing |
0xa0 | Fast red flashing |
0x63 | Off - red - orange - green flashing |