Showing posts with label Mikrokontroller. Show all posts
Showing posts with label Mikrokontroller. Show all posts

Saturday, February 10, 2018

Dasar Pemrograman LCD 2×16 Menggunakan CV AVR

LCD yang paling banyak digunakan saat ini ialah tipe M1632 karena harganya cukup murah. LCD M1632 merupakan modul LCD dengan tampilan 2×16 (2 baris x 16 kolom) dengan konsumsi daya rendah. Modul tersebut dilengkapi dengan mikrokontroler yang didesain khusus untuk mengendalikan LCD.

Untuk rangkaian interfacing, LCD tidak banyak memerlukan komponen pendukung. Hanya diperlukan satu variable resistor untuk memberi tegangan kontras pada matriks LCD. Dengan menggunakan CodeVision AVR, pemrograman untuk menampilkan karakter atau string ke LCD sangat mudah karena didukung library yang telah disediakan oleh CodeVision AVR itu sendiri. Kita tidak harus memahami karakteristik LCD secara mendalam, perintah tulis dan inisialisasi sudah disediakan oleh library dari CodeVision AVR
Pemrograman
Buat proyek baru pada CV AVR. Setting chip AVR ATmega8535 dan clock 11.059200 MHz, kemudian setting bagian LCD seperti gambar berikut:
Setelah itu Generate file, save, and exit.
Perhatikan blok-blok program berikut:
...
// Alphanumeric LCD Module functions
#asm
   .equ __lcd_port=0x15 ;PORTC
#endasm
#include 
...
Arti dari blok instruksi diatas adalah setting LCD di PORT C yang kemudian akan me-link ke library lcd.h yang didalamnya terdapat instruksi-instruksi untuk akses LCD secara langsung.
Untuk inisialisasi cukup dengan instruksi berikut:
...
// LCD module initialization
lcd_init(16);
...
Instruksi-Instruksi Di Library LCD
unsigned char lcd_init(unsigned char lcd_columns);
Instruksi ini berfungsi untuk inisialisasi LCD kemudian dilanjutkan dengan penghapusan tampilan LCD dan menempatkan posisi kursor di kolom 0 baris 0. lcd_columns harus memiliki nilai yang sesuai dengan tipe LCD, missal 16. Fungsi ini harus dipanggil pertama kali sebelum memanggil fungsi-fungsi LCD yang lain.
Contoh:
Lcd_init(16);
unsigned char lcd_read_byte(unsigned char addr);
Instruksi ini membaca karakter dari RAM LCD.
Contoh:
Ch=lcd_read_byte(0x10);
void lcd_clear(void);
Instruksi ini akan menghapus tampilan LCD dan menempatkan kursor di kolom 0 dan baris 0
Contoh:
lcd_clear();
void lcd_gotoxy(unsigned char x, unsigned char y);
Instruksi ini untuk menempatkan posisi kursor pada kolom x dan baris y.
Contoh:
lcd_gotoxy(4,1);//menempatkan kursor pada kolom 4 dan baris 1
void lcd_putchar(char c);
Instruksi ini untuk menampilkan karakter pada posisi kursor saat itu.
Contoh:
lcd_gotoxy(5,0);
lcd_putchar(0x41); //menampilkan karakter A
                   //lihat tabel karakter LCD
                   //dapat juga ditulis lcd_putchar(‘A’);
void lcd_putsf(char flash *str);
Instruksi ini berfungsi untuk menampilkan string pada posisi kursor saat itu.
Contoh:
lcd_gotoxy(0,1);
lcd_putsf(“Halo Eko”); //menampilkan string Halo Eko
void lcd_puts(char *str);
Instruksi ini berfungsi untuk menampilkan string yang sebelumnya disimpan di SRAM. Sebelum memanggil instruksi ini, sebelumnya string sudah ditempatkan di SRAM. Instruksi ini memerlukan pustaka stdio.hex .
Contoh:
...
#include 
#include  //tambahkan library
...
//Declare your global variable here
char buf[33];//deklarasi variable untuk menyimpan data string
//LCD module initialization
lcd_init(16);
lcd_gotoxy(0,1);
sprint(buf,”Angka %d”, 14);//menyimpan string ke SRAM
lcd_puts(buf);             //menampilkan ke LCD

READMORE...

CodeVision AVR LED Kedip


AVR Program LED Kedip dan penjelasan:
===================================================================

#include           //ATMega yang digunakan adalah ATMega16
#include               //menggunakan Library delay (waktu tunda)

void main(void)                  //awalan 
{
PORTA=0x00;                    //awalan PORTA adalah 0
DDRA=0xFF;                    //PORTA sebagai output
while (1);
      {
      PORTA = 0xFF;    // menyalakan LED
      delay_ms(100);   // waktu menyala 500ms
      PORTA = 0x00;    // mematikan led
      delay_ms(100);   //waktu mati 500ms   
      }                         //while
}                               //main
==================================================================


 Berikut hasil simulasi program di atas menggunakan Software Proteus




READMORE...

Program Running LED Dengan Software CVAVR Bahasa C++

Skema Running LED yang akan di program menggunakan Software CVAVR  bahasa C++

Program running LED yang di tulis menggunakan software CVAVR



