Difference between revisions of "Kurobox Pro Microcomputer Communication Specifications"
m (New page: KURO BOX/PRO Microcomputer Communication Specifications Rev.1.0 =Functions= ==Overview of Functions== Communicates with the main CPU via UART. The main functions are shown below. * ...) |
m |
||
(25 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{Articles|KuroboxPro|Hardware}} | |
− | + | =Contents= | |
+ | __TOC__ | ||
+ | |||
=Functions= | =Functions= | ||
==Overview of Functions== | ==Overview of Functions== | ||
Line 24: | Line 26: | ||
* Stop bit: 1 bit or more | * Stop bit: 1 bit or more | ||
− | + | ==Communication with Main CPU== | |
* Basic communication is performed by the transmission of commands, data, and parity. | * Basic communication is performed by the transmission of commands, data, and parity. | ||
* When switches etc are pressed, a level interrupt occurs. The interrupt is cleared when reporting to the CPU is completed. | * When switches etc are pressed, a level interrupt occurs. The interrupt is cleared when reporting to the CPU is completed. | ||
− | * If many frame errors occur, regulate the guard time on the main CPU. | + | * If many frame errors occur, regulate the guard time on the main CPU. |
+ | |||
==Protocol== | ==Protocol== | ||
=== Preamble === | === Preamble === | ||
Line 34: | Line 37: | ||
===Main CPU -> Microcomputer === | ===Main CPU -> Microcomputer === | ||
− | Data Payload 0 Bytes | + | ====Data Payload 0 Bytes==== |
{|class=wikitable | {|class=wikitable | ||
|- | |- | ||
Line 46: | Line 49: | ||
||3 || Parity 0-(byte1+byte2) | ||3 || Parity 0-(byte1+byte2) | ||
|} | |} | ||
− | Data Payload n bytes | + | |
− | 1 Transfer | + | ====Data Payload n bytes==== |
+ | {|class=wikitable | ||
+ | |- | ||
+ | ||1 || Transfer | ||
direction | direction | ||
(BIT7) | (BIT7) | ||
− | Data payload () | + | ||Data payload () |
− | 2 Command | + | |- |
− | 3 Data 0 | + | ||2|| Command |
− | • | + | |- |
− | • | + | ||3|| Data 0 |
− | • | + | |- |
+ | || ||•<br> | ||
+ | • <br> | ||
+ | • <br> | ||
• | • | ||
− | n-1 Data n | + | |- |
− | n Parity 0 - Σ(byte 1 to byte n-1) | + | ||n-1 ||Data n |
− | + | |- | |
− | + | ||n || Parity 0 - Σ(byte 1 to byte n-1) | |
− | + | |} | |
− | Responses to commands other than the read command (when data does not | + | |
− | exist) | + | ===Microcomputer -> Main CPU=== |
− | 1 0 | + | ====Responses to commands other than the read command (when data does not exist)==== |
− | (BIT7) Data payload (1) | + | {|class=wikitable |
− | 2 Sent command | + | |- |
− | 3 ACK | + | ||1 || 0 |
− | 4 Parity 0-(byte1+byte2+byte3) | + | (BIT7) |
− | Response to read command | + | || Data payload (1) |
− | 1 0 | + | |- |
− | (BIT7) Data payload (N) | + | ||2 ||Sent command |
− | 2 Sent command | + | |- |
− | 3 Data 1 | + | ||3 ||ACK |
− | n-1 Data N | + | |- |
− | n Parity 0 - Σ(byte 1 to byte n-1) | + | ||4 ||Parity 0-(byte1+byte2+byte3) |
− | Response when communication error occurs | + | |} |
− | 1 0 | + | |
− | (BIT7) Data payload (1) | + | ====Response to read command==== |
− | 2 Sent command | + | {|class=wikitable |
− | 3 NACK | + | |- |
− | 4 Parity 0-(byte1+byte2+byte3) | + | ||1 ||0 |
− | + | (BIT7) | |
− | HEX mnemonic | + | ||Data payload (N) |
− | 0x00 ACK Good | + | |- |
− | 0xF1 OVER_RUN UART physical layer error Physical layer buffer | + | ||2 ||Sent command |
− | over | + | |- |
− | 0xF2 FRAMING_ERR UART physical layer error Physical layer frame | + | ||3 ||Data 1 |
− | error | + | |- |
− | 0xF3 PARITYERROR UART physical layer error Physical layer parity | + | ||n-1 ||Data N |
− | error | + | |- |
− | 0xF4 Invalid_COM Command does not exist | + | ||n ||Parity 0 - Σ(byte 1 to byte n-1) |
− | 0xF5 Com_len_err Command and data payload values do not | + | |} |
− | correspond | + | |
− | 0xF6 RX_BUFF_OVER Payload larger than 32 bytes specified. | + | ====Response when communication error occurs==== |
− | 0xF7 DATA_PARITY_ERROR Data parity is wrong. | + | {|class=wikitable |
− | + | |- | |
− | + | ||1 ||0 | |
− | + | (BIT7) | |
+ | ||Data payload (1) | ||
+ | |- | ||
+ | ||2 ||Sent command | ||
+ | |- | ||
+ | ||3 ||NACK | ||
+ | |- | ||
+ | ||4 ||Parity 0-(byte1+byte2+byte3) | ||
+ | |} | ||
+ | |||
+ | ==ACK/NACK List== | ||
+ | {|class=wikitable | ||
+ | |- | ||
+ | !|HEX | ||
+ | !|mnemonic | ||
+ | |- | ||
+ | ||0x00 || ACK || Good | ||
+ | |- | ||
+ | ||0xF1 || OVER_RUN || UART physical layer error Physical layer buffer over | ||
+ | |- | ||
+ | ||0xF2 || FRAMING_ERR ||UART physical layer error Physical layer frame error | ||
+ | |- | ||
+ | ||0xF3 || PARITYERROR ||UART physical layer error Physical layer parity error | ||
+ | |- | ||
+ | ||0xF4 || Invalid_COM ||Command does not exist | ||
+ | |- | ||
+ | ||0xF5 || Com_len_err ||Command and data payload values do not correspond | ||
+ | |- | ||
+ | ||0xF6 || RX_BUFF_OVER ||Payload larger than 32 bytes specified. | ||
+ | |- | ||
+ | ||0xF7 || DATA_PARITY_ERROR ||Data parity is wrong. | ||
+ | |} | ||
+ | |||
+ | ===Write Command=== | ||
LED Lighting control etc | LED Lighting control etc | ||
Command | Command | ||
Line 119: | Line 161: | ||
Command 2nd byte | Command 2nd byte | ||
PARITY | PARITY | ||
− | + | ||
− | + | ===Read Command=== | |
− | + | ||
Temperature read by CPU | Temperature read by CPU | ||
DATA0 | DATA0 | ||
Line 138: | Line 179: | ||
command | command | ||
phase | phase | ||
− | + | ||
− | + | ===Interrupt + Read Command=== | |
− | + | ||
SW | SW | ||
Micro- | Micro- | ||
Line 160: | Line 200: | ||
Command | Command | ||
CPU | CPU | ||
− | + | ||
− | + | ==Command== | |
− | + | ===Command Construction=== | |
− | + | ||
The command is a 2 byte command. | The command is a 2 byte command. | ||
− | Write (CPU -> Microcomputer) | + | |
− | bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 | + | ====Write (CPU -> Microcomputer)==== |
− | 0 0 Length | + | {|class=wikitable |
− | bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 | + | |- |
− | OPCODE | + | ||bit7 ||bit6 ||bit5 ||bit4 ||bit3 ||bit2 ||bit1 ||bit0 |
− | Read (Microcomputer -> CPU) | + | |- |
− | bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 | + | ||0 ||0 |
− | 1 0 | + | | colspan=6 align=center |Length |
− | bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 | + | |} |
− | OPCODE | + | |
− | Command List | + | {|class=wikitable |
− | + | |- | |
− | Command | + | ||bit7 ||bit6 ||bit5 ||bit4 ||bit3 ||bit2 ||bit1 ||bit0 |
− | + | |- | |
− | FF --- NOP Used in preamble | + | | colspan=8 align=center |OPCODE |
− | 0x00 0x02 BOOT_START Boot starts, CPU sends this command at the start. If | + | |} |
+ | |||
+ | ====Read (Microcomputer -> CPU)==== | ||
+ | {|class=wikitable | ||
+ | |- | ||
+ | ||bit7 ||bit6 ||bit5 ||bit4 ||bit3 ||bit2 ||bit1 ||bit0 | ||
+ | |- | ||
+ | ||1 | ||
+ | | colspan=7 align=center |0 | ||
+ | |} | ||
+ | |||
+ | {|class=wikitable | ||
+ | |- | ||
+ | ||bit7 ||bit6 ||bit5 ||bit4 ||bit3 ||bit2 ||bit1 ||bit0 | ||
+ | |- | ||
+ | | colspan=8 align=center |OPCODE | ||
+ | |} | ||
+ | |||
+ | |||
+ | Command List | ||
+ | |||
+ | ===Commands with no data payload=== | ||
+ | |||
+ | {|class=wikitable | ||
+ | ! colspan=2|Command | ||
+ | ! rowspan=2|Command name | ||
+ | ! rowspan=2|Microcomputer operation | ||
+ | |- | ||
+ | !| 1Byte | ||
+ | !| 2Byte | ||
+ | |- | ||
+ | ||FF || --- || NOP || Used in preamble | ||
+ | |- | ||
+ | ||0x00 ||0x02 ||BOOT_START ||Boot starts, CPU sends this command at the start. If | ||
this command is not received within 10 seconds | this command is not received within 10 seconds | ||
after reset, power does not go on. | after reset, power does not go on. | ||
This is displayed during boot. | This is displayed during boot. | ||
− | 0x00 0x03 BOOT_END The boot display is completed, and the device | + | |- |
+ | ||0x00 ||0x03 ||BOOT_END ||The boot display is completed, and the device | ||
operates normally. | operates normally. | ||
If this command is not received within 5 minutes, | If this command is not received within 5 minutes, | ||
power goes off. | power goes off. | ||
− | 0x00 0x06 POFF Power switches off. | + | |- |
− | 0x00 0x0C | + | ||0x00 ||0x06 ||POFF ||Power switches off. |
− | + | |- | |
− | 0x00 0x0D | + | ||0x00 ||0x0C ||SHUT_DOWN_WAIT ||SHUT DOWN preparations |
− | + | |- | |
− | 0x00 0x0E REBOOT REBOOT (system reset) start | + | ||0x00 ||0x0D ||SHUT_DOWN_WAIT_N ||Cancel SHUT DOWN preparations |
− | + | |- | |
− | + | ||0x00 ||0x0E ||REBOOT ||REBOOT (system reset) start | |
− | + | |} | |
− | + | ||
− | -- | + | |
+ | ===Data Payload 1 Byte Command=== | ||
+ | |||
+ | |||
+ | {|class=wikitable | ||
+ | ! colspan=2|Command | ||
+ | ! rowspan=2|Command name | ||
+ | ! rowspan=2|Microcomputer operation | ||
+ | |- | ||
+ | !| 1Byte | ||
+ | !| 2Byte | ||
+ | |- | ||
+ | ||0x01 | ||
+ | | rowspan=2 | 0x30 | ||
+ | | rowspan=2 | BZ_ON | ||
+ | | rowspan=2 | Buzzer sounds.Buzzer control, with fine selection of | ||
whether to sound for 1 byte of data | whether to sound for 1 byte of data | ||
− | 0x01 | + | |- |
− | + | ||-------- | |
+ | |- | ||
+ | ||0x01 | ||
+ | | rowspan=2 |0x33 | ||
+ | | rowspan=2 |FANSPEED_CTL | ||
+ | | rowspan=2 |FAN speed can be selected.0 Stopped 3 Maximum | ||
Settings above 3 (only enabled for lower 2 | Settings above 3 (only enabled for lower 2 | ||
bits) | bits) | ||
− | + | |- | |
− | 0x80 0x35 | + | ||0x80 |
− | + | |- | |
+ | ||0x01 | ||
+ | | rowspan=2 |0x35 | ||
+ | | rowspan=2 |SYSTEM_WDT | ||
+ | | rowspan=2 |Performs clear and settings for system | ||
watchdog. | watchdog. | ||
− | 0x80 0x37 TEMP Obtains the temperature.Receivable data is in Centigrade | + | |- |
− | 0x80 0x38 FANSPEED Obtains fan speed informationDouble the number of FAN revolutions in 3 | + | ||0x80 |
+ | |- | ||
+ | || | ||
+ | | rowspan=2 | 0x37 | ||
+ | | rowspan=2 | TEMP | ||
+ | | rowspan=2 | Obtains the temperature.Receivable data is in Centigrade | ||
+ | |- | ||
+ | ||0x80 | ||
+ | |- | ||
+ | || | ||
+ | | rowspan=2 | 0x38 | ||
+ | | rowspan=2 | FANSPEED | ||
+ | | rowspan=2 | Obtains fan speed informationDouble the number of FAN revolutions in 3 | ||
seconds is displayed. | seconds is displayed. | ||
− | rpm= (obtained data) ×10. | + | rpm= (obtained data) ×10. |
− | + | |- | |
− | 0x80 0x3a LED_BRIGHT Adjusts the brightness of the current LED | + | ||0x80 |
− | + | |- | |
− | 0x80 0x3b HDD_POWER Controls the HDD power supply | + | ||0x01 |
− | 0x80 0x3c MAIN_STATUS Obtains the STATUS of the microcomputer | + | | rowspan=2 | 0x3a |
− | + | | rowspan=2 | LED_BRIGHT | |
− | 0x02 | + | | rowspan=2 |Adjusts the brightness of the current LED |
− | + | |- | |
− | + | ||0x80 | |
− | 0x80 | + | |- |
− | 0x51 LED_ON_OFF Controls whether the LED is on or off | + | ||0x01 |
− | + | | rowspan=2 | 0x3b | |
− | 0x80 0x52 LED_BLINK Selects the LED for LED flashing display | + | | rowspan=2 | HDD_POWER |
− | + | | rowspan=2 |Controls the HDD power supply | |
− | 0x80 | + | |- |
− | 0x53 BZ_FREQ Buzzer frequency settings | + | ||0x80 |
− | + | |- | |
− | 0x80 | + | || |
− | 0x54 LED_PATTERN Controls LED flashing | + | | rowspan=2 | 0x3c |
− | + | | rowspan=2 | MAIN_STATUS | |
− | + | | rowspan=2 | Obtains the STATUS of the microcomputer | |
− | + | |- | |
− | + | ||0x80 | |
− | 0×01 First operand read 0×80 | + | |- |
− | 0×30 Second operand | + | |} |
− | + | ||
− | 0×00 Stop the sound | + | ===Data Payload 2 Byte Command=== |
− | 0×01 | + | |
− | 0×02 | + | {|class=wikitable |
− | 0×03 | + | ! colspan=2|Command |
− | 0×04 | + | ! rowspan=2|Command name |
− | 0×10 | + | ! rowspan=2|Microcomputer operation |
− | 0×20 | + | |- |
− | + | !| 1Byte | |
− | + | !| 2Byte | |
− | 0×02 First operand setting | + | |- |
− | 0×80 First operand reading of settings. | + | ||0x02 |
− | 0×53 Second operand | + | | rowspan=2 | 0x50 |
− | + | | rowspan=2 | LED_CPU_MCON | |
+ | | rowspan=2 |Switches LED between main CPU controland microcomputer control. | ||
+ | |- | ||
+ | ||0x80 | ||
+ | |- | ||
+ | ||0x02 | ||
+ | | rowspan=2 | 0x51 | ||
+ | | rowspan=2 | LED_ON_OFF | ||
+ | | rowspan=2 |Controls whether the LED is on or off | ||
+ | |- | ||
+ | ||0x80 | ||
+ | |- | ||
+ | ||0x02 | ||
+ | | rowspan=2 | 0x52 | ||
+ | | rowspan=2 | LED_BLINK | ||
+ | | rowspan=2 |Selects the LED for LED flashing display | ||
+ | |- | ||
+ | ||0x80 | ||
+ | |- | ||
+ | ||0x02 | ||
+ | | rowspan=2 | 0x53 | ||
+ | | rowspan=2 | BZ_FREQ | ||
+ | | rowspan=2 |Buzzer frequency settings | ||
+ | |- | ||
+ | ||0x80 | ||
+ | |- | ||
+ | ||0x02 | ||
+ | | rowspan=2 | 0x54 | ||
+ | | rowspan=2 | LED_PATTERN | ||
+ | | rowspan=2 |Controls LED flashing | ||
+ | |- | ||
+ | ||0x80 | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | ==Buzzer ON/OFF== | ||
+ | ===Command=== | ||
+ | {| | ||
+ | |- | ||
+ | ||0×01 ||First operand read 0×80 | ||
+ | |- | ||
+ | ||0×30 ||Second operand | ||
+ | |} | ||
+ | ===Data=== | ||
+ | {| | ||
+ | |- | ||
+ | ||0×00 ||Stop the sound | ||
+ | |- | ||
+ | ||0×01 || <nowiki>[Pi-po]</nowiki> | ||
+ | |- | ||
+ | ||0×02 || <nowiki>[Pi]</nowiki> | ||
+ | |- | ||
+ | ||0×03 || Continuous sound <nowiki>[Piiiii-]</nowiki> | ||
+ | |- | ||
+ | ||0×04 || Sounds every 0.3 seconds | ||
+ | |- | ||
+ | ||0×10 || Repeats sounding for 0.5 seconds then stopping for 0.3 seconds. | ||
+ | |- | ||
+ | ||0×20 || <nowiki>[Pi-po-pa-po]</nowiki> | ||
+ | |} | ||
+ | |||
+ | ==Buzzer pitch== | ||
+ | ===Command=== | ||
+ | {| | ||
+ | |- | ||
+ | ||0×02 ||First operand setting | ||
+ | |- | ||
+ | ||0×80 ||First operand reading of settings. | ||
+ | |- | ||
+ | ||0×53 ||Second operand | ||
+ | |} | ||
+ | ===Data 0=== | ||
Frequency settings lower order | Frequency settings lower order | ||
− | + | ===Data 1=== | |
Frequency settings upper order | Frequency settings upper order | ||
− | + | ===Relationship between sound pitch and frequency=== | |
− | A A# B C C#D D# E F F# G G# | + | |
− | 55 58 62 65 69 73 78 82 87 92 98 104 | + | {|class=wikitable |
− | 110 117 123 131 139 147 156 165 175 185 196 208 | + | |- |
− | 220 233 247 262 277 294 311 330 349 370 392 415 | + | !|A |
− | 440 466 494 523 554 587 622 659 698 740 784 831 | + | !|A# |
− | 880 932 | + | !|B |
− | + | !|C | |
− | Relationship between values set on microcomputer and sound pitch | + | !|C# |
− | A A# B C C#D D# E F F# G G# | + | !|D |
− | + | !|D# | |
− | + | !|E | |
− | + | !|F | |
− | + | !|F# | |
− | 4705 430F 3F42 | + | !|G |
− | 2382 2187 1FA1 | + | !|G# |
− | 11C1 10C3 | + | |- |
− | 08E0 0860 07E8 0777 | + | ||55 ||58 ||62 ||65 ||69 ||73 ||78 ||82 ||87 ||92 ||98 ||104 |
− | 3F4 | + | |- |
− | 1FA | + | ||110 ||117 ||123 ||131 ||139 ||147 ||156 ||165 ||175 ||185 ||196 ||208 |
− | FD | + | |- |
− | + | ||220 ||233 ||247 ||262 ||277 ||294 ||311 ||330 ||349 ||370 ||392 ||415 | |
− | + | |- | |
− | 0×01 First operand read 0×80 when setting | + | ||440 ||466 ||494 ||523 ||554 ||587 ||622 ||659 ||698 ||740 ||784 ||831 |
− | 0×35 Second operand | + | |- |
− | + | ||880 ||932 ||988 ||1047 ||1109 ||1175 ||1245 ||1319 ||1397 ||1480 ||1568 ||1661 | |
+ | |- | ||
+ | ||1760 ||1865 ||1976 ||2093 ||2217 ||2349 ||2489 ||2637 ||2794 ||2960 ||3136 ||3322 | ||
+ | |} | ||
+ | ====Relationship between values set on microcomputer and sound pitch==== | ||
+ | |||
+ | {|class=wikitable | ||
+ | |- | ||
+ | !|A | ||
+ | !|A# | ||
+ | !|B | ||
+ | !|C | ||
+ | !|C# | ||
+ | !|D | ||
+ | !|D# | ||
+ | !|E | ||
+ | !|F | ||
+ | !|F# | ||
+ | !|G | ||
+ | !|G# | ||
+ | |- | ||
+ | || || ||FC04 ||F062 ||E273 ||D60A ||C852 ||BE8C ||B399 ||A9D6 ||9F70 ||963D | ||
+ | |- | ||
+ | ||8E0B||858C||7F08|| 7746 ||7068 ||6A4A||6429 ||5EB2||5949 ||5475 ||4FB8 ||4B1E | ||
+ | |- | ||
+ | ||4705 ||430F ||3F42 ||3BA3||3868 ||3525 ||323D||2F59 ||2CC5||2A3A||27DC||25A6 | ||
+ | |- | ||
+ | ||2382 ||2187 ||1FA1 ||1DE0||1C34 ||1A9E||191E||17B5 ||1662 ||151D||13EE||12CD | ||
+ | |- | ||
+ | ||11C1 ||10C3 ||0FD0||0EEC||0E16 ||0D4C||0C8C||0BD8||0B2F||0A8E||09F7 ||0968 | ||
+ | |- | ||
+ | ||08E0 ||0860 ||07E8 ||0777 ||070C||06A6 ||0647 ||05EC||0597 ||0547 ||04FB||04B4 | ||
+ | |- | ||
+ | || || ||3F4 || || || || || || || || || | ||
+ | |- | ||
+ | || || ||1FA || || || || || || || || || | ||
+ | |- | ||
+ | || || ||FD || || || || || || || || || | ||
+ | |} | ||
+ | |||
+ | ==System Watchdog== | ||
+ | ===Command=== | ||
+ | {| | ||
+ | |- | ||
+ | ||0×01 ||First operand read 0×80 when setting | ||
+ | |- | ||
+ | ||0×35 ||Second operand | ||
+ | |} | ||
+ | ===Data=== | ||
Set the time until the power goes OFF for forced OFF. You can set up to 255 seconds. | Set the time until the power goes OFF for forced OFF. You can set up to 255 seconds. | ||
+ | |||
However, setting to 0 will cause the system watchdog to stop and not operate. | However, setting to 0 will cause the system watchdog to stop and not operate. | ||
+ | |||
If read is performed, the time for the watchdog to operate is displayed. | If read is performed, the time for the watchdog to operate is displayed. | ||
− | 0×FF – (time to shutdown) = Setting value | + | |
− | + | 0×FF – (time to shutdown) = Setting value | |
− | + | ||
− | 0×80 First Operand (read only) | + | ==Temperature Read== |
− | 0×37 Second operand | + | ===Command=== |
− | + | {| | |
+ | |- | ||
+ | ||0×80 ||First Operand (read only) | ||
+ | |- | ||
+ | ||0×37 ||Second operand | ||
+ | |} | ||
+ | ===Data=== | ||
The temperature on the board can be read. | The temperature on the board can be read. | ||
+ | |||
The read data is signed char. | The read data is signed char. | ||
− | The data is from -55°C to 125°C. | + | |
− | + | The data is from -55°C to 125°C. | |
− | + | ||
− | 0x80 First Operand (read only) | + | ==SW Read== |
− | 0×36 Second operand | + | ===Command=== |
− | + | {| | |
− | bit7-bit4 bit4 bit3 bit2 bit1 | + | |- |
− | 0 1 F_INIT_SW 1 1 Power SW | + | ||0x80 ||First Operand (read only) |
− | + | |- | |
− | + | ||0×36 ||Second operand | |
+ | |} | ||
+ | ===Data=== | ||
+ | {|class=wikitable | ||
+ | |- | ||
+ | ||bit7-bit4 ||bit4 ||bit3 ||bit2 ||bit1 ||bit0 | ||
+ | |- | ||
+ | ||0 ||1 ||F_INIT_SW ||1 ||1 ||Power SW | ||
+ | |} | ||
+ | |||
If SW or INITSW is pressed, an interrupt occurs. You can research the cause of an | If SW or INITSW is pressed, an interrupt occurs. You can research the cause of an | ||
− | interrupt by reading the SW. | + | |
− | Reading this resistor clears the interrupt. | + | <b>interrupt by reading the SW. |
+ | |||
+ | Reading this resistor clears the interrupt. </b> | ||
+ | |||
*If the SW is released at the point when read is started, the value returns to 1. Therefore, | *If the SW is released at the point when read is started, the value returns to 1. Therefore, | ||
measure the pressed time on the CPU to judge. | measure the pressed time on the CPU to judge. | ||
− | bit4: Always 1 | + | |
− | bit3: 0 when INIT_SW is pressed | + | {| |
− | bit2: Always 1 | + | |- |
− | bit1: Always 1 | + | ||bit4: ||Always 1 |
− | bit0: Power_SW 0 when Power_SW is pressed | + | |- |
− | + | ||bit3: ||0 when INIT_SW is pressed | |
− | + | |- | |
− | + | ||bit2: ||Always 1 | |
− | Second operand | + | |- |
− | Switching LED control rights: 0×50 | + | ||bit1: ||Always 1 |
− | Switching LED on/off: 0×51 | + | |- |
− | Flash LED: 0×52 | + | ||bit0: ||Power_SW 0 when Power_SW is pressed |
− | + | |} | |
− | DATA0 | + | |
− | bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 | + | ==LED Display== |
− | 0 0 0 0 LINK DIAG INFO Power | + | ===Command=== |
− | DATA1 | + | |
− | bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 | + | ====First operand==== |
− | 0 0 0 0 0 0 0 0 | + | {| |
− | + | |- | |
− | Control Rights Switching | + | ||0×01 ||First operand 0×80 (read) |
− | + | |} | |
− | + | ||
− | Switching on/off | + | |
− | + | ====Second operand==== | |
− | + | * Switching LED control rights: 0×50 | |
− | + | * Switching LED on/off: 0×51 | |
− | + | * Flash LED: 0×52 | |
− | Flash Switching | + | |
− | + | ===Data=== | |
− | + | ====DATA0==== | |
− | + | {|class=wikitable | |
− | + | |- | |
− | 0×00 First operand 0×80 read | + | ||bit7 ||bit6 ||bit5 ||bit4 ||bit3 ||bit2 ||bit1 ||bit0 |
− | + | |- | |
− | + | ||0 ||0 ||0 ||0 ||LINK ||DIAG ||INFO ||Power | |
− | + | |} | |
− | 0 LED Illumination | + | |
− | + | ====DATA1==== | |
− | LED Illumination | + | {|class=wikitable |
+ | |- | ||
+ | ||bit7 ||bit6 ||bit5 ||bit4 ||bit3 ||bit2 ||bit1 ||bit0 | ||
+ | |- | ||
+ | ||0 ||0 ||0 ||0 ||0 ||0 ||0 ||0 | ||
+ | |} | ||
+ | |||
+ | ===Data Meaning=== | ||
+ | ====Control Rights Switching==== | ||
+ | * 0: LED control performed by microcomputer | ||
+ | * 1: LED control performed by CPU | ||
+ | ====Switching on/off==== | ||
+ | * 0: Switch LED off | ||
+ | * 1: Light LED | ||
+ | ====Flash Switching==== | ||
+ | * 0: Do not flash LED | ||
+ | * 1: Flash LED | ||
+ | |||
+ | ==LED brightness== | ||
+ | ===Command=== | ||
+ | {| | ||
+ | |- | ||
+ | ||0×00 || First operand 0×80 read | ||
+ | |- | ||
+ | ||0x3a ||Second operand | ||
+ | |} | ||
+ | |||
+ | ===Data=== | ||
+ | {|class=wikitable | ||
+ | |- | ||
+ | ||bit7 ||bit6 ||bit5 ||bit4 ||bit3 ||bit2 ||bit1 ||bit0 | ||
+ | |- | ||
+ | |colspan=4|0 | ||
+ | |colspan=4 |LED Illumination | ||
+ | |} | ||
+ | ===Data Meaning=== | ||
+ | ====LED Illumination==== | ||
Setting possible in the 0-0xf range | Setting possible in the 0-0xf range | ||
− | 0×0= Off | + | * 0×0 = Off |
− | 0×f = Maximum illumination | + | * 0×f = Maximum illumination |
− | + | ==HDD Power control== | |
− | + | ===Command=== | |
− | 0×00 First operand 0×80 (read) | + | {| |
− | 0X3b Second operand | + | |- |
− | + | ||0×00 ||First operand 0×80 (read) | |
− | + | ||0X3b ||Second operand | |
− | 0 0 0 HDD | + | |} |
− | + | ||
− | + | ===Data=== | |
− | + | {|class=wikitable | |
− | HEX mnemonic | + | |- |
− | 0x00 ACK Good | + | ||bit7 ||bit6 ||bit5 ||bit4 ||bit3 ||bit2 ||bit1 ||bit0 |
− | 0xF1 OVER_RUN UART physical layer error Physical layer buffer | + | |- |
− | over | + | | colspan =4| |
− | 0xF2 FRAMING_ERR UART physical layer error Physical layer frame | + | ||0 || 0 ||0 ||HDD |
− | error | + | |} |
− | 0xF3 PARITYERROR UART physical layer error Physical layer parity | + | |
− | error | + | =ACK/NACK List= |
− | 0xF4 Invalid_COM Command does not exist | + | |
− | 0xF5 Com_len_err Command and data payload values do not | + | {|class=wikitable |
− | correspond | + | |- |
− | 0xF6 RX_BUFF_OVER Payload larger than 32 bytes specified. | + | !| HEX |
− | 0xF7 DATA_PARITY_ERROR Data parity is wrong. | + | !| mnemonic |
+ | |- | ||
+ | || 0x00 || ACK ||Good | ||
+ | |- | ||
+ | || 0xF1 ||OVER_RUN ||UART physical layer error Physical layer buffer over | ||
+ | |- | ||
+ | ||0xF2 || FRAMING_ERR ||UART physical layer error Physical layer frame error | ||
+ | |- | ||
+ | ||0xF3 ||PARITYERROR ||UART physical layer error Physical layer parity error | ||
+ | |- | ||
+ | ||0xF4 ||Invalid_COM ||Command does not exist | ||
+ | |- | ||
+ | ||0xF5 ||Com_len_err|| Command and data payload values do not correspond | ||
+ | |- | ||
+ | ||0xF6 ||RX_BUFF_OVER|| Payload larger than 32 bytes specified. | ||
+ | |- | ||
+ | ||0xF7 ||DATA_PARITY_ERROR|| Data parity is wrong. | ||
+ | |} | ||
+ | |||
+ | =References= | ||
+ | * [http://www.kurobox.com/downloads/KuroboxPro/Microcomputer%20Communication%20Specifications.pdf Kurobox Pro microprocessor interface specifications] |
Latest revision as of 19:25, 29 August 2007
Contents
Contents
- 1 Contents
- 2 Functions
- 3 UART Communication with Main CPU
- 3.1 Transmission System
- 3.2 Communication with Main CPU
- 3.3 Protocol
- 3.4 ACK/NACK List
- 3.5 Command
- 3.6 Buzzer ON/OFF
- 3.7 Buzzer pitch
- 3.8 System Watchdog
- 3.9 Temperature Read
- 3.10 SW Read
- 3.11 LED Display
- 3.12 LED brightness
- 3.13 HDD Power control
- 4 ACK/NACK List
- 5 References
Functions
Overview of Functions
Communicates with the main CPU via UART. The main functions are shown below.
- Power SW monitoring
- Initialization SW monitoring
- Power control
- Temperature measurement
- Buzzer control
- Watchdog function (However, watchdog function is disabled on u-boot)
- LAN ACT monitoring
- LED display
- Reset sequence generation
- LED Illumination
UART Communication with Main CPU
Transmission System
UART Basic Settings
- Transmission speed: 38400bps
- Data bit: 8bit
- Parity: Even
- Stop bit: 1 bit or more
Communication with Main CPU
- Basic communication is performed by the transmission of commands, data, and parity.
- When switches etc are pressed, a level interrupt occurs. The interrupt is cleared when reporting to the CPU is completed.
- If many frame errors occur, regulate the guard time on the main CPU.
Protocol
Preamble
The receive buffer is completely cleared by sending FF 35 times.
Main CPU -> Microcomputer
Data Payload 0 Bytes
1 | Transfer
direction (BIT7) |
Data payload (0) |
2 | Command | |
3 | Parity 0-(byte1+byte2) |
Data Payload n bytes
1 | Transfer
direction (BIT7) |
Data payload () |
2 | Command | |
3 | Data 0 | |
• • | ||
n-1 | Data n | |
n | Parity 0 - Σ(byte 1 to byte n-1) |
Microcomputer -> Main CPU
Responses to commands other than the read command (when data does not exist)
1 | 0
(BIT7) |
Data payload (1) |
2 | Sent command | |
3 | ACK | |
4 | Parity 0-(byte1+byte2+byte3) |
Response to read command
1 | 0
(BIT7) |
Data payload (N) |
2 | Sent command | |
3 | Data 1 | |
n-1 | Data N | |
n | Parity 0 - Σ(byte 1 to byte n-1) |
Response when communication error occurs
1 | 0
(BIT7) |
Data payload (1) |
2 | Sent command | |
3 | NACK | |
4 | Parity 0-(byte1+byte2+byte3) |
ACK/NACK List
HEX | mnemonic | |
---|---|---|
0x00 | ACK | Good |
0xF1 | OVER_RUN | UART physical layer error Physical layer buffer over |
0xF2 | FRAMING_ERR | UART physical layer error Physical layer frame error |
0xF3 | PARITYERROR | UART physical layer error Physical layer parity error |
0xF4 | Invalid_COM | Command does not exist |
0xF5 | Com_len_err | Command and data payload values do not correspond |
0xF6 | RX_BUFF_OVER | Payload larger than 32 bytes specified. |
0xF7 | DATA_PARITY_ERROR | Data parity is wrong. |
Write Command
LED Lighting control etc Command Micro- computer CPU DATA0 DATA1 DATAn(MAX31) PARITY Switch to data transfer phase Switch to command phase Command (OPCODE) ACK Command Command 2nd byte PARITY
Read Command
Temperature read by CPU DATA0 DATA1 DATAn(MAX31) PARITY Command (OPCODE) PARITY Command CPU Micro- computer Switch to data transfer phase Switch to command phase
Interrupt + Read Command
SW Micro- computer DATA0 DATA1 DATAn(MAX31) PARITY Interrupt assert Interrupt negate Switch to data transfer phase Switch to command phase Command (OPCODE) PARITY Command CPU
Command
Command Construction
The command is a 2 byte command.
Write (CPU -> Microcomputer)
bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 |
0 | 0 | Length |
bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 |
OPCODE |
Read (Microcomputer -> CPU)
bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 |
1 | 0 |
bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 |
OPCODE |
Command List
Commands with no data payload
Command | Command name | Microcomputer operation | |
---|---|---|---|
1Byte | 2Byte | ||
FF | --- | NOP | Used in preamble |
0x00 | 0x02 | BOOT_START | Boot starts, CPU sends this command at the start. If
this command is not received within 10 seconds after reset, power does not go on. This is displayed during boot. |
0x00 | 0x03 | BOOT_END | The boot display is completed, and the device
operates normally. If this command is not received within 5 minutes, power goes off. |
0x00 | 0x06 | POFF | Power switches off. |
0x00 | 0x0C | SHUT_DOWN_WAIT | SHUT DOWN preparations |
0x00 | 0x0D | SHUT_DOWN_WAIT_N | Cancel SHUT DOWN preparations |
0x00 | 0x0E | REBOOT | REBOOT (system reset) start |
Data Payload 1 Byte Command
Command | Command name | Microcomputer operation | |
---|---|---|---|
1Byte | 2Byte | ||
0x01 | 0x30 | BZ_ON | Buzzer sounds.Buzzer control, with fine selection of
whether to sound for 1 byte of data |
-------- | |||
0x01 | 0x33 | FANSPEED_CTL | FAN speed can be selected.0 Stopped 3 Maximum
Settings above 3 (only enabled for lower 2 bits) |
0x80 | |||
0x01 | 0x35 | SYSTEM_WDT | Performs clear and settings for system
watchdog. |
0x80 | |||
0x37 | TEMP | Obtains the temperature.Receivable data is in Centigrade | |
0x80 | |||
0x38 | FANSPEED | Obtains fan speed informationDouble the number of FAN revolutions in 3
seconds is displayed. rpm= (obtained data) ×10. | |
0x80 | |||
0x01 | 0x3a | LED_BRIGHT | Adjusts the brightness of the current LED |
0x80 | |||
0x01 | 0x3b | HDD_POWER | Controls the HDD power supply |
0x80 | |||
0x3c | MAIN_STATUS | Obtains the STATUS of the microcomputer | |
0x80 |
Data Payload 2 Byte Command
Command | Command name | Microcomputer operation | |
---|---|---|---|
1Byte | 2Byte | ||
0x02 | 0x50 | LED_CPU_MCON | Switches LED between main CPU controland microcomputer control. |
0x80 | |||
0x02 | 0x51 | LED_ON_OFF | Controls whether the LED is on or off |
0x80 | |||
0x02 | 0x52 | LED_BLINK | Selects the LED for LED flashing display |
0x80 | |||
0x02 | 0x53 | BZ_FREQ | Buzzer frequency settings |
0x80 | |||
0x02 | 0x54 | LED_PATTERN | Controls LED flashing |
0x80 |
Buzzer ON/OFF
Command
0×01 | First operand read 0×80 |
0×30 | Second operand |
Data
0×00 | Stop the sound |
0×01 | [Pi-po] |
0×02 | [Pi] |
0×03 | Continuous sound [Piiiii-] |
0×04 | Sounds every 0.3 seconds |
0×10 | Repeats sounding for 0.5 seconds then stopping for 0.3 seconds. |
0×20 | [Pi-po-pa-po] |
Buzzer pitch
Command
0×02 | First operand setting |
0×80 | First operand reading of settings. |
0×53 | Second operand |
Data 0
Frequency settings lower order
Data 1
Frequency settings upper order
Relationship between sound pitch and frequency
A | A# | B | C | C# | D | D# | E | F | F# | G | G# |
---|---|---|---|---|---|---|---|---|---|---|---|
55 | 58 | 62 | 65 | 69 | 73 | 78 | 82 | 87 | 92 | 98 | 104 |
110 | 117 | 123 | 131 | 139 | 147 | 156 | 165 | 175 | 185 | 196 | 208 |
220 | 233 | 247 | 262 | 277 | 294 | 311 | 330 | 349 | 370 | 392 | 415 |
440 | 466 | 494 | 523 | 554 | 587 | 622 | 659 | 698 | 740 | 784 | 831 |
880 | 932 | 988 | 1047 | 1109 | 1175 | 1245 | 1319 | 1397 | 1480 | 1568 | 1661 |
1760 | 1865 | 1976 | 2093 | 2217 | 2349 | 2489 | 2637 | 2794 | 2960 | 3136 | 3322 |
Relationship between values set on microcomputer and sound pitch
A | A# | B | C | C# | D | D# | E | F | F# | G | G# |
---|---|---|---|---|---|---|---|---|---|---|---|
FC04 | F062 | E273 | D60A | C852 | BE8C | B399 | A9D6 | 9F70 | 963D | ||
8E0B | 858C | 7F08 | 7746 | 7068 | 6A4A | 6429 | 5EB2 | 5949 | 5475 | 4FB8 | 4B1E |
4705 | 430F | 3F42 | 3BA3 | 3868 | 3525 | 323D | 2F59 | 2CC5 | 2A3A | 27DC | 25A6 |
2382 | 2187 | 1FA1 | 1DE0 | 1C34 | 1A9E | 191E | 17B5 | 1662 | 151D | 13EE | 12CD |
11C1 | 10C3 | 0FD0 | 0EEC | 0E16 | 0D4C | 0C8C | 0BD8 | 0B2F | 0A8E | 09F7 | 0968 |
08E0 | 0860 | 07E8 | 0777 | 070C | 06A6 | 0647 | 05EC | 0597 | 0547 | 04FB | 04B4 |
3F4 | |||||||||||
1FA | |||||||||||
FD |
System Watchdog
Command
0×01 | First operand read 0×80 when setting |
0×35 | Second operand |
Data
Set the time until the power goes OFF for forced OFF. You can set up to 255 seconds.
However, setting to 0 will cause the system watchdog to stop and not operate.
If read is performed, the time for the watchdog to operate is displayed.
0×FF – (time to shutdown) = Setting value
Temperature Read
Command
0×80 | First Operand (read only) |
0×37 | Second operand |
Data
The temperature on the board can be read.
The read data is signed char.
The data is from -55°C to 125°C.
SW Read
Command
0x80 | First Operand (read only) |
0×36 | Second operand |
Data
bit7-bit4 | bit4 | bit3 | bit2 | bit1 | bit0 |
0 | 1 | F_INIT_SW | 1 | 1 | Power SW |
If SW or INITSW is pressed, an interrupt occurs. You can research the cause of an
interrupt by reading the SW.
Reading this resistor clears the interrupt.
- If the SW is released at the point when read is started, the value returns to 1. Therefore,
measure the pressed time on the CPU to judge.
bit4: | Always 1 |
bit3: | 0 when INIT_SW is pressed |
bit2: | Always 1 |
bit1: | Always 1 |
bit0: | Power_SW 0 when Power_SW is pressed |
LED Display
Command
First operand
0×01 | First operand 0×80 (read) |
Second operand
- Switching LED control rights: 0×50
- Switching LED on/off: 0×51
- Flash LED: 0×52
Data
DATA0
bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 |
0 | 0 | 0 | 0 | LINK | DIAG | INFO | Power |
DATA1
bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Data Meaning
Control Rights Switching
- 0: LED control performed by microcomputer
- 1: LED control performed by CPU
Switching on/off
- 0: Switch LED off
- 1: Light LED
Flash Switching
- 0: Do not flash LED
- 1: Flash LED
LED brightness
Command
0×00 | First operand 0×80 read |
0x3a | Second operand |
Data
bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 |
0 | LED Illumination |
Data Meaning
LED Illumination
Setting possible in the 0-0xf range
- 0×0 = Off
- 0×f = Maximum illumination
HDD Power control
Command
0×00 | First operand 0×80 (read) | 0X3b | Second operand |
Data
bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 |
0 | 0 | 0 | HDD |
ACK/NACK List
HEX | mnemonic | |
---|---|---|
0x00 | ACK | Good |
0xF1 | OVER_RUN | UART physical layer error Physical layer buffer over |
0xF2 | FRAMING_ERR | UART physical layer error Physical layer frame error |
0xF3 | PARITYERROR | UART physical layer error Physical layer parity error |
0xF4 | Invalid_COM | Command does not exist |
0xF5 | Com_len_err | Command and data payload values do not correspond |
0xF6 | RX_BUFF_OVER | Payload larger than 32 bytes specified. |
0xF7 | DATA_PARITY_ERROR | Data parity is wrong. |