Hi flotulopex,Originally Posted by flotulopex
No question you do not know the answer to is stupid.
$0C - listed in PBASIC PRO MANUAL page 94. $0C = Cursor Off
JS
Hi flotulopex,Originally Posted by flotulopex
No question you do not know the answer to is stupid.
$0C - listed in PBASIC PRO MANUAL page 94. $0C = Cursor Off
JS
Hello Joe S.,
I read this document (PBP manual) almost any time I have a question but I sometimes don't understand the explanations.
As you mention, the actual $0C value listed in the manual switches the Cursor OFF; Mister_e sais that, according to the table, it switches the Display ON. There is a difference.
Mister_e must have interpreted the table; this is what I would like to be able to do too.
So, my question was more precisely to:
a) understand the definition table (in post #19);
b) learn how to use the informations on there.
I don't know how to express myself more clearly but if my question looks confusing, please tell me.
Roger
Look at the datasheet for the LCD controller, specifically Page 26.Originally Posted by flotulopex
"Display On/OFF"
The 8 bits for the register = 00001DCB
D= display 1=on 0=off
C=cursor 1=on 0=off
B=blink cursor 1=on 0=off
so "00001100"
Will give Display On Cursor and Blink off which is $0C
$0C is the command to turn the Cursor OFF but it also turns the dsipay on as well
$0E will turn the display on with a cursor
Keith
www.diyha.co.uk
www.kat5.tv
So, the code looks like this now:
Guess what? The display still doesn't work.Code:include "16F88-FUSES.BAS" 'PIC 16F88 - 4MHz ' LCD circuitery '23,24,25,26,32,33,34,35,40 - Vdd (+5V) '27,38 - Vss (GND) '31 DB0 - PORTB.0 '30 DB1 - PORTB.1 '29 DB2 - PORTB.2 '28 DB3 - PORTB.3 '39 RS - PORTB.4 '36 E - PORTB.6 '37 R/W - PORTB.7 DEFINE LCD_DREG PORTB 'LCD data port DEFINE LCD_DBIT 0 'LCD data starting bit 0 or 4 DEFINE LCD_RSREG PORTB 'LCD register select port DEFINE LCD_RSBIT 4 'LCD register select bit DEFINE LCD_EREG PORTB 'LCD enable port DEFINE LCD_EBIT 6 'LCD enable bit DEFINE LCD_RWREG PORTB 'LCD read/write port DEFINE LCD_RWBIT 7 'LCD read/write bit DEFINE LCD_BITS 4 'LCD bus size 4 or 8 DEFINE LCD_LINES 2 'Number lines on LCD DEFINE LCD_COMMANDUS 2000 'Command delay time in us DEFINE LCD_DATAUS 50 'Data delay time in us ' Register settings OSCCON = %01100000 'Internal RC set to 4MHZ ANSEL = %00000000 'Disable Analogue Inputs OPTION_REG = %01000000 'Enable PORTB pullups ManualLCDInit: FLAGS=2 ' Void PBP lcd initialisation... it's a nice feature !!! PAUSE 500 Lcdout $FE, $33 Lcdout $FE, $33 Lcdout $FE, $20 ' official 4 bit mode @ bsf LCD_EREG, LCD_EBIT PAUSEUS 20 @ bcf LCD_EREG, LCD_EBIT Lcdout $FE, $28 ' Function Set Lcdout $FE, $14 ' Bias Lcdout $FE, $78 ' Contrast set Lcdout $FE, $5E ' Power/Icon/Contrast Lcdout $FE, $6A ' Follower control Lcdout $FE, $0C ' Display ON Lcdout $FE, $01 ' Clear display Lcdout $FE, $06 ' Entry mode Set ' --------------------------------- End LCD init! LCDOUT $FE,1,"Line1",$FE,$C0,"Line 2" Pouet: Goto Pouet end
I'm waiting for AE to give some answers...
At least, have a look at how the displays look like (they're only 2mm thick). Would be really nice if something could be written on it, no? (pin 21 is on the upper right corner looking at picture PICT0001small.JPG).
Keithdoxey, it's getting clearer to me. I have to grab a piece of paper and study a little. Thanks a lot since this is exactly the kind of information I was looking for.
Last edited by flotulopex; - 27th November 2006 at 16:40.
Roger
I use these to lines to make sure all the analog and comparator stuff is killed dead...
ANSEL = %00000000 ' Disable Analogue Inputs
CMCON = %00000111 ' Disable Comparators
Looking at your photos it looks as if Pin37 of the LCD R/W is connected via a blue/green wire to pin 13 of the PIC RB7. There also seems to be an additional brown wire flying off somewhere from this pin. Where does the other end of that connect to ?
Try with the R/W line connected directly to 0V as you only need to write to the PIC.
One other point... I suggested putting LEDs on the PIC and observing it counting up to ensure that the count operated correctly. You said that you tested the pins with a logic probe, presumabley one pin at a time just to observe the two different states.
The reason I suggested the LEDs is that when I first used a 16F88 I hadnt killed all the analogue bits properly and although I could turn an LED on on any pin, when I changed another pin the first LED would go out.
The reason being that updating a pin involves reading the port register for the existing values, modifying it and writing it back. If any analogue stuff is still enabled the pin reads as a zero and will get set to zero even though it was previously a one.
Do you have access to a "normal" HD44780 display of any size just to test that your PIC is correctly configured. From what I have seen so far there shouldt be any real problems getting this display to work as it is 44780 compatible. If you try with a normal display and it still doesnt work then something isnt right with the PIC. Once you have that working it should just be a matter of swapping the displays.
Keith
www.diyha.co.uk
www.kat5.tv
It is the DATA wire (brown) coming from ICSP programmer (AN589). I've attached a "full view". Green LED on programmer is for power presence and yellow one (between both black relays) is for connection/disconnection of MCLR-DATA-CLOCK.Looking at your photos it looks as if Pin37 of the LCD R/W is connected via a blue/green wire to pin 13 of the PIC RB7. There also seems to be an additional brown wire flying off somewhere from this pin. Where does the other end of that connect to ?
Wires:
black = GND (Vss)
red = +5V (Vdd)
yellow = MCLR
orange = Clock
brown = Data
You're right. The LED you are talking about is there and as you suggest, I use it as an optical check. Do you mean I should connect more LEDs just to make sure it works fine?One other point... I suggested putting LEDs on the PIC and observing it counting up to ensure that the count operated correctly. You said that you tested the pins with a logic probe, presumabley one pin at a time just to observe the two different states.
Yes. As mentionned earlier, I made this check too and with my other displays (have lots of them), no problem!!Do you have access to a "normal" HD44780 display of any size just to test that your PIC is correctly configured. From what I have seen so far there shouldt be any real problems getting this display to work as it is 44780 compatible. If you try with a normal display and it still doesnt work then something isnt right with the PIC. Once you have that working it should just be a matter of swapping the displays.
Last edited by flotulopex; - 27th November 2006 at 20:16.
Roger
Ok. might be worth trying with R/W just connected to 0V.Originally Posted by flotulopex
Yes. Put 8 leds on there and observe the count egYou're right. The LED you are talking about is there and as you suggest, I use it as an optical check. Do you mean I should connect more LEDs just to make sure it works fine?
If the sequence doesnt work then the port isnt being correctly setCode:OFF OFF OFF OFF OFF OFF OFF OFF (0) OFF OFF OFF OFF OFF OFF OFF ON (1) OFF OFF OFF OFF OFF OFF ON OFF (2) OFF OFF OFF OFF OFF OFF ON ON (3) OFF OFF OFF OFF OFF ON OFF OFF (4) OFF OFF OFF OFF OFF ON OFF ON (5) ...... ON ON ON ON ON ON OFF OFF (252) ON ON ON ON ON ON OFF ON (253) ON ON ON ON ON ON ON OFF (254) ON ON ON ON ON ON ON ON (255)
Sorry, missed that.Yes. As mentionned earlier, I made this check too and with my other displays (have lots of them), no problem!!
Good luck !!!!
Keith
Keith
www.diyha.co.uk
www.kat5.tv
Bookmarks