
Originally Posted by
g7jiq
Hi again
I have had a play with the code, and have placed the colons in as stated,
I still get no display,
One thing I did find is if I place the Disp1: to Disp4: section into the main loop I get a very
fast flashing faint display,
It does change tho when the i/p pin is toggled.
So I may be getting a little closer.
Any ideas.....?
I will attempt to redeem myself, again without actually wiring up a pic to default LCD settings,
Code:
TRISA=%00000000 'Set port A as output
TRISB=%01110111 'Set port B as input except B7 for backlight and B3 for lcd
SW1 VAR PORTB.0
SW2 VAR PORTB.1
SW3 VAR PORTB.2
SW4 VAR PORTB.4
SW5 VAR PORTB.5
SW6 VAR PORTB.6
Backlight VAR PortB.7 'Set var as port B7
low Backlight 'light up lcd backlight
Pause 1000 'stand by for lcd
setup:
LCDOUT $FE,1, " G7JIQ Micro" 'clear lcd & Display on line 1
lcdout $FE, $C0," Link Repeater" 'Display on line 2
pause 2000
LCDOUT $FE, $0C 'turn off cursor
lcdout $FE,1 'clear display
lcdout $FE,2 'Return Home
loop:
if SW1 = 0 then Disp1 ' if true, disp1
if SW1 = 1 then Disp2 ' if true, disp2
IF SW4 = 0 THEN Disp3 ' if true, disp3
if SW4 = 1 THEN Disp4 ' if true, disp4
goto loop
Disp1:
lcdout "Standby"
pause 1000 ' gives time to see display
goto loop ' prevents you from having to use gosubs in the loop
' however it returns to the beginning of the loop
' whereas a gosub would go to the next line in the loop
Disp2:
lcdout "Main"
pause 1000 ' gives time to see display
goto loop ' prevents you from having to use gosubs in the loop
' however it returns to the beginning of the loop
' whereas a gosub would go to the next line in the loop
Disp3:
lcdout $FE,$C0,"Local off " 'display on line 2
pause 1000 ' gives time to see display
lcdout $FE,1 ' Erases display
goto loop ' prevents you from having to use gosubs in the loop
' however it returns to the beginning of the loop
' whereas a gosub would go to the next line in the loop
Disp4:
LCDOUT $FE,$C0,"local on"
pause 1000 ' gives time to see display
lcdout $FE,1 ' clears display
goto loop ' prevents you from having to use gosubs in the loop
' however it returns to the beginning of the loop
' whereas a gosub would go to the next line in the loop
end
There are no config fuses set here as I do not know which compiler you are using of which PIC, so you must add them or manually set the config fuses in your programmer. If you supply the information and also the Oscillator speed and if you are using xtal, resonator or internal oscillator, everyone is sure to help.
Bookmarks