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.

LCD display troubleshoot

Status
Not open for further replies.

anasimtiaz

Junior Member level 1
Junior Member level 1
Joined
Oct 21, 2006
Messages
19
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,424
mplab argument out of range

im using a 16*2 lcd display module with an atmel 89c51 microcontroller. ive used the tutorial on
and used almost similar assembly language code.
however, when i run the microcontroller, the lcd module d oesnt show up any text!
the module is of 16-pins, ive connected pin 15 to +5v and pin 16 to ground, and ive used a simple voltage divider for the lcd contrast pin.
what could go wrong? if anyone can please help me out, and even look at the code on the above site (im sure thats correct, but anyways) ..... that will b appreciated

regards
 

ok..ive just turned it on again, using the same code, and it worked! but trying again...its not working...! can there b a problem with my supply source?? thats the least ican think of
 

the setup is fairly simple...infact very simple!! ive made sure that therz not short-circut among the wires (which are close)....i can think of two reasons only. either my supply isnt sufficient to drive this setup, or therz some problem using the contrast pin.....ive connected it to a voltage divider network using two 4.7k resistors, i.e. im halving the voltage using them...is it fine?
 

are you sure about your lcd pinout some have pin 1 & 2 (gnd,+5v) inverted,trying using a 10k pot for contrast so you can adjust it
 

well no im nt 100% sure abt it....can i try using the other way round? it can b harmful if its wrong! plus it worked once! i will try using the 10k pot in some time

Added after 18 minutes:

im using an adapter with 5v/300mA to supply for lcd display and the atmel 89c51...is that fine?

Added after 39 minutes:

thanks mate...its working wid a 10k pot!
 

yes you can harm it,try the 10k pot and make sure your adpater is only putting out 5v max not 9v you might need a 5v regulator
 

yeah rite...im using a regulator...its working now with the 10k pot! thanks!
 

glad to hear it,you could try a 10k resistor in place of the pot,I've found 10k works for most displays but some are a little touchy about the contrast so I always use a pot first to get it running then use a resistor after (cheaper)
 

    anasimtiaz

    Points: 2
    Helpful Answer Positive Rating
hi,

My suggestion is you change the EN, RS, RW pin some other ports other than port 3
 

Hi,

Am having similar problems with LCD, have pot to vary contrast and works, but only get first row of 16x2 lcd screen to show squares instead of characters. Would say a wrong value trimpot cause this?

Thanks
 

no it won't
post your code maybe your code is wrong
 

Thanks bbarney,

Didn`t think so, as it`s just for contrast adjustment, but wasn`t sure, confirmed it (changed for different trimpot, same result) just before I got back here and read post. I had double checked everything and I agree with you, as I had originally suspected, it does look like it has come down to the code, unfortunately I can`t post it, but have posted the following, error messages, any clues on how to fix?

I`m thinking that in the following case for ... retlw ' '... , I should remove ' ', so instead of ... retlw 'Z' , I`d use ...retlw Z , ??
As it seems everywhere there is ' ' or 'value' , there is error.



FOR EXAMPLE:
(Other)ASM MPASM

Decimal 153 D'153'
Hex $2B H'2B' or 0x2B
Binary %10010110 B'10010110'
ASCII 'C' 'C' or A'C'
Octal - O'777' (not recognised by other asm)

.EQU EQU (with/without decimal point)
.ORG ORG (with/without decimal point)
.END END (with/without decimal point)
LABEL: LABEL (with/without colon)

Errors like
Warning[205] : Found directive in column 1. (ENDC)
Message[302] : Register in operand not in bank 0. Ensure that bank bits are correct.
Error[113] : Symbol not previously defined (NEGATEA)
Error[113] : Symbol not previously defined (BIN2DEC)
Error[113] : Symbol not previously defined (SUBTRACT)
Error[113] : Symbol not previously defined (TXBYTE)
Error[113] : Symbol not previously defined (FLUSHRXBUFFER)
Error[113] : Symbol not previously defined (SENDNEXT) etc.....

That was in one error log. Another list shows

unrecognized instruction. (LIST)
unrecognized directive. (__CONFIG)
unrecognized instruction. (INCLUDE)
unrecognized instruction. (CBLOCK)
unrecognized instruction. (ENDC)
unrecognized instruction. (ORG)

unrecognized instruction. (GOTO)

EXAMPLE:- 0888 0000 goto SHOWCHIPS ; yes

