Sunday 22 October 2017

akses LCD 2x16 CVAVR

LCD 2x16 CVAVR

Instalasi

instalasi sesuaikan dengan Hardwarnya contoh seperti di gambar.

ket 

RS - PORTC Bit 0
RD - PORTC Bit 1
EN - PORTC Bit 2
D4 - PORTC Bit 4
D5 - PORTC Bit 5
D6 - PORTC Bit 6
D7 - PORTC Bit 7
NB VCC sesuaikan dengan LCD
Langkah

1. Seting LCD melalui Code Wizard  setelah masuk jendela Code Wizaed pilih"Alphanumeric LCD"
    


2, Cek List "Enable-Alphanumeric LCD Suport" kemudian pilih "Character / Line 16"karena menggunakan LCD 16 karakter.


3. pilih PORT setting pada LCD Module AVR  sesuaikan PORT dengan instalasi Hardware AVR nya, Contoh menggunakan PORT.C. jika sudah "Save genrete and Exit"


4. contoh sederhana Source Code pada CVAVR



Source Code


/*******************************************************
This program was created by the
CodeWizardAVR V3.12 Advanced
Automatic Program Generator
© Copyright 1998-2014 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.com

Project : 
Version : 
Date    : 10/22/2017
Author  : 
Company : 
Comments: 


Chip type               : ATmega32
Program type            : Application
AVR Core Clock frequency: 12.000000 MHz
Memory model            : Small
External RAM size       : 0
Data Stack size         : 512
*******************************************************/

#include <mega32.h>

// Alphanumeric LCD functions
#include <alcd.h>

// Declare your global variables here

void main(void)
{
// Alphanumeric LCD initialization
// Connections are specified in the
// Project|Configure|C Compiler|Libraries|Alphanumeric LCD menu:
// RS - PORTC Bit 0
// RD - PORTC Bit 1
// EN - PORTC Bit 2
// D4 - PORTC Bit 4
// D5 - PORTC Bit 5
// D6 - PORTC Bit 6
// D7 - PORTC Bit 7
// Characters/line: 16
lcd_init(16);

while (1)
      {
    lcd_gotoxy(0,0);
    lcd_putsf("Mini Modul AVR70"); 
    
     lcd_gotoxy(5,1);
    lcd_putsf("LCD 2 X16");
      }
}

Review 
lcd_goto[xy merupakan sumbu tamapil dari LCD](nilai dari [x],nilaidari[y])




Refferensi 
[1] Code Vision AVR
[2] Atmel Microcontroller Atmega 32 DIP

No comments:

Post a Comment

AVR oprator (bahasa C)

1. Oprator Assignment Oprator assignment  adalah suatu oprator penugasan yang digunakan untuk memasukan nilai kedalam suatu variabel. dil...