BLINK.BAS - Can't make it work!!!! Please help!!


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2008
    Posts
    16

    Unhappy BLINK.BAS - Can't make it work!!!! Please help!!

    I just got all set up with my programmer (it's a couple years old, but still seems to be functioning fine, it's the EPIC pro.) And I just bought the PICBASIC compiler. I loaded the sample program BLINK.BAS:

    loop:
    High 0 ' Turn on LED connected to PORTB.0
    Pause 500 ' Delay for .5 seconds

    Low 0 ' Turn off LED connected to PORTB.0
    Pause 500 ' Delay for .5 seconds

    Goto loop ' Go back to loop and blink LED forever
    End


    BLINK.HEX: incase this means anything to you...

    0000- 1e03 0008 0186 305f 008c 300d 0084 0180
    0008- 0a84 0b8c 2807 282c 2021 0084 3907 0684
    0010- 1003 0c84 0c84 0c84 1a04 1784 1204 018a
    0018- 0782 3401 3402 3404 3408 3410 3420 3440
    0020- 3480 3907 018a 0782 3430 3431 3432 3433
    0028- 3434 3435 3436 3437 3000 2041 3001 00a3
    0030- 30f4 2048 3000 203d 3001 00a3 30f4 2048
    0038- 282c 203a 3007 2055 283a 200c 3aff 0580
    0040- 2845 200c 0480 2844 3aff 1784 0580 2864
    0048- 00a2 205e 0064 0823 0422 1903 0008 30f7
    0050- 3eff 1d03 2850 2060 284a 1683 38f8 0581
    0058- 390f 0481 0063 300f 0481 2864 09a3 09a2
    0060- 0aa2 1903 0aa3 0008 1283 0064 0008


    Using a 16F84A
    I have MicroCode Studio set to 16F84A as well as meLabs Programmer v4.23
    I am attempting to use the internal oscillator so have set meLabs to RC.
    Watchdog timer: enabled
    Power up timer: disabled
    Code Protect: off

    I am getting a "Code Programming Error at 0000" when I try to program.

    I first erase the chip, and then read it and it reads:
    0000- 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3fff
    0008- 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3fff
    0010- 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3fff
    0018- 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3fff
    etc...

    I program the chip, it gives me the error, and it then I read it and it reads:
    0000- 1e03 3fff 3fff 3fff 3fff 3fff 3fff 3fff
    0008- 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3fff
    0010- 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3fff
    0018- 3fff 3fff 3fff 3fff 3fff 3fff 3fff 3fff
    etc...

    I've tried this with a half a dozen chips with the same result each time. Note that the chips have been on my shelf for a couple years too. In their anti-static packaging in a fairly dry, temperate atmosphere.

    I notice that when I load the HEX file into meLabs, it automatically calls up a XT oscillator, and I have been changing it from XT to RC. Do I need to specify RC in MicroCode IDE or in the program somewhere?

    Is there anything else I'm missing? Any help would be greatly appreciated, as I'm pretty new to this.
    Last edited by chien_fu; - 7th June 2008 at 18:20.
    www.theLanguageBear.com - Multi-Lingual books for kids and adults of all skill levels.

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


    Did you find this post helpful? Yes | No

    Default

    Well, first off ... The 16F84A doesn't have an Internal Oscillator.
    RC mode is for an external Resistor and Capacitor.
    But that doesn't explain your problem programming them.

    Are you programming it in a Zif socket?
    Or is the chip "In Circuit"?

    If In-circuit, what else is connected to RB6, RB7 and MCLR?
    <br>
    DT

  3. #3
    Join Date
    Jun 2008
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    huh.. good to know about the oscillator.. I'll have to look into that.
    I am not using a zif socket, but it is not in-circuit either, I am just using the 18-pin socket on the EPIC programmer. I think my ZIF is not working for some reason. The chip reads all 0000's when I try to use the ZIF.
    www.theLanguageBear.com - Multi-Lingual books for kids and adults of all skill levels.

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


    Did you find this post helpful? Yes | No

    Default

    In the same folder as EPICWIN.EXE

    There's a file named EPIC.HTM. Open it with a web browser.
    Look at the section labeled EPIC Troubleshooting

    One of them usually fixes most problems.
    <br>
    DT

Similar Threads

  1. Change On Interrupt, PIC16F884
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 14th November 2008, 17:25
  2. PBP is driving me crazy trying to make an 18F chip blink
    By George in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 20th June 2008, 06:08
  3. How to set ICD-2 clone to work with PBP?
    By G-R-C in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th October 2006, 02:50
  4. blink.bas help cant make any 18f's work
    By Bonxy in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 13th December 2004, 21:28
  5. Pin RA4 doesn't work
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 15th July 2004, 12:03

Members who have read this thread : 0

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