16f688 lcd connection


Closed Thread
Results 1 to 14 of 14

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Hello emerson,
    put the word code inside brackets [xxxx] and close with / code inside brackets [/xxxx] to enclose your code in a box. Check your contrast setting, I almost always just ground that pin, check your wiring for proper hookup AND for good connection. As I have not looked at the chips data sheet, check to be sure you have turned off ALL analog functions on the lcd's pins . . . are you sure ? Is your led flashing ? have you used bypass caps on the power at the PIC and LED ? Black boxes tell you LCD is alive more or less,so if led is flashing then so is PIC if not check your crystal and power connections first. A big ALSO, what config fuses are you using? The default ones? What are they ? Is the MCLR enabled ? do you have it pulled high ?
    A good time to add DEFINE OSC xx where xx is your selected value.
    Read and understand these threads please:
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    http://www.picbasic.co.uk/forum/showthread.php?t=561
    They will reduce your headache pain considerably, (caused by pulling hair) and with some luck you will keep more than I did . . .
    hair that is . . .
    Many Many people ask WHY the authors of PIC books suggest the 16f84 chip, and I can answer that, it is because it has almost nothing to set up to get it to work, so beginners do not get frustrated so early on, your chip does have plenty of nice features which make getting started a bit more challenging, BUT you came to the right forum to get some help too.
    Hang in there, you are getting it.
    Last edited by Archangel; - 9th December 2010 at 03:25. Reason: add comment
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  2. #2
    Join Date
    Dec 2010
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    Hello emerson,
    put the word code inside brackets [xxxx] and close with / code inside brackets [/xxxx] to enclose your code in a box. Check your contrast setting, I almost always just ground that pin, check your wiring for proper hookup AND for good connection. As I have not looked at the chips data sheet, check to be sure you have turned off ALL analog functions on the lcd's pins . . . are you sure ? Is your led flashing ? have you used bypass caps on the power at the PIC and LED ? Black boxes tell you LCD is alive more or less,so if led is flashing then so is PIC if not check your crystal and power connections first. A big ALSO, what config fuses are you using? The default ones? What are they ? Is the MCLR enabled ? do you have it pulled high ?
    A good time to add DEFINE OSC xx where xx is your selected value.
    Read and understand these threads please:
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    http://www.picbasic.co.uk/forum/showthread.php?t=561
    They will reduce your headache pain considerably, (caused by pulling hair) and with some luck you will keep more than I did . . .
    hair that is . . .
    Many Many people ask WHY the authors of PIC books suggest the 16f84 chip, and I can answer that, it is because it has almost nothing to set up to get it to work, so beginners do not get frustrated so early on, your chip does have plenty of nice features which make getting started a bit more challenging, BUT you came to the right forum to get some help too.
    Hang in there, you are getting it.
    As of now I have the contrast pin tied to ground, the MCLR pin pulled high via 10K resistor, all of my wiring is good and has good connection, I have the bypass cap (0.1uf) on the power source (5V USB) and the LED is blinking. I'm reading the documents you sent and I'm understanding them little by little. Still trying to figure out how to set config fuses. Do I need to enable MCLR in the program or does pulling it high do the trick?

  3. #3
    Join Date
    Dec 2010
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    I'm having trouble understanding how to set the config fuses, could you give me an example or at least explain it to me? Thanks.
    Last edited by emerson; - 9th December 2010 at 05:07.

  4. #4
    Join Date
    Dec 2010
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by emerson View Post
    I'm having trouble understanding how to set the config fuses, could you give me an example or at least explain it to me? Thanks.
    This is what I have so far, and it compiles with no errors, but it still isn't doing the trick

    'Configuration Fuses
    @__EXTRC_OSC_NOCLKOUT
    @__WDT_OFF
    @__PWRTE_ON
    @__MCLRE_OFF
    @__BOREN_ON
    @__LVP_OFF
    @__CP_ALL
    @__DATA_CP_ON
    @__FCMEN_ON

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


    Did you find this post helpful? Yes | No

    Default

    You've not mentioned which version of PBP you are using. I think I'm correct in stating that you can't use the word loop as a label in vers 2.60. Things like "main" are probably OK.

    I've just searched through my PIC samples and don't have the one you are using. Is there any reason why you chose this PIC to use with an LCD as there are lots of other PICs that don't have the amount of functionality crammed into it as the 688.

    As you have stated that you have a flashing LED, this would suggest the code is running, but the LCD isn't responding... this suggests a timing issue. You have used what looks like an external config setting (@__EXTRC_OSC_NOCLKOUT) but in the code it states "internal 4Mhz". Are you using the internal 4Mhz timing or an external crystal, if internal then that fuse should be something like @_INTRC_OSC_NOCLKOUT.

    It's also worth posting up your schematic of how you have the hardware set up

  6. #6
    Join Date
    Dec 2010
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c View Post
    You've not mentioned which version of PBP you are using. I think I'm correct in stating that you can't use the word loop as a label in vers 2.60. Things like "main" are probably OK.
    I'm using PBP v2.47 with the MPASM assembler.

    I've just searched through my PIC samples and don't have the one you are using. Is there any reason why you chose this PIC to use with an LCD as there are lots of other PICs that don't have the amount of functionality crammed into it as the 688.
    Well, I was introduced to pic chips my freshman year in high school and the 16f688 is what we used in electronics class my 4 years there. All we did with them was blink lots of LEDs so we never had to learn much of the configuration steps.

    As you have stated that you have a flashing LED, this would suggest the code is running, but the LCD isn't responding... this suggests a timing issue. You have used what looks like an external config setting (@__EXTRC_OSC_NOCLKOUT) but in the code it states "internal 4Mhz". Are you using the internal 4Mhz timing or an external crystal, if internal then that fuse should be something like @_INTRC_OSC_NOCLKOUT.
    I'm using an external 10MHz oscillator. I didn't notice I had two different oscillator settings, good lookin' out.

    It's also worth posting up your schematic of how you have the hardware set up
    my circuit looks exactly like this with the two exceptions being the reset switch on MCLR (MCLR is still pulled high) and an external 10MHz crystal between pins 2 and 3
    http://embedded-lab.com/blog/?attachment_id=685

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by emerson View Post

    my circuit looks exactly like this with the two exceptions being the reset switch on MCLR (MCLR is still pulled high) and an external 10MHz crystal between pins 2 and 3
    I assume with two small capacitors between each pin and GND - typically 15pf - 33pf ?

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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