Newbie need Help 16F627a


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    49

    Default Newbie need Help 16F627a

    Hi all,

    I have problem with my first experience with of PBP PIC
    My first attemp is blink an LED.

    here is my program

    CMCON = 7


    TRISB.1 = 0


    LED VAR PORTB.1 ' alias PORTB.4 to LED

    loop: high LED ' turn on LED connected to PORTB.1
    Pause 5000 ' delay for 5 seconds

    low LED ' turn off LED connected to PORTB.1
    Pause 1000 ' delay for 1 seconds

    GoTo loop ' loop and blink LED forever

    My problem
    The LED did not turn on but when I (accidently) touch one of the pic pin the
    led will on for a while then off again.

    Can somebody help me with this problem.

    Really need help from all the gurus in this forum.

    Thanks and regards.

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


    Did you find this post helpful? Yes | No

    Default

    Do you have a crystal and capacitors attached to the OSC pins, or a resonator? Add this to your code DEFINE OSC 4 . Use 4 if you are using 4mhz xtal, if you are using faster xtal you will need to change your default config statement to accept it.
    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.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Kind of sounds like you left the /MCLR pin floating.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bruce View Post
    Kind of sounds like you left the /MCLR pin floating.
    DOH ! I missed that one . .
    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.

  5. #5
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    49


    Did you find this post helpful? Yes | No

    Default

    Hi all.
    thanks for the reply.
    Joe S. I'm using 20mhz xtal. After Define still the same.

    Bruce what should i do with the MCLR pin. I am totally zero with PIC but have some experience with BS2.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by azmax100 View Post
    Hi all.
    thanks for the reply.
    Joe S. I'm using 20mhz xtal. After Define still the same.
    OK 20 mhz will not work with the default config statement, to use 20 mhz you must change it or comment it out of the PIC16F627A.INC file located in the PBP Directory. The Default config is set to use XT_OSC and the 20 mhz requires HS_OSC, what it does internaly is to provide the oscillator with more power, as it is needed to run that fast. Study this link : http://www.picbasic.co.uk/forum/showthread.php?t=543 As for the MCLR PIN tie a resistor about 5k ohm from mclr to thr 5v+ supply. To reset the PIC you then momentaraly ground it, OR in the config statement you turn it off and use it as an I/O.
    Last edited by Archangel; - 18th January 2009 at 08:22.
    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.

Similar Threads

  1. Newbie making an ignition timer
    By ChrisHelvey in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 5th August 2012, 17:45
  2. Newbie: Temperature measurements
    By Budda in forum General
    Replies: 10
    Last Post: - 30th March 2007, 09:56
  3. PIC Newbie
    By azmax100 in forum Schematics
    Replies: 7
    Last Post: - 23rd February 2007, 04:52
  4. request for a newbie forum
    By nimonia in forum Forum Requests
    Replies: 1
    Last Post: - 20th May 2006, 09:01
  5. 16F627A portA4 problem?
    By markedwards in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 22nd October 2005, 19:54

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