Penjelasan Program :
  • #include untuk memasukan file header
  • DDRx adalah PORTx bisa berupa masukan atau keluaran disini 0xFF(dalam hexa) atau bisa ditulis dengan 0b11111111(dalam biner) semua bit berupa keluaran
  • while(1) merupakan perulangan terus menerus
  • for() digunakan untuk perulangan dimana terdapat nilai awal variabel, syarat berhenti, dan increase atau decrease
  • PORTx merupakan keluaran High(1) atau Low(0)
  • delay_ms merupakan jeda waktu

READMORE...

Tuesday, November 29, 2011

AT89s51-52 and AVR USB Downloader

Microcontroller T89s51, AT89S52 and AVR is an idol among students. Well now because of technology trends and laptop PCs already left the LPT and COM so more and more difficult to download the firmware into the microcontroller, via LPT or COM. Solutions to be overcome with AT89S S-series, because the facility program downloads with the ISP (MISO, MOSI, SCK, RST), then use the ISP downloader which is also commonly used for this AVR microcontroller type. Time to play man with AT89s so much easier via USB without hassle and unplug the IC.
AT89s51-52 and AVR
USB Downloader Circuit

After you finish creating the PCB from the circuit above, then fill it to the ATmega8 with firmware usb51.hex do not forget to set low fuse = EF (SUT0 = 0, others = 1) and high fuse = C9 (SPIEN = 0, CKOPT = 0, BOOTSZ1 = 0, BOOTSZ0 = 0, others = 1). Of course, charging into the ATmega8, firmware downloader tool is needed.

For those who need a filling firmware and more complete information about the USB Downloader please visit http://guru.technosains.com/

READMORE...

Friday, July 16, 2010

Cara Mrogram mikrokontroller AT89S52 Mengunakan Programmer 2.15

Mrogram mikrokontroller AT89S52 Via Programmer 2.15

Programmer 2.15 is a software specifically developed for programming, read, or erase the internal flash memory microcontroller AT89S52, Programmer2.15 also equipped with a text editor that can be used to create the program in 8051 assembler language and compiled directly in to the file hex

Programmer 2.15 windowPic 1. Programmer 2.15 window

How to use Programmer 2.15
  • Programmer2.25 is equipped with a text editor that functions to make programming in assembler language.
  • When finished making your program can compile directly using a shortcut assemblel / compile it (F9), if it found an error from the program list, programmer 2.51 will display an error message, and if there are no errors will appear the message "NO ERRORS FOUND"
  • after the compile process successfully you can directly write down (the download) to the flash memory at8951/52

How to program (to download) to the flash memory AT89S51/52

Assembler program that has been compiled with no errors can be directly in the programming or "the downloaded" to the flash memory AT89S51/52. Programmer 2.15 using parallel port for this download process. Also in need a special interface circuit such as circuit scheme is shown below.

rankaian antarmuka Programmer 2.15
rankaian antarmuka Programmer 2.15Pic 2. rankaian antarmuka Programmer 2.15

Before doing the download process needs to be done beforehand setting process, the setup process is done using a programming menu / setup (See figure 1.) Settings are done to select the parallel port address, memory lock bits mode, and determining conditions RST pin after the download process completed

Pic 3. settings window

Note:
  • Adjust settings such as the picture above
  • LPT1 address customize to your computer
  • Programmer2.15 suitable for programming (download) Microcontroller AT89S51/52
After doing the settings in the process of programming can be done through programflashmemory menu (F2)

READMORE...

Sunday, May 23, 2010

Rangkaian Pengukur Jarak

This circuit Can be Used to Measure distance covered by bicycle using a reed switch as the sensor and use the magnet tied to a wheel. Detection of rolling is then made by a proximity effect, Pls the magnet close to the reed switch. This close / open reed switch contact Can use to make on-off signal. 68HC908QY4 microcontroller function for counting the pulse signal Produced by reed switches, and then Direct display in meter unit through lcd 16 x 1 line LCD

 Pengukur Jarak Prototipe Pengukur Jarak Prototipe

Rangkaian Pengukur JarakSkema rangkaian pengukur jarak

To Interface signals for LCD are D4-D7, RS and E. 4-bit It was interfacing, no busy checking. D0-D3 and R / W # is not Used, so We must tie to GND. Since We Can not check Busy bit, so the delay routine must be ready LCD Used to wait for command and writing data. The sensor inputs are PTA2 for reed switch contact and PTA0 for 0 / +5 V analog input can use a small phone jack for both sensors. in the image below shows a sample sensor and cable making. Later shrinkage tube We need to protect the sensor. The position sensor Pls Pls fix to the bicycle wheel Also Important. We need the magnetic flux perpendicular to the contact.

sensor and cable making

Software/program

Software for write to68HC908QY4 microcontroller is s-record.hex ,which was written by C-language ,the source code is firmware source code.

source http://chaokhun.kmitl.ac.th

READMORE...

Wednesday, May 19, 2010

Rangkaian Line Follower ROBOT Berbasis AT89C2051

This Circuit of Line Follower ROBOT has been getting from VingPeaw Competition Award winner in 2543, the robot built with mikrokontroler AT89C2051, L293D, and four IR sensors. Simple circuit and platform, quick tracking and easy-understand program using C language.

The Line Follower ROBOT designed which use two motors control rear wheels and the single front wheel is free. It has 4-infrared sensors on the bottom for detect black tracking tape, when the sensors detected black color, output of comparator, LM324 is low logic and the other the output is high.

