I just can't seem to post sensible code. The hashes (#) get removed so all the defines should be #define and the final long line should of course be several separate lines. I should point out the program compiles to ASM and Hex.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Make sure your DB lines are configured as digital ports, otherwise they'll default to analog inputs when attempting to read data. You can eliminate the need to be able to read data back from the LCD by connecting the LCD R/W line to ground and inserting the the following code:
"#define LCD_NO_RW 1".
Joe
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Make sure your LCD contrast pin is biased properly. If the voltage on it is too low, all you'll see is black squares. It it's too high, you won't see anything at all.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the suggestions. Turns out I had done something stupid when wiring up the LCD. It's now working fine, and it does seem sensible to work write only saving a pin for other things.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Using the code below I get a blank screen.
The LCD will work with a 16F876 in both 4 and 8 bit modes.
#chip 16F676,4
#config OSC=INTOSC, MCLRE=OFF, WDT=OFF
#define LCD_IO 4
#define LCD_DB4 PORTC.4
#define LCD_DB5 PORTC.5
#define LCD_DB6 PORTA.4
#define LCD_DB7 PORTA.5
#define LCD_RS PORTC.1
#define LCD_RW PORTC.2
#define LCD_Enable PORTC.3
ADOFF
main:
PRINT "Hello World"
WAIT 1 sec
CLS
WAIT 1 sec
GOTO main
Oh no!
The message has come out bizarrely formatted all I did was paste it from "notepad".
I just can't seem to post sensible code. The hashes (#) get removed so all the defines should be #define and the final long line should of course be several separate lines. I should point out the program compiles to ASM and Hex.
Make sure your DB lines are configured as digital ports, otherwise they'll default to analog inputs when attempting to read data. You can eliminate the need to be able to read data back from the LCD by connecting the LCD R/W line to ground and inserting the the following code:
"#define LCD_NO_RW 1".
Joe
…also
Make sure your LCD contrast pin is biased properly. If the voltage on it is too low, all you'll see is black squares. It it's too high, you won't see anything at all.
New Guy here,
is it possible to set this program for serial output
serprint (portb.1, "hello world")
NG
Thanks for the suggestions. Turns out I had done something stupid when wiring up the LCD. It's now working fine, and it does seem sensible to work write only saving a pin for other things.