Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 19th April 2008, 12:30 PM   (permalink)
Question 1x16 LCD code problem

I'am trying to modify this code for my 1x16 display but can only get the first 8 characters to light up, i think it must be something in the function set but i cant realy find out, so if someone can take a look at the code and datasheet??
Attached Files
File Type: asm frq.asm (20.4 KB, 17 views)
File Type: pdf DEM16102SYH-PY.pdf (218.7 KB, 19 views)
OY2L is offline  
Reply With Quote
Old 19th April 2008, 01:14 PM   (permalink)
Default

am on my cell so can't really look into it, but I believe a 16x1 display is basically an 8x2 with the 8s side by side. So to address the 2nd 8 characters you need to issue a second line command
Norlin is offline  
Reply With Quote
Old 19th April 2008, 02:18 PM   (permalink)
Default

To add to what Norlin said, to write to characters 8 to 15 send command 0xc0. The second line (or in your case the right hand side of the display) starts at address 0x40 and the command to set address is 0x80 - combined is 0xc0.

Mike.
Pommie is offline  
Reply With Quote
Old 20th April 2008, 12:03 AM   (permalink)
Default

I have tryid over and over now but still not got the second 8 characters to light up, so i am not shore where i need to add the second line command.
OY2L is offline  
Reply With Quote
Old 20th April 2008, 09:17 AM   (permalink)
Default

Quote:
Originally Posted by OY2L
I have tryid over and over now but still not got the second 8 characters to light up, so i am not shore where i need to add the second line command.
hi,
You write the start location of the left handside to the LCD, using the control cmd, [0x00] just before you start writing the data to the LCD, then after the 1st 8 characters, write the righthand start address [0x40], then continure with the data write.

Code:
hallo
write the LCD location 1 here use 
movlw '0x80'
Call OutLcdControl

	movlw	'H'
	movwf	LcdDaten	; LCD data
	call	OutLcdDaten	; LCD data out
	movlw	'a'
	movwf	LcdDaten	; LCD data
	call	OutLcdDaten	; LCD data out
	movlw	'l'
	movwf	LcdDaten	; LCD data
	call	OutLcdDaten	; LCD data out
	movlw	'l'
	movwf	LcdDaten	; LCD data
	call	OutLcdDaten	; LCD data out
	movlw	'o'
	movwf	LcdDaten	; LCD data
	call	OutLcdDaten	; LCD data out

	movlw	' '
	movwf	LcdDaten	;LCD data
	call	OutLcdDaten	;Ud data LCD

	movlw	'O'
	movwf	LcdDaten	; LCD data
	call	OutLcdDaten	; LCD data out
	movlw	'Y'
write the LCD location 1+8  here use 
movlw '0xC0'
Call OutLcdControl
	movwf	LcdDaten	; LCD data
	call	OutLcdDaten	; LCD data out
	movlw	'2'
	movwf	LcdDaten	; LCD data
	call	OutLcdDaten	; LCD data out
	movlw	'L'
	movwf	LcdDaten	; LCD data
	call	OutLcdDaten	; LCD data out


Do you follow.?

EDIT:
LCD display addrees from your datasheet.

EDIT: Corrected addressing with bit7
Attached Images
File Type: jpg screenhunter7.jpg (15.5 KB, 10 views)
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/

Last edited by ericgibbs; 7th July 2008 at 11:23 AM.
ericgibbs is offline  
Reply With Quote
Old 20th April 2008, 11:38 AM   (permalink)
Default

Thanks Eric
Have just try it, but still not working, so i think now i change over to use a 2x16 lcd, i know a 2x16 works with this program, i have try it before. But the program anyway just use the first line of the lcd
OY2L is offline  
Reply With Quote
Old 20th April 2008, 11:42 AM   (permalink)
Default

Eric,

You forgot the command bit, it should be,
Code:
        ;write the LCD location 1+8  here use 
        movlw '0xC0'
        Call OutLcdControl
