Proteus LCD No display

Status
Not open for further replies.

Suraj143

Active Member
I have struggling from last few days.

I need to display Hello on 16X2 display in 4 bit mode.The code works in real hardware.

But in proteus I cannot see anything.

I have uploaded all files so you can directly load & see in proteus.
 
Last edited:
Proteus is too finicky when it comes to LCD init....The data sheet shows a certain procedure to initialise 4 bit If you don't follow this precisely Proteus will not work..
 
Proteus is too finicky when it comes to LCD init....The data sheet shows a certain procedure to initialise 4 bit If you don't follow this precisely Proteus will not work..

Hi Ian thanks for your help.I think that's the problem.

You mean what datasheet? You mean LM016L which is used in proteus?
 
When I converted Nigel's tutorials... Even they didn't work at first... I made subtle changes to them....

I send 0x3 Twice ( this is direct! Physically put "3" on the 4 bit port, clock E... wait 20mS then clock E again, wait 10mS )..... Then 0x20... Then 0x2C...... 0xC... 0x6.. 0x1

Works for me.
 
Last edited:
I made the changes suggest by you.But still no luck.

Code:
LCD_Init	call	Delay100		; 100mS
		bsf	PORTC,2			; load 0x03
		bsf	PORTC,3			; //
		call	LCD_E
		call	Delay20
		call	LCD_E
		call	Delay5			; 10mS
		call	Delay5			; 10mS
		;
		movlw	20h			; b'00100000' set to 4 bit mode
		call	LCD_CMD_Write		; set to command mode		
Func_Set	movlw	2Ch			; 2 line display,5X8
		call	LCD_CMD_Write		; set to command mode
		movlw	0Dh			; 00001101 Set display on/off and cursor command
		call	LCD_CMD_Write
		return
 
This works....

I don't know why there was an issue ... I tried a few combo's an here it is

Code:
LCD_Init	call	Delay100		; 100mS
			bcf		PORTC,6
			bsf		PORTC,2	
			bsf		PORTC,3		; load 0x32
			call	        LCD_E		; clock 3
			call	        Delay5
			bcf		PORTC,2		; clock 2
			call	        LCD_E
			call	        Delay5		; 20mS
									; load 0x2C
			call	LCD_E			; clock 2
			bcf		PORTC,3			; 
			bsf		PORTC,4
			bsf		PORTC,5			; clock C
			call	        LCD_E
			call	        Delay5			; 20mS
			
Func_Set	
			movlw	06h				; 2 line display,5X8
			call	LCD_CMD_Write		; set to command mode
			movlw	0Eh				; 00001101 Set display on/off and cursor command
			call	LCD_CMD_Write
			movlw	01h
			call 	LCD_CMD_Write
			return
 
Last edited:
Hi Ian thanks for the support.It worked nicely.My headache has gone now.

I have to ask something.
0x2C = function set (2lines,4bit,5x8)

But what is 0x32? is this also a function set?

Reg this
Code:
movlw	06h				; 2 line display,5X8
			call	LCD_CMD_Write		; set to command mode

The above is "entry mode" am I right?
 
Last edited:
No! It's not required in the real wold.. I tried several combinations before it would work in ISIS..... It must be a bit of a bug....


I didn't change the REM statements.... I should have really!!! Sorry
 
No! It's not required in the real wold.. I tried several combinations before it would work in ISIS..... It must be a bit of a bug....


I didn't change the REM statements.... I should have really!!! Sorry

Ok got it.Thanks for your support.
 
I have been working on a project for the course Microprocessors and Interfacing.The LCD is not displaying the required output during the simulation on proteus 8.
I am not able to debug the design and the code after persisting for the past week.
Any help would be appreciated. I have attached the zipfile containing the design project,report containing the question and the code.
 

Attachments

  • P27_G041.zip
    607.4 KB · Views: 223
Sorry!! I cannot help.. I do not posses the 8086 Proteus model or a suitable assembler!! But!! Your LCDinit is wrong..

Delay 15mS... write 0x30 three times with a 5mS delay between each one, then write 0x38, then 0xc then 0x6 and finally 0x1..
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…