Prototipe Line Follower ROBOT
Prototipe Line Follower ROBOT

Rangkaian Line Follower ROBOT
Microcontroller AT89C2051 and H-Bridge driver L293D were used to control direction and speed of motor.
Position of sensors the robot, left hand side is side view and right hand side is top view
Skema rangkaian Infrared sensors and comparators

Software/program

Software for write to AT89C2051 is robot1.hex ,which was written by C-language ,the source code is robot1.c compiled by using MC51 in TINY model with my start up code robot.asm .

Source: http://www.kmitl.ac.th

READMORE...

Tuesday, May 18, 2010

Rangakaian Downloader Mikrokontroler AVR Menggunakan USB

This circuit is a downloader for Atmel AVR microcontroller. The circuit uses ATMega48 or ATmega8 and a few other passive components. Programmer or a downloader uses a USB-only drive firmware (firmware-only USB driver), does not require a special USB controller.

Rangakaian Downloader Mikrokontroler AVR Menggunakan USBSkema Rangakaian Downloader
Mikrokontroler AVR Menggunakan USB


Features
  • Can be used for a variety of platforms, have been tested for Linux, Mac OS and Windows;
  • Does not require special controllers or smd components;
  • Speeds may reach 5kByte/detik programming;
  • Option SCK to support low-speed microcontroller targets < 1.5 Mhz
Software
  • AVRDUDE USBasp support since version 5.2 - Take AVRDUDE.
  • Khazama AVR - Programmer is an application Windows XP / Vista for USBasp and avrdude.
  • EXtreme Burner - AVR is a Windows GUI software specifically for USB AVR programmer USBasp based, not use AVRDude.

Source

READMORE...

Sunday, May 16, 2010

Rangkaian Thermometer Berbasis Mikrokontroler AT89S52

This is a circuit of a microcontroller AT89S52 Thermometer and 12-bit ADC LTC1298, programs written in the language c program with digital filtering and interface the LED display. The reading provides 0.1C sensitivity.

The hardware block and circuit diagram is shown in Fig below. The sensor is epoxy molded thermistor. The circuit for signal conditioning is a simple voltage divider. The ADC is 12-bit SPI interface LTC1298 analog-to-digital converter. The microcontroller is Atmel 89S52. The display has four digits 0.5 inches 7-segment LED. The segment driver provides 32-bit CMOS output.

Rangkaian Thermometer Berbasis Mikrokontroler AT89S52
Skema Rangkaian Thermometer Berbasis Mikrokontroler AT89S52

Rangkaian Thermometer Berbasis Mikrokontroler AT89S52
Thermometer Block Diagram

The ADC is 12-bit (LTC1298 or MC3202) are two channels, CH0 and CH1. The input signal from thermistor for ADC channel 0 is simple voltage divider. Channel1 is available for other sensor. The sample shown in schematic is HIH-3160 Honeywell Relative Humidity Sensor. The ADC chip is interfaced with MCU, 89S52 with P1.1, P1.2 and P1.3. The display has 4-digit LED. The 4094 CMOS shift register drives the LED directly.


Software

The main function is time triggered by 10ms timer0 running. The ADC is updated on LED every 10 ticks.

while(1)
{
while(!cputick)
continue;
cputick=0;
print_ADC();
}

The function that reads 12-bit data from ADC is read_ADC(char n). The function has two loops. First loop is to send 4-bit command. And the second loop is 12-bit to shift the data from ADC.

sbit Data = P1^1;
sbit CLK = P1^2;
sbit CS = P1^3;