Mike.
Pommie is offline  
Reply With Quote
Old 20th April 2008, 11:55 AM   (permalink)
Default

Quote:
Originally Posted by Pommie
Eric,

You forgot the command bit, it should be,
Code:
        ;write the LCD location 1+8  here use 
        movlw '0xC0'
        Call OutLcdControl
Mike.
Woops! Sorry OY2L

OY2L they do work I have used then often in the past, unless you have a defective one.?
Attached Images
File Type: jpg screenhunter8.jpg (70.5 KB, 6 views)
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/

Last edited by ericgibbs; 7th July 2008 at 11:23 AM.
ericgibbs is offline  
Reply With Quote
Old 20th April 2008, 12:32 PM   (permalink)
Default

I wonder if you couldn't design a somewhat 'generic' PutLCD routine that could keep track of and increment a Tab variable and automatically issue the position control command when needed? Perhaps using assembler equates for determining 1x16, 2x16, 1x20, 2x20, 4x20, etc., display types?

Mike
Mike, K8LH is offline  
Reply With Quote
Old 20th April 2008, 12:34 PM   (permalink)
Default

Quote:
Originally Posted by Mike, K8LH
I wonder if you couldn't design a somewhat 'generic' PutLCD routine that could keep track of and increment a Tab variable and automatically issue the position control command when needed? Perhaps using assembler equates for determining 1x16, 2x16, 1x20, 2x20, 4x20, etc., display types?

Mike
We know you can.

Mike.
Pommie is offline  
Reply With Quote
Old 20th April 2008, 12:41 PM   (permalink)
Default

I suspect you could too Mike (Pommie) but who's got time (grin)...

I did just get a couple 2x20 displays and a single 4x20 display recently but not sure when I'll get a chance to 'play'. The new 128x64 GLCD with touchscreen and RGB backlight has higher priority for me right now. I'm going to use an 18F4431 with its multiple PWM outputs as a high performance controller and I only just finished writing and testing a bootloader for that device so it's going slowly.

Take care my friend. Mike
Mike, K8LH is offline  
Reply With Quote
Old 20th April 2008, 12:46 PM   (permalink)
Default

There's too many Mike's in those last few posts?
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply With Quote
Old 20th April 2008, 12:51 PM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
There's too many Mike's in those last few posts?
I'm considering changing my name to Bruce.

Pommie Bruce.
Pommie is offline  
Reply With Quote
Old 20th April 2008, 01:00 PM   (permalink)
Default

Quote:
Originally Posted by Pommie
I'm considering changing my name to Bruce.
Loved the Bruce sketch!

Edit: Thinking on, a line from that seems to fit?

"Just seen a Pommie streaker in the Earl's Court Road"
"Must have looked like a bald wallabie, Bruce!"
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply With Quote
Old 20th April 2008, 01:14 PM   (permalink)
Default

Wow! I just found my very first LCD display from many years ago. It's a very large 2x16 display without a backlight. It's really physically huge compared to the compact 2x20 and 4x20 backlit units I received recently.

I remember stopping by a new (at the time) local company called Optrex and speaking with one of their engineers and he gave me this particular display as a sample which I then used it in an EPROM/EEPROM programmer project of my own design which used a Motorola 68HC11FN1 controller.

Nigel,

Do I need to change my name too Sir?
Mike, K8LH is offline  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
LCD Monitor Problem dimper129 General Electronics Chat 3 1st April 2008 08:35 AM
Scrolling readout on LCD? karenhornby Electronic Projects Design/Ideas/Reviews 0 4th March 2008 08:20 PM
PIC18F2620 not being able to self-execute control code ssylee Micro Controllers 20 19th October 2007 04:58 AM
PIC to LCD wiring problem ? pasanlaksiri Micro Controllers 28 4th October 2007 10:29 AM
Nokia 7110 LCD + questions regarding code and behaviour of LCD. MrNobody Micro Controllers 2 19th September 2007 07:50 AM



All times are GMT. The time now is 06:20 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.