Difference between revisions of "Microcontroller"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
(AVR Commands)
m (Features)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== AVR Commands ==
+
[[Image:Atmel_AVR_AT90S2313-4SC.jpg|thumb|right|The Kurobox's AVR Microcontroller]]
 +
The Kurobox and the Kurobox HG use an Atmel AVR AT90S2313-4SC microcontroller.
  
The AVR controls the hardware of the Kurobox, such as the power button and LEDs.
+
== Features ==
It is connected to /dev/ttyS1.
+
* 2K bytes of Flash Memory
To control the hardware, send commands to it.
+
* 128 bytes of EEPROM!
 +
* 128 bytes of Internal Ram
 +
* 15 I/O lines
 +
* one 8-bit timer/counter
 +
* one 16-bit timer/counter
 +
* Full Duplex UART
 +
* 10-bit PWM
 +
* Analog Comparator
 +
* on chip oscillator and clock circuitry
  
When you push the power button or initialize button, a corresponding command is send to the AVR by the ppc_uartd daemon.
+
== AVR Commands ==
  
See here for a description on how to run the kurobox [[Survive_without_ppc_uartd|without ppc_uartd ]]
+
The AVR controls the Kurobox hardware, such as the power button and LEDs. The AVR is connected to /dev/ttyS1 and can be controlled by sending commands directly to it.
  
== Sending commands to the AVR==
+
The power button on the front of the case, and the red button on the rear of the case also send commands to the AVR, and is controlled by the ppc_uartd daemon. However, it is possible to control the Kurobox without the ppc_uartd daemon
To send commands to the AVR,  
+
*[[Survive_without_ppc_uartd|replacement scripts]].
linkstation # echo -n "commands" > /dev/ttyS1
+
*[[Debian_avr_evtd|replacement program, avr_evtd]]
  
{| style="border-collapse:collapse"
+
=== HOWTO Send AVR Commands ===
|+'''Listof known commands'''
+
To send commands to the AVR, use the syntax below. Replace ''command'' with a valid AVR command.
 +
# echo -n "''command''" > /dev/ttyS1
 +
 
 +
=== List of Known AVR Commands ===
 +
{| border="1" cellpadding="3"
 +
! Command !! Resp !! Comments
 
|-
 
|-
| style="background:silver;"|'''Command'''
+
| \30\30\30\30 || ? || Sent by ''/www/script/melsub_diskcheck.sh''.
| style="background:silver;"|'''Resp'''
+
| style="background:silver;"|'''Comments'''
+
 
|-
 
|-
| \30\30\30\30 || ? || Send by /www/script/melsub_diskcheck.sh 
+
| [[[[ || OK || POWER LED starts slow blinking..
 
|-
 
|-
| style="background:silver;"|[[[[
+
| ]]]] || OK || Cooling fan high-speed rotation.
| style="background:silver;"|OK  
+
| style="background:silver;"|POWER LED blinks slowly.
+
 
|-
 
|-
|]]]] ||OK ||A cooling fan begins high-speed rotation.
+
| \\\\ || OK || Cooling fan low-speed rotation.
 
|-
 
|-
| style="background:silver;"|\\\\
+
| >>>> || ? || Sent by ''ppc_uartd'' at boot.
| style="background:silver;"|OK
+
| style="background:silver;"|A cooling fan begins low-speed rotation.
+
 
|-
 
|-
|>>>> ||? ||ppc_uartd sends them on boot.
+
| AAAA || ? || Sent by ''ppc_uartd'' at boot.
 
|-
 
|-
| style="background:silver;"|AAAA
+
| CCCC || OK || Sent by ''reboot'' before shutdown -r now / reboot.
| style="background:silver;"|?
+
| style="background:silver;"|ppc_uartd sends them on boot.
+
 
|-
 
|-
|CCCC ||OK ||reboot send them before shutdown -r now / reboot.
+
| EEEE || OK || Sent by ''shutdown'' before shutdown -h now.
 
|-
 
|-
| style="background:silver;"|EEEE
+
| FFFF || ? || Sent by ''ppc_uartd'' at boot.
| style="background:silver;"|OK
+
| style="background:silver;"|shutdown send them before shutdown -h now.
+
 
|-
 
|-
|FFFF ||? ||ppc_uartd sends them on boot.
+
| JJJJ || ? || Sent by ''ppc_uartd'' at boot.
 
|-
 
|-
| style="background:silver;"|JJJJ
+
| KKKK || ? || Sent by ''ppc_uartd'' at boot.
| style="background:silver;"|?  
+
| style="background:silver;"|ppc_uartd sends them on boot.
+
 
|-
 
|-
|KKKK ||? ||ppc_uartd sends them on boot.
+
| QQQQ || ? || Sent by ''ppc_uartd'' on timed intervals.
 
|-
 
|-
| style="background:silver;"|QQQQ
+
| RRRR || ? || Clear flash memory end.
| style="background:silver;"|?  
+
| style="background:silver;"|ppc_uartd sends them on set timer.
+
 
|-
 
|-
|RRRR ||? ||end of clear flash memory.
+
| SSSS || ? || Clear flash memory start.
 
|-
 
|-
| style="background:silver;"|SSSS
+
| TTTT || OK || Flash memory update complete. Stop blinking POWER, DISK FULL and DIAG LED.
| style="background:silver;"|?
+
| style="background:silver;"|start of clear flash memory.
+
 
|-
 
|-
|TTTT ||OK ||finish update flash memory stop blinking POWER, DISK FULL and DIAG LED.
+
| UUUU || OK || Flash memory update begin. Start blinking POWER, DISK FULL and DIAG LED.
 
|-
 
|-
| style="background:silver;"|UUUU
+
| VVVV || OK || Turn off DISK FULL LED.
| style="background:silver;"|OK  
+
| style="background:silver;"|Start update flash memory start blinking POWER, DISK FULL and DIAG LED.
+
 
|-
 
|-
| VVVV ||OK ||Turn off DISK FULL LED
+
| WWWW || OK || Turn on DISK FULL LED.
 
|-
 
|-
| style="background:silver;"|WWWW
+
| XXXX || OK || DISK FULL LED stops blinking
| style="background:silver;"|OK  
+
| style="background:silver;"|Turn on DISK FULL LED  
+
 
|-
 
|-
| XXXX ||OK ||DISK FULL LED stops blinking
+
| YYYY || OK || DISK FULL LED starts blinking
 
|-
 
|-
| style="background:silver;"|YYYY
+
| ZZZZ ||OK || POWER LED stops slow blinking.
| style="background:silver;"|OK  
+
| style="background:silver;"|DISK FULL LED starts blinking
+
 
|-
 
|-
| ZZZZ ||OK || POWER LED stops blinking slowly.
+
| gggg || OK || DIAG LED blinks 3 times (partition error), then shutdown.
 
|-
 
|-
| style="background:silver;"|gggg
+
| iiii || OK || DIAG LED blinks 4 times (cooling fan error), then shutdown.
| style="background:silver;"|OK  
+
| style="background:silver;"|DIAG LED starts 3 times blink(partition error) and shutdown.
+
 
|-
 
|-
| iiii ||OK ||DIAG LED starts 4 times blink(problem in the cooling fan) and shutdown.
+
| kkkk || OK || DIAG LED blinks 5 times ([[Flash ROM]] error), then cut power (not shutdown).
 
|-
 
|-
| style="background:silver;"|kkkk
+
| mmmm || OK || DIAG LED blinks 6 times (hard drive error), then shutdown.
| style="background:silver;"|OK  
+
| style="background:silver;"|DIAG LED starts 5 times blink(problem in the flash memory) and cut power(not shutdown).
+
 
|-
 
|-
| mmmm ||OK ||DIAG LED starts 6 times blink(problem in the hard drive) and shutdown. 
+
| oooo || OK || DIAG LED starts 7 times blink ([[RAM]], [[Ethernet Controller]], or [[IDE Host Controller]] error) and shutdown.
|-
+
|  style="background:silver;"|oooo  
+
| style="background:silver;"|OK  
+
| style="background:silver;"|DIAG LED starts 7 times blink(problem in RAM/LAN/HDD controller) and shutdown.
+
 
|}
 
|}
  
Source:[http://www.yamasita.jp/linkstation.en/avr.html AVR commands]
+
Source: [http://www.yamasita.jp/linkstation.en/avr.html AVR commands]
 +
 
 +
==See Also==
 +
* [http://www.atmel.com/dyn/resources/prod_documents/doc0839.pdf Atmel AVR AT90S2313-4SC Official Data Sheet]
 +
 
 +
[[Category:Hardware]]

Latest revision as of 05:23, 9 July 2006

File:Atmel AVR AT90S2313-4SC.jpg
The Kurobox's AVR Microcontroller

The Kurobox and the Kurobox HG use an Atmel AVR AT90S2313-4SC microcontroller.

Contents

Features

  • 2K bytes of Flash Memory
  • 128 bytes of EEPROM!
  • 128 bytes of Internal Ram
  • 15 I/O lines
  • one 8-bit timer/counter
  • one 16-bit timer/counter
  • Full Duplex UART
  • 10-bit PWM
  • Analog Comparator
  • on chip oscillator and clock circuitry

AVR Commands

The AVR controls the Kurobox hardware, such as the power button and LEDs. The AVR is connected to /dev/ttyS1 and can be controlled by sending commands directly to it.

The power button on the front of the case, and the red button on the rear of the case also send commands to the AVR, and is controlled by the ppc_uartd daemon. However, it is possible to control the Kurobox without the ppc_uartd daemon

HOWTO Send AVR Commands

To send commands to the AVR, use the syntax below. Replace command with a valid AVR command.

# echo -n "command" > /dev/ttyS1

List of Known AVR Commands

Command Resp Comments
\30\30\30\30  ? Sent by /www/script/melsub_diskcheck.sh.
[[[[ OK POWER LED starts slow blinking..
]]]] OK Cooling fan high-speed rotation.
\\\\ OK Cooling fan low-speed rotation.
>>>>  ? Sent by ppc_uartd at boot.
AAAA  ? Sent by ppc_uartd at boot.
CCCC OK Sent by reboot before shutdown -r now / reboot.
EEEE OK Sent by shutdown before shutdown -h now.
FFFF  ? Sent by ppc_uartd at boot.
JJJJ  ? Sent by ppc_uartd at boot.
KKKK  ? Sent by ppc_uartd at boot.
QQQQ  ? Sent by ppc_uartd on timed intervals.
RRRR  ? Clear flash memory end.
SSSS  ? Clear flash memory start.
TTTT OK Flash memory update complete. Stop blinking POWER, DISK FULL and DIAG LED.
UUUU OK Flash memory update begin. Start blinking POWER, DISK FULL and DIAG LED.
VVVV OK Turn off DISK FULL LED.
WWWW OK Turn on DISK FULL LED.
XXXX OK DISK FULL LED stops blinking
YYYY OK DISK FULL LED starts blinking
ZZZZ OK POWER LED stops slow blinking.
gggg OK DIAG LED blinks 3 times (partition error), then shutdown.
iiii OK DIAG LED blinks 4 times (cooling fan error), then shutdown.
kkkk OK DIAG LED blinks 5 times (Flash ROM error), then cut power (not shutdown).
mmmm OK DIAG LED blinks 6 times (hard drive error), then shutdown.
oooo OK DIAG LED starts 7 times blink (RAM, Ethernet Controller, or IDE Host Controller error) and shutdown.

Source: AVR commands

See Also