Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

jhd162a interfacing with avr

Status
Not open for further replies.

avisekdg

Newbie level 2
Joined
Jun 10, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
india
Activity points
1,305
hi,
i wish to interface jhd162 a with atmega16 microcontroller..i am using code vision avr as the programmin software..
please help me with the programming part of it to display all the alphabets with some delay!!
 

Hi,

If you want to do 4 bit mode with lcd, you cna get code from code wizard itself as you are using codevision avr. Just make new project in codevision avr then it will ask whether you want to use code wizard or not. After selecting that you can ask for that code.

NIKS
 

i tried writing a small program using in built functions of code vision avr for lcd to display some data on the lcd...
my program is


#include <mega16.h>


#asm
.equ __lcd_port=0x1B ;PORTA
#endasm
#include <lcd.h>
#include <delay.h>
unsigned char frog;


void main(void)
{ int i;

PORTA=0x00;
DDRA=0xFF;

PORTB=0x00;
DDRB=0x00;

PORTC=0x00;
DDRC=0x00;

PORTD=0x00;
DDRD=0x00;

// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Normal top=FFh
// OC0 output: Disconnected
TCCR0=0x00;
TCNT0=0x00;
OCR0=0x00;

// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer 1 Stopped
// Mode: Normal top=FFFFh
// OC1A output: Discon.
// OC1B output: Discon.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer 1 Overflow Interrupt: Off
// Input Capture Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off
TCCR1A=0x00;
TCCR1B=0x00;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;

// Timer/Counter 2 initialization
// Clock source: System Clock
// Clock value: Timer 2 Stopped
// Mode: Normal top=FFh
// OC2 output: Disconnected
ASSR=0x00;
TCCR2=0x00;
TCNT2=0x00;
OCR2=0x00;


MCUCR=0x00;
MCUCSR=0x00;

TIMSK=0x00;


ACSR=0x80;
SFIOR=0x00;

// LCD module initialization
lcd_init(16);


while (1)
{

// Place your code here
lcd_init(16);
lcd_gotoxy(0,0);
lcd_clear();
lcd_putsf("START");
};
}


the connections i am using are PORTA of atmega is connected to LCD jhd 162a..

lhd162a connected with atmega16
1 GND- GND of atmega
2 +5V- VCC of atmega
3 VLC- LCD contrast control voltage connected to a pot
4 RS - 1 PA0
5 RD - 2 PA1
6 EN - 3 PA2
11 D4 - 5 PA4
12 D5 - 6 PA5
13 D6 - 7 PA6
14 D7 - 8 PA7
15 LED+ - VCC
16 LED- - GND

this program is not working.. please help..
 

Hi,

Codewizard always gives running code. I have seen your code. Seems there is no problem. Please check your hardware. Lcd getting enough voltage? Connections are ok?

NIKS
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top