int read_ADC(char n)
{ int k;
char i,channel;
k=0;
CS=0;
if(n==0) channel=0x0d;
else channel=0x0f;

for(i=0;i<4;i++) clk =" 0;" data =" 1;" data =" 0;" clk =" 1;" data =" 1;" clk =" 0;" i="0;i<12;i++)" clk="1;" clk="0;" cs =" 1;">

To provide smooth reading, I added the 5-point moving average to the raw data. The function low_pass_filte1( ) is used to filter the high frequency noise. The reading is calibrated to degree Celsius with Platinum 100 standard thermometer. We found the equation y=0.0323x-15.122.

int low_pass_filter1(void)
{
x5=x4;
x4=x3;
x3=x2;
x2=x1;
x1=read_ADC(0);
return(x1+x2+x3+x4+x5)/5;
}

float read_temp1_filter(void)
{
return(0.0323*low_pass_filter1()-15.122);
}



READMORE...

Sunday, May 09, 2010

Sistem Minimum Mikrokontroler ATmega8535

Minimum System ATmega8535 microcontroller, is the minimum necessary circuits for the operation of the microcontroller IC, then this minimum circuit can be connected with other circuits to perform certain functions. In the AVR microcontroller family, Atmega8535 series is one series that is very widely used.


 Rangkaian Sistem Minimum Mikrokontroler ATmega8535 Skema Rangkaian Sistem Minimum
Mikrokontroler ATmega8535


To make this ATmega8535 microcontroller minimum system required several components, namely:
  • ATmega8535 microcontroller IC
  • 1 XTAL 4 MHz or 8 MHz (XTAL1)
  • 3 paper capacitors, two 22 pF (C2 and C3) and 100 nF (C4)
  • a 4.7 UF electrolytic capacitors (C12) 2 is 100 ohm resistor (R1) and 10 Kohm (R3)
  • 1 reset button pushbutton (PB1
  • DC 5V voltage regulator
Briefly, ATMega8535 has several capabilities:
  • Microcontroller based 8-bit RISC with a maximum speed of 16 MHz.
  • Has 8 KB of flash memory, SRAM and 512 bytes of EEPROM (Electrically Erasable Programmable Read Only Memory) of 512 bytes.
  • Having the ADC (analog converter-to-digital) 10 bit internal precision of 8 channel.
  • Has a PWM (Pulse Wide Modulation) as much as four internal channels.
  • Serial communication port (USART), with maximum speed of 2.5 Mbps.
  • Six options sleep mode, to save the use of electric power.
ATmega8535ATmega8535ATmega8535 Pinning

ATMega8535 microcontroller has 40 pins for the model PDIP. The names of the pins on the microcontroller are
  • VCC for the positive power supply voltage.
  • GND to the negative power supply voltage.
  • Porta (PA0 - PA7) as a port Input / Output and has other capabilities as an input to the ADC is
  • PortB (PB0 - PB7) as a port input / output and also has other capabilities.
  • PortC (PC0 - PC7) as a port Input / Output to ATMega8535.
  • PortD (PD0 - PD7) as a port input / output and also has other capabilities.
  • RESET for resetting the program in the microcontroller.
  • XTAL1 and XTAL2 to input clock signal generator.
  • AVCC for the power supply voltage input pin for the ADC.
  • Aref for ADC reference voltage pin.

READMORE...

Monday, March 22, 2010

Sistem Minimum Mikrokontroler AT89C51|AT89C52

The minimum system is AT89C51/AT89C52 microcontroller electronic circuits the minimum necessary to the operation of microcontroller IC. This circuit can then be connected to other circuits to perform certain functions or can be added with other complementary circuit to become a more complete system and has more functions.

Rangkaian Sistem Minimum Mikrokontroler  AT89C52|AT89C52Rangkaian Sistem Minimum Mikrokontroler
AT89C52|AT89C52

AT89S51/52 microcontroller is the latest version than the AT89C51 microcontroller has been widely used today. AT89S52 microcontroller is a CMOS 8-bit microcomputers with 8KB Flash Programmable and Erasable Read Only Memory (PEROM). Mikrokontroler tech non-volatile memory of the Atmel Cleaner density is, compatible with industry standard microcontroller MCS-51, either pin IC and the instruction set and the price is quite cheap. Therefore, it is precisely when we study this type of microcontroller.

Important specifications owned AT89S52 Microcontroller:
  • Compatible with previous MCS51 microcontroller family
  • 8 K Bytes • In system programmable (ISP) flash memory with capacity 1000 times read / write
  • 4-labor voltage 5.0V
  • Working with a range of 0 - 33MHz
  • Internal RAM 256x8 bits
  • 32 channels of I / 0 may be programmed
  • 3 pieces 16-bit Timer / Counter
  • 8 interrupt sources
  • Full duplex serial channel UART
  • watchdog timer
  • Dual data pointers
  • ISP programming mode flexible (Byte and Page Mode)

Pinning Mikrokontroler AT89C52|AT89C52Pinning Mikrokontroler AT89C52|AT89C52

READMORE...

Saturday, March 20, 2010

Rangkaian Downloader/Programmer AT89S51/AT89S52

Atmel is a product AT89S51/AT89S52 that quite a lot in the market with a price of less than 20 thousand rupiah. To start learning mikrokontroler type 89S51 this we need a programmer And Rangkaian Downloader. Programmer is a hardware device that is used to enter the machine language program code compilation that we write to in mikrokontroler.

Downloader AT89S51/AT89S52
Gambar Skema Rangkaian Downloader AT89S51/AT89S52

picture above shows the circuit diagram of the in-system programmer interface, the power to the interface is provided by the target system. The 74HCT541 ic isolate and buffer the parallel port signals. It is necessary to use the HCT type ic in order to make sure the programmer should also work with 3V type parallel port.

Skema rangkaian downloader ini can be use to program the 89S series devices and the AVR series devices which are pin compatible to 8051, like 90S8515. For other AVR series devices the user can make an adapter board for 20, 28 and 40 pin devices. The pin numbers shown in brackets correspond to PC parallel port
connector.

Software ISP

The ISP-30a.zip file contains the main program and the i / o port driver. Place all files in the same folder. The main screen view of the program is shown in the picture below.


Following are the main features of this software,
  • Read /write the Intel Hex file
  • Read the signature, lock and fuse bits
  • Clear/Fill memory buffer
  • Verify with memory buffer
  • Reload current Hex File
  • Display buffer checksum
  • Program selected lock bits & fuses
  • Auto detection of hardware

READMORE...

Friday, March 19, 2010

Mode Pengalamatan ATMEL AT89S51/AT89S52

Mode Pengalamatan Microcontroller AT89S51/AT89S52

All the family members of ATMEL Microcontroller 89S51/52 have the same instruction set. This instruction set has been optimized for 8-bit control applications, and provide a variety of fast addressing modes for accessing the internal RAM and external RAM

Addressing mode 89S51/52 ATMEL Microcontroller family is as follows

Immediate Addressing

Immediate addressing is so-named because the value to be stored in memory immediately follows the operation code in memory. That is to say, the instruction itself dictates what value will be stored in memory.
Example:
  • MOV A, # 1AH ; Fill in the accumulator with data 1AH
  • MOV DPTR, # 10H ; Fill in the register DPTR with data 10H
  • MOV R1, #30H ; Fill in the register R1 with data 30H

Direct Addressing

Direct addressing is so-named because the value to be stored in memory is obtained by directly retrieving it from another memory location.
Example:
  • MOV A,15H ; Read the data Internal RAM address 15 H and store it in the Accumulator.
  • MOV 90H, A, Read the data Accumulator and store it in the SFR/Port (whose address 90H)

Indirect Addressing

In Indirect Addressing, Operands pointing to a register that contains the memory address location to be used in the operation. To implement the indirect addressing used symbol @. Addressing this type usually used for writing, transfer or reading some data in memory locations. AT89C51 has a 16-bit register (DPTR) which can be used to perform indirect addressing

Example:
  • ADD, A, R1 ; Add data internal RAM which is found at the address indicated by R1 into the data accumulator
  • DEC @ R1 ; Reduce the contents of RAM address indicated by the register R1
  • MOVX, ADPTR, A ; read data Accumulator and store it in the external memory location indicated by DPTR

Bit Addressing

Bit addressing is the appointment of bit locations address both the internal RAM or hardware using the symbol dot (.).
Example:
  • SETB p1.7; Set port 1.7 bits active
  • SETB TR1: Set TR1 (Timer 1 active)

Operator

Operators used to perform action arithmetic, logic shifting bits and others at the Operands. Some operators are available including
Arithmetic operators
  • * For multiplication
  • / For division
  • + For addition
  • - For subtraction
Example: MOV A, # 25H +3 H

Operator Logic
  • Poerasi OR to OR
  • AND to AND operation
  • XOR to XOR operations
  • EXOR for EXOR operation
  • NOT to invert operation
Example: MOV A, # 20H OR 40H; equal to MOV A, # 60H

Special Operations
  • Shr 16 ; bit shift to right
  • SHL 16 ; bit shift to the left
  • HIGH ; bits select the bag
  • LOW ; select the lower bit
  • EQ = equal to
  • NET <> ; is not equal to
  • Fl <= ; less than or equal to · GT> more
  • GE> = ; greater than or equal to

READMORE...

Thursday, March 18, 2010

DAFTAR INSTRUKSI PEMROGRAMAN ASSEMBLY AT89S51/S52

Kelompok Instruksi Aritmatika

ADD A,Rn (Add register to A).
ADD A, (direct Add direct byte to A).
ADD A, @Ri (Add indirect RAM to A).
ADD A,#data (Add immediate data to A).
ADDC A,Rn (Add register to A with Carry).
ADDC A (direct Add direct byte to A with Carry).
ADDC A,@Ri (Add indirect RAM to A with Carry).
ADDC A,#data (Add immediate data to A with Carry).
SUBB A,Rn (Subtract register from A with Borrow).
SUBB A,direct (Subtract direct byte from A with Borrow).
SUBB A,@Ri (Subtract indirect RAM from A with Borrow).
SUBB A,#data (Subtract immediate data from A with Borrow0).
INC A (Increment A).
INC Rn (Increment register).
INC direct (Increment direct byte).
INC @Ri (Increment indirect RAM).
DEC A (Decrement A).
DEC Rn (Decrement register).
DEC direct (Decrement direct byte).
DEC @Ri (Decrement indirect RAM).
INC DPTR (Increment Data Pointer).
MUL AB (Multiply A & B (A x B => BA)).
DIV AB (Divide A by B (A/B => A + B)).
DA A (Decimal Adjust A).


Kelompok Instruksi Logika.

ANL A,Rn (AND register to A).
ANL A,direct (AND direct byte to A).
ANL A,@Ri (AND indirect RAM to A).
ANL A,#data (AND immediate data to A).
ANL direct,A (AND A to direct byte).
ANL direct,#data (AND immediate data to direct byte).
ORL A,Rn OR (register to A).
ORL A,direct (OR direct byte to A).
ORL A,@Ri (OR indirect RAM to A).
ORL A,#data (OR immediate data to A).
ORL direct,A (OR A to direct byte).
ORL direct,#data (OR immediate data to direct byte).
XRL A,Rn (Exclusive-OR register to A).
XRL A,direct (Exclusive-OR direct byte to A).
XRL A,@Ri (Exclusive-OR indirect RAM to A).
XRL A,#data (Exclusive-OR immediate data to A).
XRL direct,A (Exclusive-OR A to direct byte).
XRL direct,#data (Exclusive-OR immediate data to direct byte).
CLR A (Clear A).
CPL A (Complement A).
RL A (Rotate A Left).
RLC A (Rotate A Left through Carry).
RR A (Rotate A Right 1 1
RRC A (Rotate A Right through Carry).
SWAP A (Swap nibbles within A).

Kelompok Instruksi Penyalinan Data.

MOV A,Rn (Move register to A).
MOV A,direct (Move direct byte to A).
MOV A,@Ri (Move indirect RAM to A).
MOV A,#data (Move immediate data to A)
MOV Rn,A (Move A to register).
MOV Rn,direct (Move direct byte to register).
MOV Rn,#data (Move immediate data to register).
MOV direct,A (Move A to direct byte).
MOV direct,Rn (Move register to direct byte).
MOV direct,direct (Move direct byte to direct byte).
MOV direct,@Ri (Move indirect RAM to direct byte).
MOV direct,#data (Move immediate data to direct byte).
MOV @Ri,A (Move A to indirect RAM).
MOV @Ri,direct (Move direct byte to indirect RAM).
MOV @Ri,#data (Move immediate data to indirect RAM).
MOV DPTR,#data16 (Load Data Pointer with 16-bit constant).
MOVC A,@A+DPTR (Move Code byte relative to DPTR to A).
MOVC A,@A+PC (Move Code byte relative to PC to A)
MOVX A,@Ri (Move External RAM (8-bit addr) to A).
MOVX A,@DPTR (Move External RAM (16-bit addr) to A)
MOVX @Ri,A (Move A to External RAM (8-bit addr))
MOVX @DPTR,A (Move A to External RAM (16-bit addr)).
PUSH direct (Push direct byte onto stack).
POP direct (Pop direct byte from stack).
XCH A,Rn (Exchange register with A).
XCH A,direct (Exchange direct byte with A).
XCH A,@Ri (Exchange indirect RAM with A).
XCHD A,@Ri (Exchange low-order Digit indirect RAM with A).

Kelompok Instruksi Bit dan Bit-test.

CLR C (Clear Carry flag).
CLR bit (Clear direct bit).
SETB C (Set Carry flag).
SETB bit (Set direct bit).
CPL C (Complement Carry flag).
CPL bit (Complement direct bit).
ANL C,bit (AND direct bit to Carry flag).
ANL C,/bit (AND complement of direct bit to Carry flag).
ORL C,bit (OR direct bit to Carry flag).
ORL C,/bit (OR complement of direct bit to Carry flag).
MOV C,bit (Move direct bit to Carry flag).
MOV bit,C (Move Carry flag to direct bit).

Kelompok Instruksi Percabangan.

ACALL addr11 (Absolute subroutine call).
LCALL addr16 (Long subroutine call).
RET (Return from subroutine).
RETI (Return from interrupt).
AJMP addr11 (Absolute Jump).
LJMP addr16 (Long Jump).
SJMP rel (Short Jump (relative addr)).
JMP @A+DPTR (Jump indirect relative to DPTR).
JZ rel (Jump if A is Zero).
JNZ rel (Jump if A is Not Zero).
JC rel (Jump if Carry flag is set).
JNC rel (Jump if No Carry flag).
JB bit,rel (Jump if direct Bit is set).
JNB bit,rel (Jump if direct Bit is Not set)
JBC bit,rel (Jump if direct Bit is set & Clear bit).
CJNE A,direct,rel (Compare direct to A & Jump if Not Equal).
CJNE A,#data,rel (Compare immediate to A & Jump if Not Equal).
CJNE Rn,#data,rel (Compare immed. to reg. & Jump if Not Equal).
CJNE @Ri,#data,rel (Compare immed. to ind. & Jump if Not Equal).
DJNZ Rn,rel (Decrement register & Jump if Not Zero).
DJNZ direct,rel (Decrement direct byte & Jump if Not Zero).
NOP (No operation).

READMORE...

Thursday, August 06, 2009

Rangkaian ADC 0804 Mode Free ranning

Rangkaian ADC 0804 Mode Free ranning

Analog to Digital Converter (ADC) is a device that is designed to change analog signals into digital signals. IC ADC 0804 is to work smarter by adding a few components in accordance with the specifications that must be provided and can quickly convert an input voltage. Things that also need to be in the use of ADC ADC 0804 is the maximum voltage that can be converted by the ADC's range of signal, resolution, time an external ADC, the output type, accuracy and time conversions.

Some important characteristics of ADC:
1. Time conversion
2. Resolution
3. ketidaklinieran
4. Accuracy

Skema rangkaian under the ADC is used to change the input analog data into digital 8 bit. ADC is used in the ADC 0804 workplace free running mode.
Rangkaian ADC  Mode Free ranningSkema Rangkaian ADC 0804 Mode Free ranning

To create a working mode ADC 0804 to be free running, it must be known how the sequence of value-at-RD and WR, and changes in the value-intr. The sequence of values in the RD-, WR-changes in the value-Intr shown in the Table.


Working mode free running ADC obtained if -RD and -CS linked to the ground in order to get a logic 0 so that the ADC is always active and ready to provide data. Pin -WR and -Intr made it one because it changes the logic -ITNR same logic to the changes in the WR so that the logic on -WR conducted automatically by the output -intr

Rated voltage input (vx) of an ADC in general can be formulated as follows:

VX = voltage input
Vref = reference voltage

While the resolution of an ADC in general can be formulated as follows:


READMORE...

Wednesday, July 29, 2009

RANGKAIAN DOWNLOADER AVR MIKROKONTROLLER

This is a simple circuit of downloader AVR microcontrollers (Atmega|Attiny ). This circuit can be used to painlessly transfer hex programs to most ATMEL AVR microcontrollers without sacrificing your budget and time. It is more reliable than most other simple AVR downloader programmers available out there and can be built in very short amount of time.

AVR downloader programmer consists of in-circuit serial programmer (dongle) and small pcb with a DIP socket where you can fit your microcontroller and have it quickly downloader programmed.

Entire AVR downloader programmer has been build with using common parts and fits in the case of the serial connector. The socket pcb has been created to fit a 28-DIP AVR ATmega8 microcontroller, but you can build a socket pcb for any other AVR microcontroller out there. This AVR programmer is compatible with a popular PonyProg software that shows you a status bar of the programming progress.
AVR Downloader Mikrokontrolleravr (Atmega|Attiny) Downloader Mikrokontroller

AVR Downloader MikrokontrollerSkema rangkaian Downloader AVR (Atmega|Attiny) mikrokontroller

AVR Downloader MikrokontrollerAVR Downloader Mikrokontroller
Finished AVR (ATmega|Attiny) Downloader Programmer with standard 6-PIN ICSP connector.


Make AVR Socket PCB

Socket PCB consists of the PCB, 28-DIP socket, 4MHz crystal resonator, or crystal with two 22pF decoupling capacitors, and two header connectors. Two-PIN connector supplies +5V voltage to the AVR microcontroller, and 6-PIN ICSP connects to AVR Programmer dongle.

Supplying microcontroller with external +5V voltage as opposed to taking it directly from computer's serial connection port ensures that the chip is receiving exactly +5V voltage and provides very reliable error free programming. +5V voltage supply for AVR mikrokontroller chip may be provided from external power supply or even better - directly from USB connection.

AVR Downloader Mikrokontroller

AVR Downloader MikrokontrollerFinished Socket PCB AVR ATmega8 microcontroller pic

READMORE...

Sunday, July 26, 2009

Rangkaian Saklar|Keypad Matrix AT89S51/52

Rangkaian saklar for mikrokontroler AT89S51/52

Port mikrokontroler AT89S51/52 The complete internal pull-up, a default condition so that it is high. To make this port as input, we live to provide logic high or ignore in the default condition. If we want a legible entries we should use the Low input signal.

In the picture below, when the button on the keypad and press the low signal will be sent to port 3 on mikrokontroler, Thus, this port will have a logic in accordance with the key emphasis

saklar|Keypad MatrikSkema Rangkaia Mikrokontroler dengan masukan Saklar

;---------------------------------------------------------------------
; Simulasi penekanan tombol pd P3.0 untuk menghidupkan
; dan P3.1 untuk mematikan LED pada Port 1
;----------------------------------------------------------------------
ORG 0H
MULAI:
MOV A,P3 ; Baca port 3
CJNE A,#0FEH,TERUS ; Apakah isi akumulator = 11111110B
MOV P1,#000H ; Ya! Hidupkan lampu LED di port 1
SJMP MULAI ; Ulangi lagi dari awal
TERUS:
CJNE A,#0FDH,MULAI ; Apakah isi akumulator = 11111101B
MOV P1,#0FFH ; Ya! Matikan lampu LED di port 1
SJMP MULAI ; Ulangi lagi dari awal
END

program on the work which led to the connects to the port 1, while s1 in press led will be flame and when off in the pressm S2

program on the work, which led to the connects to the port 1, while s1 in press, and led a flame, and when out in the press and S2

How it works, the program:
When the switch connected to P3.0 in the press, the data on the port 3 is 11111110 binary or 0FE Hexa, the program will know the content of the port 3 if data is same (0FE H) Led then switched to the port 1, if any emphasis P3.1 , the data on the port 3 11111101 binary or 0FD Hexa, program will check the content of port 3 if data is found in the Led on the port 1 will be turned off



Rangkaian Keypad Matrix

4 x 4 Keypad is a keypad measuring 4 columns x 4 rows. This module can be enabled as an input in the applications such as digital security, datalogger, attendance, motor speed controllers, robotik, and so forth.

Hardware Specifications
  • Has a 16 button (function button depending on the application).
  • Configuration has 4 lines (input scanning) and column 4 (output scanning).

saklar|Keypad MatrikSkema Rangkaian Mikrokontroler dengan masukan Keypad


;=======================================
; PROGRAM KEYPAD 4X4 DIPASANG
; PADA PORT 0, OUTPUT PADA PORT 1
;=======================================
KOLOM1 BIT P0.0
KOLOM2 BIT P0.1
KOLOM3 BIT P0.2
KOLOM4 BIT P0.3
BARIS1 BIT P0.4
BARIS2 BIT P0.5
BARIS3 BIT P0.6
BARIS4 BIT P0.7
KEYPORT EQU P0 ; KEYPAD CONNECT KE PORT 0
KEYDATA EQU 50H ; MEMORY DATA UNTUK KEYPAD
KEYBOUNC EQU 51H ; MEMORY UNTUK ANTI BOUNCING
ORG 0H
ULANG:
CALL KEYPAD ; PANGGIL SUB RUTIN KEYPAD
MOV A,KEYDATA
CJNE A,#0FFH,DITEKAN
JMP ULANG
DITEKAN:
CPL A
MOV P1,A
DJNZ R0,$
JMP ULANG
KEYPAD:
MOV KEYBOUNC,#100 ; KONSTANTA ANTI BOUNCING
MOV KEYPORT,#0FFH ; PORT KEY PAD
CLR KOLOM1 ; SCAN KOLOM 1
UL1: JB BARIS1,KEY1 ; TOMBOL 1 DITEKAN?
CALL DELAY
DJNZ KEYBOUNC,UL1
MOV KEYDATA,#1 ; ISI REG. DATA DGN 1
RET
KEY1: JB BARIS2,KEY2 ; TOMBOL 2 DITEKAN?
CALL DELAY
DJNZ KEYBOUNC,KEY1
MOV KEYDATA,#4
RET
KEY2: JB BARIS3,KEY3
CALL DELAY
DJNZ KEYBOUNC,KEY2
MOV KEYDATA,#7
RET
KEY3: JB BARIS4,KEY4
CALL DELAY
DJNZ KEYBOUNC,KEY3
MOV KEYDATA,#0AH
RET
KEY4: SETB KOLOM1
CLR KOLOM2
JB BARIS1,KEY5
CALL DELAY
DJNZ KEYBOUNC,KEY4
MOV KEYDATA,#2
RET
KEY5: JB BARIS2,KEY6
CALL DELAY
DJNZ KEYBOUNC,KEY5
MOV KEYDATA,#5
RET
KEY6: JB BARIS3,KEY7
CALL DELAY
DJNZ KEYBOUNC,KEY6
MOV KEYDATA,#8
RET
KEY7: JB BARIS4,KEY8
CALL DELAY
DJNZ KEYBOUNC,KEY7
MOV KEYDATA,#0
RET
KEY8: SETB KOLOM2
CLR KOLOM3
JB BARIS1,KEY9
CALL DELAY
DJNZ KEYBOUNC,KEY8
MOV KEYDATA,#3
RET
KEY9: JB BARIS2,KEY10
CALL DELAY
DJNZ KEYBOUNC,KEY9
MOV KEYDATA,#6
RET
KEY10: JB BARIS3,KEY11
CALL DELAY
DJNZ KEYBOUNC,KEY10
MOV KEYDATA,#9
RET
KEY11: JB BARIS4,KEY12
CALL DELAY
DJNZ KEYBOUNC,KEY11
MOV KEYDATA,#0BH
RET
KEY12: SETB KOLOM3
CLR KOLOM4
JB BARIS1,KEY13
CALL DELAY
DJNZ KEYBOUNC,KEY12
MOV KEYDATA,#0CH
RET
KEY13: JB BARIS2,KEY14
CALL DELAY
DJNZ KEYBOUNC,KEY13
MOV KEYDATA,#0DH
RET
KEY14: JB BARIS3,KEY15
CALL DELAY
DJNZ KEYBOUNC,KEY14
MOV KEYDATA,#0EH
RET
KEY15: JB BARIS4,KEY16
CALL DELAY
DJNZ KEYBOUNC,KEY15
MOV KEYDATA,#0FH
RET
KEY16: MOV KEYDATA,#0FFH
RET
DELAY:
DJNZ R0,$
RET
END

READMORE...

Saturday, June 06, 2009

How to use the ADC 0808/0809

The specification of the ADC0809, total unadjusted error ± 1.2 LSB and ± 1 LSB with the resolution 8 bits, and have a conversion time 100ms and share resources that are used with a +5 volt, power 15mW, with the specifications of the ADC is what the ADC is easy to use interface in different series, just on a series of ADC is the need of adding a series of clock



Configuration of ADC 0808/0809


Configuration of the pin ADC0809 indicated that there were 28 units where the pins of each pin on the ADC function: Pin 8,14,15,17,18,19,20,21 digital data output is a result of conversion of the A DC where the eighth output can be directly connected to the data bus.
and pin 1,2,3,4,5,26,27,28 is the pin input, that there is a 8-pin or 8 input channels, this is the pin on the analog signal is converted will linked, while the pin is a pin 23,24,25 A, B, C that functions as a selector input lines which will be converted, and a pins as well as other ADC0804, so that input can be converted eight following truth table:

Channel yang dipilih

Jalur lamat

IN0

C

B

A

IN1

L

L

L

IN2

L

L

H

IN3

L

H

H

IN4

H

L

L

IN5

H

L

H

IN6

H

H

L

IN7

H

H

H


Truth Table ADC 0809


0809 ADC input must be analog voltage output from the sensor to its magnitude usually ranges from 0-5V.



READMORE...

Sunday, May 17, 2009

Jam Digital berbasis Mikrokontroler AT89s51

Rangkaian Jam Digital berbasis Mikrokontroler AT89s51

Digital hours to make this not too difficult. This series is not my original project, I trace the series of files and program from the internet, there is no chance the program listing. After I download the file to its hex-hour direct way. This clock only displays hours and minutes, to seconds However you can install the led associated with a series of I Hz oscillator formed from IC 555 (which I do, because I do not know the program listing), 2 led in parallel and installed as a bookmark seconds. Led to two installed in the middle of the hours and minutes. Although with the way that seconds and minutes if observed (calculated) decline slightly but I'm not the problem, Moreover people will not know about it. Digital hours following scheme:
Circuit digital watch

To me its PCB design itself, of course are still using my favorite software, PCB designer. Next the PCB layout (look up) :
PCB layout of digital watch


  • PCB file can download it here.
  • Hex file. can be downloaded here.

READMORE...
 
Skema Rangkaian Elektronika