LCD Display not working - PIC heating...


Closed Thread
Results 1 to 33 of 33
  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891

    Default LCD Display not working - PIC heating...

    Hi there,

    I'm using a 16F88 and try to get an 2x16 LCD display working.

    I found some examples on how to connect the display to the PIC but when I switch on the programmer (AN589), the display switches on all 1st lines character's pixels (see attachment); nothing else happens. Worse, the PIC is heating (maybe up to 50°C). The circuit is powered by the programmer.

    I don't think that this has something to do with the PIC since I erased it and the same phenomenon happened again.

    According to the documentation I could find, I connected:
    Code:
    PIC ports Symbol           LCD pin
    PORTA.0	  DB4	           11
    PORTA.1	  DB5	           12
    PORTA.2	  DB6	           13
    PORTA.3	  DB7	           14
    PORTA.4	  RS	            4
    PORTB.3	  E	            6
    -	  Vss - GND	    1
    -	  Vdd / Vcc +5V	    2
    -	  Vee / Contrast    3
    -	  R/W	            5
    I double checked my wiring (used different colours) and don't see what's wrong. Appart the 10k pull-up on MCLR, there are no other components (display DIRECTLY connected to PIC).

    The code is here:
    Code:
    'LCDOUT PBP command
    'It assumes the LCD will be used with a 4-bit bus with
    ' data lines DB4 - DB7 connected to PICmicro PORTA.0 - PORTA.3,
    ' Register Select to PORTA.4 and Enable to PORTB.3.
    ' It is also preset to initialize the LCD to a 2 line display.
    
    OSCCON = %01100000                   'Internal RC set to 4MHZ
    
    Pause 1000                           'Wait for display to initialise
    
    Main:
        lcdout $FE, 1                    'Clear LCD
        lcdout $FE, 2                    'Position cursor at home
        lcdout "Hello World"             'Send "Hello World" to LCD on line 1
        lcdout $FE, $C0                  'Position cursor second line
        lcdout "Second line"             'Send "Second line" to LCD on line 2
        pause 1000                       'Pause 1 second to see it
        goto Main
    end
    What am I doing wrong?
    Attached Images Attached Images  
    Roger

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Do a search on the comparator, you'll see what I mean.
    JDG

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Datasheet

    Quote Originally Posted by skimask
    Do a search on the comparator, you'll see what I mean.
    JDG
    Datasheets are a wonderful place to get lost, I looked at it and knowing what to do it didn't make sense.
    flotulopex,

    ADCON1 = 7 ' turns off adc
    CMCON = 7 'turns off comparators
    Last edited by Archangel; - 11th September 2006 at 23:56.

  4. #4
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi Flotulopex,

    Where are your DEFINES for the LCD?

    Your program should start like this:
    OSCCON = %01100000 'Internal RC set to 4MHZ

    DEFINE LCD_DREG PortA
    DEFINE LCD_DBIT 0
    DEFINE LCD_RSREG PORTA
    DEFINE LCD_RSBIT 4
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 4
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2

    TRISA = %00000000 'make Port A outputs
    TRISB = %00000000 'make Port B outptuts

    ADCON1 = 7 ' turns off adc
    CMCON = 7 'turns off comparators

    Pause 1000 'Wait for display to initialise

    Main:
    lcdout $FE, 1 'Clear LCD
    lcdout $FE, 2 'Position cursor at home
    lcdout "Hello World" 'Send "Hello World" to LCD on line 1
    lcdout $FE, $C0 'Position cursor second line
    lcdout "Second line" 'Send "Second line" to LCD on line 2
    pause 1000 'Pause 1 second to see it
    goto Main
    end


    The next problem I believe you have is you don't power your circuit from the programmer power. I'm assuming you are using ICSP programming. You should power the circuit from its own separate power supply. Do you have capacitors on the power supply lines? 10uF and .1uF on the 5 volt side of the voltage regulator going to the PIC. Make sure you have a .1uF across the PICs power leads as close as possible. Have a 100uF or 10uF and a .1uf across the input side of the voltage regulator also.

    If you don't have a copy of the PBP manual then download one! There is a real nice example of how LCDOUT is suppose to be connected and programmed. Also the contrast pin of the LCD display is suppose to be connected to the wiper or center pin of a 5K potentiometer with one of the two remaining pins connected to +5vdc and the other side to ground. After you have all of this setup, if you are still getting blocks on the screen, then adjust the pot until the blocks are just barely seen. Then try your program.

    This should help you get going!

    BobK

  5. #5
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default

    Thank you All.

    I'll try to turn off ADCs and COMPARATORs as soon as I'm back home.

    Yes, I compared the PBP manual with other documents I have found on the net. The difference I see with the PBP manual's shematic and others is the pull-up resistor on RA4. I'll try this too.

    Yes, I'm using ICSP. Is it a problem to use the programmer's power source? It has 1A source and is very stable. I have installed a 3 pole switch to interrupt the MCLR, DATA and CLOCK lines once the PIC is programmed and I just keep Vdd and Vss.

    I'm using the MICROCHIP AN589 programmer and there are capacitors in this circuit. I will add a 0.1µF close to the PIC.

    About the defines, as far as I understood the PBP help file (in MicroCode Studio), I'm using the default settings so I thought the defines were not mandatory (am I wrong?).
    Roger

  6. #6
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default

    Well,

    I did all what you suggested and unfortunately it didn't work.

    The last thing may be... the display itself?

    I have three displays doing the same thing when connected to the PIC. The first is an ELECTROFONT 98301 (MK620NY-LY) and the second (I have 2 of them) is a VL 16265SS3 R2. I couldn't find their data sheets so I can only assume they are like almost all other displays "Hitachi 44780" compatible.

    These displays come from HP servers made around 2000.

    When adjusting the contrast, the display flickers a little.

    During the programming, the display stays always on.

    I even changed the PIC and still the same happens.

    I then tried to remove one-by-one the wires from the display hoping for a change. Unfortunately, until Vcc and GND are removed, the display stays like the picture I sent in a previous post.

    One more thing I just tested -which can sound really stupid- WITHOUT the PIC. Guess what, still the same.

    Any other idea?
    Last edited by flotulopex; - 12th September 2006 at 17:16.
    Roger

  7. #7
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex
    Any other idea?
    You say in your first post that you are using 16F88

    Try adding the line....

    ANSEL = %00000000 ' Disable Analogue Inputs

    ..to disable the analogue inputs which are on by default.

    Regards
    Keith

    www.diyha.co.uk
    www.kat5.tv

  8. #8
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hello again,

    DEFINES are not DEFAULTS. Defaults are part of the 16F88.inc file and pertain to certain setup requirements. These are also configurable by you if you need to change them for your particular application. DEFINES are used to setup things like LCD displays, serial printers or other types of serial outputs using the DEFINE DEBUG type statements. You must add the define statements yourself. Again another topic to read in the MELABS PBP manual.

    I don't know anything about the Microchip programmer. If I get a chance this coming weekend I'll look it up. I use the MELABS USB and EPIC programmers and they don't have enough power to handle programming and powering your circuitry.

    I ordered 4 of those serial LCD driver boards. If they get here by Thursday I'll get one built over the weekend and let you know how they work. I though the prices were well within reason.

    Sorry about the ansel = item. I didn't take the time to read the datasheet. Shame on me! But at least I was on the right track! Thanks Keith!!!

    BobK
    Last edited by BobK; - 13th September 2006 at 02:13.

  9. #9
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    One thing to look at - the pins on an LCD are a bit weird. The pins are numbered as if you put a connector on the FRONT side of the board.
    Most people put the pins out the backside. As a result, what you think is pin #1, really isn't

    Check that before you try anything else. If that is the problem (it reverses the odd and even pins), the display is probably destroyed.

    Don't ask me how I know all this !
    Charles Linquist

  10. #10
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by BobK
    Sorry about the ansel = item. I didn't take the time to read the datasheet. Shame on me! Thanks Keith!!!
    Neither did I !!!!

    I learnt the hard way the first time I used the 16F88 and couldnt get some of the pins on PortB to work right
    Keith

    www.diyha.co.uk
    www.kat5.tv

  11. #11
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default

    Well,

    Seems still to be lots of things to try before I jump out of the window ;-)

    It's lunch time now and still a few hours to go before I get back home to try/check everything you suggest.

    One thing is sure, I took a great care on the display's pins locations and this should not be wrong (the complete wiring is simple and I used colored wires to make it even more clear to check). Nevertheless, according to Charles's experience, I'll check this over again.

    Meantime, about the DEFINEs, where can I see what is "behind" this or that particular command? The PBP book (chap. 4.16) doesn't tell much about this.

    NB: I live on the groundfloor...
    Roger

  12. #12
    blainecf's Avatar
    blainecf Guest


    Did you find this post helpful? Yes | No

    Default code doesn't make the chip heat up.

    Chip heats up because it's in backwards. I know because I've done it several times! Easy to get things turned around.

    bcf

  13. #13
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default

    Still getting the same effect on my displays = first line, all pixels on; second line, all off - like picture in attachment in post #1.

    I'll order a new display and try again. Hope to give you more info shortly.

    Thank you for all your suggestions.

    Blainecf, I always put some nail varnish as a mark on the upper side of my PICs ...because what happened to you, happened to me too sometimes ago :-)
    Roger

  14. #14
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex
    Still getting the same effect on my displays = first line, all pixels on; second line, all off - like picture in attachment in post #1.
    Have you got a contrast pot connected and does the display change when you adjust it ?
    Keith

    www.diyha.co.uk
    www.kat5.tv

  15. #15
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Also without a data sheet you're making life hard for yourself as you are assuming that they follow the Hitachi 44780 standard, and trust me there are some variations on that standard. I had some LCD's that required a dual rail supply for the contrast. I didn't get anything showing until I had -5v on the contrast pin !

    The only way you are going to work out what is casuing the PIC to heat up is to pull everything off the breadboard and start again, and test at various stages, like connect up just the supply to the PIC and see if it heats up.. if it does then you need to check the supply to the PIC. I can't follow your threads above, but it seems like your using the PSU that powers the programmer - if so don't and try a seperate regulated 5v supply to the breadboard. The use of a 1amp 7805 regulator and a couple of 100uF capacitors will make a suitable supply for the test bed.

    From experience I also find that strange things can happen if you use ICSP and leave it connected to the programmer after loading the HEX. You may even find that this is the cause, and would suggest you make up a simple header from 0.1" pitch header pins so that after programing the header can be removed. This way you can test the circuit correctly, and eliminate any possible causes.

  16. #16
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi flotulopex,

    Open the PBP manual to section 5.39 LCDOUT. One the third page of the LCDOUT explanation is a listing of the DEFINES for setting up a two line LCD display. On the following page is a sample of connecting a LCD to a 16F84A.

    I think if you're getting "BLOCKS" to show on your display that the display is okay, it just needs a contrast adjustment. If your PIC is heating up, something has to be either inserted backwards in the breadboard or wired incorrectly. I've built the circuit in the manual and it worked!

    It is very possible that your LCD may not be Hitachi 44780 compatible and it needs a different setup configuration.

    We haven't heard anything on your level of experience with electronics. PICS do not have the power pins laid out like other ICs where their's are normally 14 or 16 for Vdd and 7 or 8 for Ground. Try sitting back and looking at everything you have hooked up and take your sketches or drawings and follow each and every little connection from point A to point B then check them all again. I can't believe you haven't gotten this problem resolved yet! It has to be something really simple!

    We all gone thru this kind of stuff at one point or another so we understand what you might be experiencing. Be patient and you will find it.

    BobK

  17. #17
    walphon1's Avatar
    walphon1 Guest


    Did you find this post helpful? Yes | No

    Default LCD Quandary

    I had the exact same problem. I even went out and purchase a new LCD. PIC basic allows you define the pins in order to use the LCDout function. My mistake was that after checking the output in which I was using to communicate the LCD, I was getting nothing on porta.0 and porta.1. That is because this set up for analog input by default. I had to find out the hard way. I redefine my pin layout and I use other pins on the PIC and it works. I am 90% sure that is your problem. Hopes this is helpful.

  18. #18
    RUBiksCUbe's Avatar
    RUBiksCUbe Guest


    Did you find this post helpful? Yes | No

    Default

    I had almost the exact same problem but with an 18F252 and without the heating issue. It ended up being a bad LCD screen.

  19. #19
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default

    Helle Everyone,

    Thank you for all your suggestions.

    Let me give you these comments to your posts:

    - Yes, the contrast works fine; but only on first line of the display - as long as I won't have find the specific data-sheet for this display, I'll have a doubt so I will buy a new one (already done yesterday - should arrive today);

    - The first display I used must have had a problem - since I use my second one, the PIC is staying "cold";

    - About the wiring which is very simple, I effectively started all over again with coloured wires to avoid any mistakes;

    - I use ICSP and keep only the Vdd and GND pins connected after the programming operation - I have built the AN589 programmer and added a switch to connect/disconnet MCLR, DATA and CLOCK instead of removing wires each time (btw, how do you do this?);

    - Yes, I used the example in the PBP manual and since it was not working, I found other examples such as Mikroelectronika and Chuck Hellebuyck's book;

    - My knowledge in electronic is basic (I'm an electrician) and have been making lots of gadgets for years - I would not be able to develop a complicated circuit even if Ohm's law is not a problem to me - I mostly grab some peace of schematics from here and there and adapt them together.

    I highly appreciate your help and I won't make you waste your time anymore until I am sure about the display I use. I cannot believe it still doesn't work after all your suggestions.
    Roger

  20. #20
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex
    According to the documentation I could find, I connected:
    Code:
    PIC ports Symbol           LCD pin
    PORTA.0	  DB4	           11
    PORTA.1	  DB5	           12
    PORTA.2	  DB6	           13
    PORTA.3	  DB7	           14
    PORTA.4	  RS	            4
    PORTB.3	  E	            6
    -	  Vss - GND	    1
    -	  Vdd / Vcc +5V	    2
    -	  Vee / Contrast    3
    -	  R/W	            5
    Pin 5 of the LCD display is READ/_WRITE which should be tied LOW for WRITING to the display. If this pin is floating then the LCD could well be in read mode hence why you cant initialise it or write to it.

    In addition to that, if it is in READ mode the databus to the PIC will have two active drivers on it, the one in the PIC and the one in the LCD.

    This could be why the PIC is getting cooked.

    Regards

    Keith
    Keith

    www.diyha.co.uk
    www.kat5.tv

  21. #21
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi again Flotul,

    "I highly appreciate your help and I won't make you waste your time anymore until I am sure about the display I use. I cannot believe it still doesn't work after all your suggestions."

    You are not wasting my time. I have been a troubleshooter for a long time and I enjoy challenges. That's why I'm here. AND I also learn from what we are doing here. I can't believe it's not working either so we should go back to square one.

    Do you even know if you are able to get a program into the PIC and that the PIC is even working?

    Disconnect the LCD completely and put a simple Switch/LED program into the PIC and see if it works. First put a program into one of the PORTA pins and if that works now you know your programmer is working and you can get PORTA to respond to activity. Then re-wire the PIC to get it to work with PORTB.

    Example:
    Hardware setup:
    Put a 10K pullup between PortA.0 and +5vdc
    Put a 10K pullup between PortB.0 and +5vdc
    Put a normally open switch between ground and PortA.0
    Put an LED between PortA.1 and a 470 ohm resistor to ground (remember
    the LED is polarity sensitive so plus side to PortA.1)
    Make sure you have a 4.7K or 1K resistor between MCLR and +5vdc

    Software setup:
    TRISA = %00000001 'All pins on PortA are outputs except PortA.0
    PortA = 0
    TRISB = %00000001 'All pins on PortB are outputs except PortB.0
    PortB = 0

    SwitchA var PortA.0
    LEDA var PortA.1
    SwitchB var PortB.0
    LEDB var PortB.1

    Start:
    If SwitchA = 0 then LEDA = 1
    LEDA = 0
    Pause 1000

    If SwitchB = 0 then LEDB = 1
    LEDB = 0
    Pause 1000
    goto Start

    This little program will cause the LEDA to lightup only if SwitchA is pressed.

    If this works then disconnect the switch wire from PortA.0 and put it on PortB.0, then disconnect the LED/Resistor from PortA.1 and put it on PortB.1.
    Retest the program.

    If this little test setup doesn't work on either port then perhaps your problem is in your programmer. You'll have to check it out then.

    I use commercially produced programmers, MELabs USB programmer and their EPIC parallel port programmeralong with their software and Microcode Studio IDE. There's nothing wrong with making your own but by buying a commercial product you get their support.

    Perhaps you could post the code you were using so we can see if there's a problem there also.

    I was looking back at my collection of notes from this site and found other people that have gone through the same problem. That's why I think we need to go back to square one and start troubleshooting the basics. Let me know!

    HTH,

    BobK

    I just got to thinking about something Mister E has brought up alot. If you are using a breadboard where you just plug things into the little holes then you could possibly have a problem with the crystal and its capacitors. Sometimes the contacts on the breadboard put too much of a load on the crystal so try removing the capacitors. Thanks Mister E!!
    Last edited by BobK; - 14th September 2006 at 11:45.

  22. #22
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    The crystal stuff is true for high value on some breadboard and on some circumstances. Wires must be keep short between crystal and PIC. Crystal pins must be as short as possible, capacitor too. On breadboard i usually use ceramic resonnator with built-in caps. In this case Flotulopex use the internal OSC so it's not the main cause.

    If the PIC heat.. it's probably because he's burn, died, Kaput. I would try to remove all extra hardware attach to, check the Vd/Vss wiring (maybe it's reverted) and see if it's still heat. If not, do a led blink on all i/o to be sure every i/o are still working.

    Maybe the config fuses are bad, maybe the LCD need special timing/start up delay. LCD_COMMANDUS, LCD_DATAUS could help.

    When you do ICSP, PGM pin should be pulled low to prevent interference caused by the high voltage on MCLR pin. Place a 1-10K resistor between this pin and GND. Also, have a look bellow
    http://www.melabs.com/support/icsp.htm

    Once you have program your PIC, you MUST remove at least, the MCLR/Vpp wire from your board as the programmer hold the pin to GND at the end of the process. a While back i did a ICSP switch box like...
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=163&d=1104851398">

    It's pretty handy!

    Be sure the Low Voltage Programming mode is disable in your config fuses. Try
    Code:
        '
        '    Pic Configuration
        '    =================
        '    Program Configuration Register 1
        @	__CONFIG    _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_ON & _MCLR_ON & _PWRTE_ON & _WDT_ON & _INTRC_IO		    		 
    
        '    Program Configuration Register 2
        @   __CONFIG    _CONFIG2, _IESO_OFF & _FCMEN_OFF
    Also allow the internal OSC to settle (stabilise). Give a 50mSec (or more) delay at the top may help.
    Last edited by mister_e; - 14th September 2006 at 14:52.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  23. #23
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default

    Hi BobK,

    I have the same kind of approach as you have. When nothing works = restart from scratch step by step.

    Now, to your suggestions, here are my answers:
    - Yes, I can easely program all my PICs without any trouble. That's the reason why I built different programmers before I really started programming.

    - Yes, I have checked my PICs ( I have 16F84A, 16F88 and 12F675 - actually I'm working with the 16F88) almost as you suggest and everything is fine; the PICs are all okay.

    - My code is is the 1st post of this thread and I corrected it according to your informations (DEFINES).

    - Mister_e is right; the breadboard my be a source of contact problems and this is why I have made test on my second breadboard too (the BasicStamp Pro Developpement Board).

    - Yes, I disconnect MCLR, DATA and CLOCK wires after programming the PIC (see a previous post).

    - I use the internal oscillator on pic 16F88 (no external crystal or resonator).

    - The fuses look to be set correctly; LPV is disabled.

    - In my code, I have made a 1 second pause to let the PIC and the LCD stabilise (may not be mandatory but I thought it would be better so).

    Mister_e, your schematic is great. Is your "Program/Run" switch automated (kind of monitoring the signal on MCLR)?

    I'm still in the office now and should have a new display waiting for me in my mailbox. I'll give you an update asap. Please wait until I have connected my knew display... I'm confused to see you working on lots of possibilities and me not able to provide reliable informations.
    Roger

  24. #24
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Mister_e, your schematic is great. Is your "Program/Run" switch automated (kind of monitoring the signal on MCLR)?
    Hehe funny that you talk about that. Few days ago, i did an automated version to do the switching with a VB application. When the focus is set to the device programer software, the ICSP interface switch to the Program mode, when i close or return to the code editor it goes to the Run Mode. it's on testing.. pretty good as now
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  25. #25
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default

    Finally

    !!! IT WORKS !!!

    I got my new display and connected it to my 16F88. Nothing :-(

    I changed to my 16F84A and now it is okay.

    I will try again with the 16F88 but I will use other ports than ports A.

    I'll come back asap.
    Roger

  26. #26
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default

    Mister_e,

    You were right: LPV must be switched off to make it work.

    As specified in the 16F88 data-sheet (chap 15-18), if LVP is selected, RB3 ceases to be a general purpose I/O pin. As I used this port in both tries (PortA and PortB), it coudln't work.

    In a few words, here is what happened to me:
    a.- three LCD displays not HD44780 compatible (even Murphy wouldn't have so much bad luck);
    b.- LVP switched on by default in ICPROG (my programming software).

    Thank you all for your support ...and patience.

    Hope this thread will help other people too.
    Roger

  27. #27
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Hé Flotulopex! on se fait une petite danse
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=881&d=1148640458">
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  28. #28
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default

    On thing is still unclear to me after this experience: the DEFINE commands.

    Since I want to understand this thing clearly, I have wired my display once more on the "original" layout (as in post #1) and modified the DEFINE commands back to "original" too. No worries, still working.

    I had to try this without the DEFINE commands and guess what, it works!!!

    Since I understood these command would be almost mandatory, it's beginning again to be a mess in my (small) brain. I'll open a new thread with this question.

    Thanks again to all of you.

    ***************************
    Mille mercis Steve,

    Tu avais la solution. Bravo! Alors, dansons la gigue :-)
    Roger

  29. #29
    Join Date
    Jun 2006
    Location
    Bangalore, India
    Posts
    136


    Did you find this post helpful? Yes | No

    Post Over heating not good

    Usually when a pic heats, it means it is fried. Try replacing it.
    If the LCD also heated when the pic did, it could also be fried...

  30. #30
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    it's been said... post #22
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  31. #31
    Join Date
    Jul 2005
    Posts
    78


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex
    Since I understood these command would be almost mandatory, it's beginning again to be a mess in my (small) brain.
    "Almost" is the opperational word here. The DEFINEs are optional if you connect the LCD the way PBP assumes you will connect them: data lines DB4-DB7 to Port A.0 to A.3, RS to A.4, E to B.3.

    If you connected your LCD this way then the defines are truly optional (and since you said your code did work without them then you had to have done just that).

    The manual says just this, check page 95.

  32. #32
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    For most DEFINE's, there is a corresponding default value declared in the library files. Perhaps we should create an FAQ that lists them, since there aren't that many. But for now, they can be found in the PBPPICxx.lib file in the PBP folder. Here are the LCD defaults from the PBPPIC14.lib.
    Code:
    ;****************************************************************
    ;* Default LCD port values                                      *
    ;****************************************************************
    
        ifndef LCD_DREG             ; LCD data pins port
    LCD_DREG EQU PORTA
        endif
        ifndef LCD_DBIT             ; LCD low order data bit (0 or 4)
    LCD_DBIT EQU 0
        endif
        ifndef LCD_RSREG            ; LCD register select pin port
    LCD_RSREG EQU PORTA
        endif
        ifndef LCD_RSBIT            ; LCD register select pin bit
    LCD_RSBIT EQU 4
        endif
        ifndef LCD_RWREG            ; LCD read/write select pin port
    LCD_RWREG EQU LCD_RSREG
        endif
        ifndef LCD_RWBIT            ; LCD read/write select pin bit
    LCD_RWBIT EQU LCD_RSBIT
        endif
        ifndef LCD_EREG             ; LCD enable pin port
    LCD_EREG EQU PORTB
        endif
        ifndef LCD_EBIT             ; LCD enable pin bit
    LCD_EBIT EQU 3
        endif
        ifndef LCD_BITS             ; Number of LCD data bits (4 or 8)
    LCD_BITS EQU 4
        endif
        ifndef LCD_LINES            ; Number of lines in LCD (1, 2, 4)
    LCD_LINES EQU 2
        endif
        ifndef LCD_COMMANDUS	; LCD command delay in us
    LCD_COMMANDUS EQU 2000
        endif
        ifndef LCD_DATAUS		; LCD data delay in us (0 - 255)
    LCD_DATAUS EQU 50
        endif
    DT

  33. #33
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default

    Thank you Darrel.

    It makes it more clear to me what PBP does "in the dark".
    Roger

Similar Threads

  1. Simple LCD code not working!...WHY?
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th November 2009, 19:48
  2. Replies: 2
    Last Post: - 5th November 2009, 17:07
  3. PIC16f690 LCD Not Working
    By hhosteam in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 3rd June 2009, 06:26
  4. Replies: 3
    Last Post: - 27th November 2007, 08:56
  5. A/D display result on LCD
    By winsthon in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 10th January 2004, 10:09

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts