【正文】
附錄A ATmega8The AVR core bines a rich instruction set with 32 general purpose working the 32 registers are directly connected to the Arithmetic Logic Unit (ALU),allowingtwo independent registers to be accessed in one single instruction executed in one resulting architecture is more code efficient while achieving throughputs up toten times faster than conventional CISC microcontrollers.The ATmega8 provides the following features:8K bytes of InSystem Programmable Flash with ReadWhileWrite capabilities,512 bytes of EEPROM,1K byte of SRAM,23general purpose I/O lines,32 general purpose working registers, three flexibleTimer/Counters with pare modes, internal and external interrupts, a serial programmableUSART, a byte oriented Twowire Serial Interface, a 6channel ADC (eightchannels in TQFP and MLF packages) where four (six) channels have 10bit accuracyand two channels have 8bit accuracy, a programmable Watchdog Timer with InternalOscillator, an SPI serial port, and five software selectable power saving modes. The Idlemode stops the CPU while allowing the SRAM, Timer/Counters, SPI port, and interruptsystem to continue functioning. The Powerdown mode saves the register contents butfreezes the Oscillator, disabling all other chip functions until the next Interrupt or Hardware Reset. In Powersave mode, the asynchronous timer continues to run, allowing the user to maintain a timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules except asynchronous timer andADC, to minimize switching noise during ADC conversions. In Standby mode, the crystal resonator Oscillator is running while the rest of the device is sleeping. This allows very fast startup bined with lowpower consumption.The device is manufactured using Atmel’s high density nonvolatile memory Flash Program memory can be reprogrammed InSystem through an SPI serial interface, by a conventional nonvolatile memory programmer, or by an Onchip boot program running on the AVR core. The boot program can use any interface to download the application program in the Application Flash memory. Software in the Boot Flash Section will continue to run while the Application Flash Section is updated, providing true ReadWhileWrite operation. By bining an 8bit RISC CPU with InSystem SelfProgrammable Flash on a monolithic chip, the Atmel ATmega8 is a powerful microcontroller that provides a highlyflexible and costeffective solution to many embedded control applications.The ATmega8 AVR is supported with a full suite of program and system development tools, including C pilers, macro assemblers, program debugger/simulators, InCircuit Emulators, and eval