Spesifikasi ATmega8535 Konfigurasi Pin AVR ATmega8535

2.2.1 Spesifikasi ATmega8535

• High-performance, Low-power AVR® 8-bit Microcontroller • Advanced RISC Architecture – 130 Powerful Instructions – Most Single Clock Cycle Execution – 32 x 8 General Purpose Working Registers – Fully Static Operation – Up to 16 MIPS Throughput at 16 MHz – On-chip 2-cycle Multiplier • Nonvolatile Program and Data Memories – 8K Bytes of In-System Self-Programmable Flash Endurance: 10,000 WriteErase Cycles – Optional Boot Code Section with Independent Lock Bits In-System Programming by On-chip Boot Program True Read-While-Write Operation – 512 Bytes EEPROM Endurance: 100,000 WriteErase Cycles – 512 Bytes Internal SRAM – Programming Lock for Software Security • Peripheral Features – Two 8-bit TimerCounters with Separate Prescalers and Compare Modes – One 16-bit TimerCounter with Separate Prescaler, Compare Mode, and Capture Mode – Real Time Counter with Separate Oscillator Universitas Sumatera Utara – Four PWM Channels – 8-channel, 10-bit ADC 8 Single-ended Channels 7 Differential Channels for TQFP Package Only 2 Differential Channels with Programmable Gain at 1x, 10x, or 200x for TQFP Package Only – Byte-oriented Two-wire Serial Interface – Programmable Serial USART – MasterSlave SPI Serial Interface – Programmable Watchdog Timer with Separate On-chip Oscillator – On-chip Analog Comparator • Special Microcontroller Features – Power-on Reset and Programmable Brown-out Detection – Internal Calibrated RC Oscillator – External and Internal Interrupt Sources – Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby and Extended Standby • IO and Packages – 32 Programmable IO Lines – 40-pin PDIP, 44-lead TQFP, 44-lead PLCC, and 44-pad MLF • Operating Voltages – 2.7 - 5.5V for ATmega8535L – 4.5 - 5.5V for ATmega8535 • Speed Grades – 0 - 8 MHz for ATmega8535L Universitas Sumatera Utara – 0 - 16 MHz for ATmega8535

2.2.2. Konfigurasi Pin AVR ATmega8535

Konfigurasi pin-pin Atmega8535 dapat kita lihat pada gambar di bawah ini: Gambar 2.2. Pin-pin ATmega8535 Alternatif PORT A PORT A memiliki fungsi input output dan juga sebagai input analog yang akan dikonversi menjadi data–data digital ADC, seperti yang ditunjukkan pada tabel di bawah. Jika salah satu PORT A dikonfigurasi kan sebagai output ketika PORT A difungsikan sebagai ADC maka hasil pengkonversian analog ke digital akan menghasilkan data error. Universitas Sumatera Utara Untuk mengaktifkan fungsi ADC pada PORT A dengan Code Vision AVR akan dibahas di bab selanjutnya tentang teknik pemrogram C pada ATmega8535 dengan menggunakan software yang telah disebutkan di atas. Fungsi PORT A dapat kita lihat pada tabel di bawah ini: Tabel 2. 2 PORT A Port Fungsi Alternatif PA7 ADC7 ADC input channel 7 PA6 ADC6 ADC input channel 6 PA5 ADC5 ADC input channel 5 PA4 ADC4 ADC input channel 4 PA3 ADC3 ADC input channel 3 PA2 ADC2 ADC input channel 2 PA1 ADC1 ADC input channel 1 PA0 ADC0 ADC input channel 0 Alternatif PORT B Fungsi PORT B dapat dilihat di tabel di bawah ini: Universitas Sumatera Utara Tabel 2. 3 PORT B PORT Fungsi Alternatif PB7 SCKSPI Bus Serial Clock PB6 MISOSPI bus master inputslave output PB5 MOSISPI Bus Master Output Slave Input PB4 SS SPI Slave Select Input PB3 AIN1Analog Comparator Negative Input OCO TIMER COUNTER OUTPUT COMPARATOR MATCH OUTPUT PB2 AIN0 Analog Comparator Positive Input INT2 External Interrupt 2 Input PB1 T1 TimerCounter External Counter Input PB0 T0T1 TimerCounter External Counter Input XCX USART EXTERNAL CLOCK INPUTOUTPUT Alternatif PORT C Fungsi PORT C dapat dilihat pada tabel di bawah ini: Tabel 2. 4 Fungsi PORT C PORTC FUNGSI KHUSUS PC7 TOSC2TIMER OSCILATOR PIN2 PC6 TOSC1TIMER OSCILATOR PIN1 PC5 TDIJTAG TEST DATA IN PC4 TDOJTAG TEST DATA OUT Universitas Sumatera Utara PC3 TMSJTAG TEST MODE SELECT PC2 TCKJTAG TEST CLOCK PC1 SDATWO WIRE SERIAL BUS DATA INOUT LINE PC0 SCLTWO WIRE SERIAL BUS CLOCK LINE Alternatif PORTD Fungsi PORT D dapat dilihat pada tabel di bawah ini: Tabel 2. 5 Fungsi PORT D PIN FUNGSI KHUSUS 7 OC2 TIMER COUNTER2 COMPARE MATCH OUTPUT 6 ICP TIMERCOUNTER1 INPUT COMPARE CAPTURE PIN 5 OC1A TIMERCOUNTER1 OUTPUT COMPARE A MATCH OUT 4 OC1B TIMERCOUNTER OUTPUT COMPARE B MATCH OUTPUT 3 INT1 EXTERNAL INTERRUPT 1 INPUT 2 INT0 EXTERNAL INTERRUPT 0 INPUT 1 TXD USART OUTPUT PIN RXD USART INPUT PIN

2.2.3. Program Memori