PDA

View Full Version : Display problems



rossfree
- 17th November 2004, 14:58
Howdeedoo all...

I'm stuck here. I'm trying to get an Optrex DMC20481 (4 x 20 display) to work with a 16f877 and I'm getting nuttin! It doesn't even flicker. I've checked and re-check the wiring. It all looks good. I disconnected the LCD and wrote a simple program to pulse the connector pins... the data seems to be getting through fine telling me it's not likely a circuit board problem.

This is a new circuit board with a 3-8 decoder enabling one of several paths for portd through 74HC373 chips. The decoder inputs are connected to porte of the 877.

I am using Microcode Studio with the latest version of PicBasic Pro.

I've probably dones something screwie. Any input here would be most appreciated.

Thank you,

Ross


DEFINE LOADER_USED 1
DEFINE osc 20
ADCON1 = 7 'set porta to digital
TRISA = 0 'set porta to output
TRISD = 0 'set portd to output
TRISE = 0 'set porte to output

Define LCD_DREG PORTD 'I/O port where LCD is connected
DEFINE LCD_DBIT 4
DEFine LCD_RSREG PORTD 'Port where RS pin located
define LCD_RSBIT 2 'Register select pin
Define LCD_EREG PORTD 'Port where Enable pin located
DEFINE LCD_EBIT 3 'Enable pin
DEFINE LCD_BITS 4 '4-Bit data bus
define LCD_LINES 4 'Number of LCD Character Display lines

'Porte is connected to 74HC138 3-to-8 line decoder which directs portd to one
'of several devices by enabling the correct 74hc373.

porte = 5 'Enable 74hc373 connecting Portd output to LCD
pause 2000 'Two seconds for display power-up (should be enough)
lcdout $fe,1 'Clear the LCD screen
pause 100 'Don't think I need this pause

porta.0 = 1 'initialize porta.0 (where LED is connected)


main:
gosub flash_led
lcdout "Success"
pause 1000
lcdout $fe,1
pause 500
goto main
end

'Led is connected to porta.0. As the main program loops, it flashes the LED as
'visual feedback that the program is at least trying to work. *razzberry*

flash_led:
pulsout porta.0,50
return

mister_e
- 17th November 2004, 16:32
hi rossfree,

what about if you try to modify connections and DEFINEs as follow



DEFINE LCD_DREG PORTD 'LCD data pins connected to
DEFINE LCD_DBIT 0 'd.0 - d.3

DEFINE LCD_RSREG PORTD 'LCD RS bit connected to
DEFINE LCD_RSBIT 4 'd.4

DEFINE LCD_EREG PORTD 'LCD E bit connected to
DEFINE LCD_EBIT 5 'd.5

DEFINE LCD_BITS 4 '4-Bit data bus
DEFINE LCD_LINES 4 'Number of LCD Character Display lines


let me know

regards

rossfree
- 17th November 2004, 17:33
Hi Steve,

Thanks for the input.

Your suggestion would be a fair piece of work on this end. The circuit is hardwired into a circuit board and would require cutting and jumping several lines.

The Optrex manual says when connecting a 4 bit bus, use the higher order bits, 4 thru 7. The lower four should be tied to ground.

See table 1.3 on page 11:

http://www.optrex.com/SiteImages/LitCentral/Dmcman_full.pdf

Still... if you have reason to believe that your suggested fix will work, I'll get cuttin'.

Could you please take a look and elaborate on your suggestion.

Thanks,

Ross

mister_e
- 17th November 2004, 18:08
Hi rossfree,


The Optrex manual says when connecting a 4 bit bus, use the higher order bits, 4 thru 7. The lower four should be tied to ground.


that's true... usually i left other pin connection. could be safe to tie them to ground.



Still... if you have reason to believe that your suggested fix will work, I'll get cuttin'.

Could you please take a look and elaborate on your suggestion.


But before cutting everything may you try highest PAUSE delay at the begining... let's say 5 secondes. I often heard about long startup delay on OPTREX. Also what about if you play with trim on VEE contrast pin. Is it display at least on line with black square characters???

can you also add this line
DEFINE LCD_COMMANDUS 2000

tell me if it's working with this add.

If i refer to some developpement board, they use lower bit for data. PBP use them also by default. i got some problem also in the past when using other bit to access to it.

may this thread help you also
http://www.picbasic.co.uk/forum/showthread.php?s=&threadid=709&perpage=5&highlight=lcdout%2016f88&pagenumber=1

regards

rossfree
- 17th November 2004, 22:31
Hi Steve,

Thanks for your continued support.

I placed the additional define statement in the program. It still did not work.

I'm at home now and have wired up an Optrex DMC16230 2 x 16 display. It works!

So... the problem is either with the code... subtle differences with the DMC20481? Or timing? Or maybe it needs to be wired slightly differently? I wired the 230 exactly the same way as the 481.

I don't know... I'm guessing here.

At least the board checks out. I was starting to wonder.

To restate the problem... I am trying to coax an Optrex DMC20481 into spitting out some characters. As of right now. it just sits there... blank. And I do mean blank. It don't flicker, it don't make black squares... it don't do nuttin!

Could go for some more ideas... anyone... anybody? HMMM???

Ross

mister_e
- 17th November 2004, 23:29
i'll get into datasheet in a few moment... maybe a little difference... memory addressing or something.

Have you try other LCDouts...

LCDOUT $fe,1
LCDOUT "1 st line",$fe,$c0,"2nd line",$fe,$94,"3rd line"

is writing something on now???


what about now if we manually initialize LCD


Define LCD_DREG PORTD
DEFINE LCD_DBIT 4
DEFine LCD_RSREG PORTD
define LCD_RSBIT 2
Define LCD_EREG PORTD
DEFINE LCD_EBIT 3
DEFINE LCD_BITS 4
define LCD_LINES 4
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 100

pause 2000
LCDOUT $fe,$28 '2 lines display
LCDOUT $fe,$0C 'turn on display
LCDOUT $fe,$06 'increment adress
LCDOUT $fe,1 'clear display

start:
LCDOUT $fe,1,"hello"
pause 200
goto start


what about now ???

mister_e
- 17th November 2004, 23:36
have you try left d0-d3 open not ground?


here's the datasheet for 20481
http://www.optrex.com/SiteImages/PartList/SPEC/20481bie.PDF

but less documented.

regards