16f688 lcd connection


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    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

  2. #2
    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 ?

  3. #3
    Join Date
    Dec 2010
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c View Post
    I assume with two small capacitors between each pin and GND - typically 15pf - 33pf ?
    What's the purpose of these capacitors? the lowest value I have is 51pf, will this work?
    Last edited by emerson; - 9th December 2010 at 18:10.

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


    Did you find this post helpful? Yes | No

    Default

    They are required as part of the timing circuit - take a read of page 9 of the PBP manual.

    You can't simply place a crystal between the two pins, it needs to oscillate and these caps between GND and the pins are required to make the thing resonate

    http://en.wikipedia.org/wiki/Crystal_oscillator

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by emerson View Post
    What's the purpose of these capacitors? the lowest value I have is 51pf, will this work?
    I tend to stick with 22pf. If you google crystal resonators or look at the images most are no higher than 33pf - but you've nothing loose by trying the ones you have

  6. #6
    Join Date
    Dec 2010
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Would the 16c505, 16f630, or 16f627 be any easier to configure? I just found some in a box of components.

  7. #7
    Join Date
    Dec 2010
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by emerson View Post
    Would the 16c505, 16f630, or 16f627 be any easier to configure? I just found some in a box of components.
    HEY!!! I tried my code with both the 16f630 and the 16c505 and it worked! Too bad you can only program 16c505 once, oh well.

    Thanks to everyone for their help. I really appreciate your time and effort.
    Last edited by emerson; - 9th December 2010 at 19:37.

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


    Did you find this post helpful? Yes | No

    Default

    Hi emerson,
    glad it works with the chip you tried, but it should work with the 16F688 too. I am still leaning toward an analog function killing it. I did not see ANSELH in the data sheet but have found that to cause chips that have it to not do digital, try ANSELH=0 , if the compiler errors then it is invalid, but it is worth a try,(it is free to try, right?). You say you are set up to use MPASM. MPASM configs are different than the PB configs you have shown, and at any rate to use your own configs you MUST open the 16F688.inc file in your PBP root directory and comment out the config statements inside of it by adding a semicolon [ ; ] just ahead of them, there are 2 configs there one for PB and the other for MPASM. MPASM will look like
    @ __config, HS_OSC & MCLRE_OFF & . . . . if you do not comment them out you will get compile error complaint of overwriting . . . and it will use the default config you failed to comment out.
    Here is a link similar:
    http://www.picbasic.co.uk/forum/showthread.php?t=12695
    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.

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