Label not found: (GIEOFF)
label value misalligned. (GIEOFF)
unrecognized instruction. (GIEOFF)
unrecognized instruction. (BTFSC)
Label not found: (LCDSET)
label value misalligned. (LCDSET)
unrecognized instruction. (LCDSET)
unrecognized instruction. (CLRF)
Label not found: (LCDST2)
label value misalligned. (LCDST2)
unrecognized instruction. (LCDST2)
unrecognized instruction. (CALL)
unrecognized instruction. (INCF)
unrecognized instruction. (BTFSS)
unrecognized instruction. (RETURN)
Label not found: (TABLCD)
unrecognized instruction. (RETLW)

EXAMPLE OF RELTW :-
0123 0000 retlw ' '
0124 0000 retlw 'Z'




Label not found: (MESSAG5)
label value misalligned. (MESSAG5)
unrecognized instruction. (MESSAG5)
Label not found: (START)
label value misalligned. (START)
unrecognized instruction. (START)
unrecognized instruction. (BCF)
unrecognized instruction. (CLRF)

EXAMPLE:- 0000 0000 clrf PORTA

unrecognized instruction. (MOVWF)

EXAMPLE:- 0000 0000 movwf TRISB

unrecognized instruction. (GETCHIP)

EXAMPLE:- 0321 0000 GETCHIP clrf WADDRH ; set write address MSB

unrecognized instruction. (COMF)

EXAMPLE:- 0456 0000 comf MEMLO,F ; invert value

unrecognized instruction. (XORWF)

EXAMPLE:- 0666 0000 xorwf VALIDITY,W ; is 2nd read value same as 1st?


unrecognized instruction. (MAIN)
label value misalligned. (MAIN)
Label not found: (MAIN)

EXAMPLE:- 0555 0000 MAIN: btfss RECORD,1 ; is record switch on (low)

Label not found: (CHECKPC)
label value misalligned. (CHECKPC)
unrecognized instruction. (CHECKPC)

EXAMPLE:- 0777 0000 CHECKPC: call WAITINGPC


Label not found: (CHECKPC2)
label value misalligned. (CHECKPC2)
unrecognized instruction. (CHECKPC2)

EXAMPLE:- 0111 0000 CHECKPC2: btfss PORTB,4 ; is FUNCTION switch on (low)?

unrecognized instruction. (SUBLW)

EXAMPLE:- 0590 0000 sublw 'X' ; Is this a 'X' ?

unrecognized instruction. (ANDLW)

EXAMPLE:- 0621 0000 andlw %00000100


When using build function, that is, putting the same script/code through MPLAB
I get the following:

Executing: "C:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q /p16F877 "FILE.ASM" /l"FILE.lst" /e"FILE.err" /o"FILE.o" /c-

Warning[205] C:\FILE.ASM 116 : Found directive in column 1. (ENDC)
Message[302] C:\FILE.ASM 395 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 398 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 400 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 402 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 403 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 404 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 406 : Register in operand not in bank 0. Ensure that bank bits are correct.
Warning[202] C:\FILE.ASM 835 : Argument out of range. Least significant bits used.
Message[302] C:\FILE.ASM 1102 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 1123 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 1142 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 1163 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 1202 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 1222 : Register in operand not in bank 0. Ensure that bank bits are correct.
Warning[202] C:\FILE.ASM 1355 : Argument out of range. Least significant bits used.
Message[302] C:\FILE.ASM 1356 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 1358 : Register in operand not in bank 0. Ensure that bank bits are correct.
Warning[202] C:\FILE.ASM 1470 : Argument out of range. Least significant bits used.
Message[302] C:\FILE.ASM 1500 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 1502 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 1503 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 1505 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 2005 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 2009 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 2011 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 2012 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 2015 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 2017 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 2018 : Register in operand not in bank 0. Ensure that bank bits are correct.
Warning[202] C:\FILE.ASM 2034 : Argument out of range. Least significant bits used.
Error[115] C:\FILE.ASM 2059 : Duplicate label ("CHECKIT" or redefining symbol that cannot be redefined)
Warning[202] C:\FILE.ASM 2082 : Argument out of range. Least significant bits used.
Warning[202] C:\FILE.ASM 2096 : Argument out of range. Least significant bits used.
Message[302] C:\FILE.ASM 2187 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 2189 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 2552 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 2687 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 2703 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\FILE.ASM 2709 : Register in operand not in bank 0. Ensure that bank bits are correct.

BUILD FAILED: Mon Nov 20 19:54:46 2006


Thanks
 

first off I don't think mpasm can find the directory's with the "Inc" files some of the errors are just formatting mistakes "Warning[205] C:\FILE.ASM 116 : Found directive in column 1. (ENDC)
some other errors you can supress with
ERRORLEVEL 0, -302 ;suppress bank selection messages
and try this "retlw 0x00"

without knowing the chip and seeing all the code it's hard to help
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top