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
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