blink.bas help cant make any 18f's work


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Dec 2004
    Location
    Scarborough UK
    Posts
    77

    Angry blink.bas help cant make any 18f's work

    Hi everyone

    Im not new to pbp or making programs for the 16f877 but i am new to the 18f series pic's

    I cant get anything to work on a 18f452 :-(

    im using pbp 2.45, epic 2.44 and labx1 board

    I compile a program for a 16f877 and it works fine

    i compile a program for a 18f452 (even the blink.bas) and it will not work.
    the code seems to go into the chip (cos i can read it back)

    can anyone send me a code snipet that will definatley work with a 18f452.

    Heeeelllllpp, its driving me nuts, what am i doing wrong ???
    Reading the datasheet & understanding it are two different things.

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


    Did you find this post helpful? Yes | No

    Default

    How do you have your X1 oscillator configured?

    I.E. what position are jumpers ABC in?
    Regards,

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

  3. #3
    Join Date
    Dec 2004
    Location
    Scarborough UK
    Posts
    77


    Did you find this post helpful? Yes | No

    Default blink.bas help cant make any 18f's work

    Hi Bruce

    they are set at A=1+2 B=2+3 C=2+3 set at 8mhz i think

    -----------
    Bri
    Reading the datasheet & understanding it are two different things.

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


    Did you find this post helpful? Yes | No

    Default

    Yep that should set it for 8MHz.

    1. You'll need to set the osc config fuse for HS
    2. Be sure you're using MPASM as the assembler.
    3. Be sure to select the 18F452 at compile time.
    4. Make sure your programmer is not changing any config fuse
    settings before you program the 18F.

    The PBP header file for this particular PIC has default config fuse settings. I think it's set for XT which is only good for up to 4MHz.

    Open your 18F452.INC file found in your PBP INC file directory.

    Make the change (shown below), save, exit, re-compile, and program your 18F on your LAB-X1. Should work fine.

    INCLUDE "P18F452.INC" ; MPASM Header
    ;__CONFIG _CONFIG1H, _OSCS_OFF_1H & _XT_OSC_1H
    __CONFIG _CONFIG1H, _OSCS_OFF_1H & _HS_OSC_1H
    __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
    __CONFIG _CONFIG4L, _LVP_OFF_4L

    Note: Just comment out the 1st line shown above, and enter the next one with the _HS_OSC_1H.

    That sets your config fuse up for the higher oscillator speed. The simple blink program below should work fine.
    Code:
    DEFINE OSC 8
    
    Main:
       HIGH 0
       PAUSE 250
       LOW 0
       PAUSE 250
       GOTO MAIN
    Regards,

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

  5. #5
    Join Date
    Dec 2004
    Location
    Scarborough UK
    Posts
    77


    Did you find this post helpful? Yes | No

    Default blink.bas help cant make any 18f's work

    Bruce

    Thanks for taking the time to help me, i realy apreciate it.
    I will go now to try the things you suggest.

    I feel like a newbie again, lol :-).
    I've been away from the pic scene for over a year and have just upgraded my pbp and epic in atempt to get back into it.

    As ever, you and the guys, and gal i belive, have come to my swift rescue.

    Thanks again
    I'll let you know if it works
    ----------------------
    Bri
    Reading the datasheet & understanding it are two different things.

  6. #6
    Join Date
    Dec 2004
    Location
    Scarborough UK
    Posts
    77


    Did you find this post helpful? Yes | No

    Default Problem Solved, Thanks Bruce

    Thanx Bruce

    I changed the INC file like you said and it didnt work, then i changed the epic configuration to HS and it worked!! :-)

    Thanks a lot Bruce
    ------------------------
    Bri
    Reading the datasheet & understanding it are two different things.

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


    Did you find this post helpful? Yes | No

    Default

    You can fix that under the EPIC Options menu.

    Place a check mark next to;

    Program/Verify Configuration
    Update Configuration
    Reread File Before Programming

    Another option you'll want checked is;

    Erase Before Programming
    Regards,

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

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. Replies: 3
    Last Post: - 7th June 2008, 21:17
  4. 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
  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