I Just Can't Get it to Blink - 16F628


Closed Thread
Results 1 to 5 of 5
  1. #1
    Spindle's Avatar
    Spindle Guest

    Question I Just Can't Get it to Blink - 16F628

    Hey guys and gals,

    I have been working none stop for the last 3 days trying to get my pic to just blink an led. The pic is a 16F628. I am using the 18 pin prototyping board from http://www.dhmicro.com/prod_r18i.html I think I have hooked up everything correctly. No caps are blown. I am using the T0-220 v-reg so I can source more than 100milliamps. Anyways Here is my code. I am using Pic Basic Pro and the Epic Programmer. This is to flash the led on PORTB.4 and I am trying to use the internal oscillator.

    @ DEVICE pic16F628, INTRC_OSC_NOCLKOUT ' system clock options
    @ DEVICE pic16F628, WDT_ON ' watchdog timer
    @ DEVICE pic16F628, PWRT_ON ' power-on timer
    @ DEVICE pic16F628, MCLR_OFF ' master clear options (internal)
    @ DEVICE pic16F628, BOD_ON ' brown-out detect
    @ DEVICE pic16F628, LVP_OFF ' low-voltage programming
    @ DEVICE pic16F628, CPD_OFF ' data memory code Protect
    @ DEVICE pic16F628, PROTECT_OFF ' program code protection


    TRISB.4 = 0


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

    loop: High LED ' turn on LED connected to PORTB.4
    Pause 500 ' delay for .5 seconds

    Low LED ' turn off LED connected to PORTB.4
    Pause 500 ' delay for .5 seconds

    GoTo loop ' loop and blink LED forever

    End


    Thanks in advanced

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    The program is good... so, have you wired it up correctly? Done something silly like put the LED in the wrong-way around? Got +5v on the right pin? Checked you've paid your electric bill?

  3. #3
    sinoteq's Avatar
    sinoteq Guest


    Did you find this post helpful? Yes | No

    Default

    I think Melanie is on to something, check +5V supply. If jumper JU2 (close to the ISCP connector in the Board Schematics) is missing things will not start. If it is missing programming will work but when you remove the Epic, +5V will not go to the PIC. Guess it is time to bring out the old voltmeter.

  4. #4
    Spindle's Avatar
    Spindle Guest


    Did you find this post helpful? Yes | No

    Talking

    I want to thank you both! The program was correct as Melanie stated and thanks sinoteq for looking at the schematic. Since I didn't want to use the boards ICSP for programming the pic I didn't even read that part of the document or look at that part of the schematic. All that was needed was two little jumpers! one of them being JU2 and the other a jumper for a diode. Thanks again!

  5. #5
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Melanie,

    MM>Checked you've paid your electric bill?<<

    I do enjoy your humor...
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

Similar Threads

  1. Simple Blink program doesnt work.
    By sccoupe in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 1st March 2009, 20:30
  2. Can't get blink circuit to work :(
    By Techbuilder in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 31st January 2008, 13:00
  3. 16F628 problems
    By fowardbias in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 11th January 2006, 07:38
  4. SERIN2 not working with 16F628
    By d1camero in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2004, 20:37
  5. 16F628 on-chip eeprom problem
    By atomski in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 4th March 2004, 07:43

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