Pic18f252


Closed Thread
Results 1 to 5 of 5

Thread: Pic18f252

  1. #1
    Join Date
    Aug 2005
    Posts
    95

    Default Pic18f252

    I needed more code space so I decided to use the pic18f252, the alterations to my hardware is not the problem but the configuration, if I was using a pic 16f876 I would normally add the line @ DEVICE XT_OSC, WDT_OFF, LVP_OFF, PROTECT_OFF, BOD_OFF, CPD_OFF, WRT_OFF to set the fuses, but the 18f252 according to my programmer requires 'configuration 1,2,3,4,5,6,7 ID value'. Does anyone know the code required to configure this chip.

    Thanks Sphere...

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


    Did you find this post helpful? Yes | No

    Default

    Melanie's got you covered.

    Presetting Configuration Fuses (PIC Defines) into your Program http://www.picbasic.co.uk/forum/showthread.php?t=543
    <br>
    DT

  3. #3


    Did you find this post helpful? Yes | No

    Default

    This is for the 452 but I think it should be pretty much the same thing.

    Code:
    @ __CONFIG _CONFIG1H, _OSCS_OFF_1H & _HSPLL_OSC_1H
    ' Oscillator Switchover Disabled
    ' Oscillator Type HS PLL    
     
    @ __CONFIG _CONFIG2L, _BOR_ON_2L & _PWRT_ON_2L & _BORV_45_2L
    ' Brown-Out Reset Enabled
    ' Power-Up Timer Enabled
    ' Brown-Out Reset Voltage 4.5V
    
    @ __CONFIG _CONFIG2H, _WDT_ON_2H 
    ' Watch Dog Timer Enabled
    
    @ __CONFIG _CONFIG4L, _STVR_ON_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
    ' Stack Over/Underflow Reset Enabled
    ' Low Voltage ICSP Programming Disabled
    ' Background Debugger Disabled

  4. #4
    Join Date
    Aug 2005
    Posts
    95


    Did you find this post helpful? Yes | No

    Default 18f252 config problems

    Sorry I didnt reply to this sooner but ive just got my hands on a 18f252, Im still having problems setting the oscilator type in the config. Im trying to set it for a 4mhz crystal. What do I have to add to the following line.

    @ __CONFIG _CONFIG1H

    Thanks for the replys so far Sphere...

  5. #5
    Join Date
    Aug 2005
    Posts
    95


    Did you find this post helpful? Yes | No

    Default Sorted

    Sorted the problem out with the config, it was down to the default setting in pic basic pro inc files, just cleared the default settings and it now compiles without errors. Ive another issue, my program was wrote for a pic 16f876, it runs perfect. But when loaded on to an 18f252 it runs initially but then it will either reset or just lockup the program. I assume it down to the extra features in the 18f252 which need turning off. If possible can someone post the options for turning these features on and off.


    Thanks Sphere...

Similar Threads

  1. firmware code for pic18f252
    By babalola in forum Off Topic
    Replies: 7
    Last Post: - 8th May 2008, 12:10
  2. Problem with ASM IRQ using FSR0 on PIC18F252
    By mytekcontrols in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 11th March 2008, 20:48
  3. Migrating PIC16F876a to PIC18F252
    By cohenjdc in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 1st June 2007, 13:55
  4. pic18f252 hserout problem
    By edysan in forum Serial
    Replies: 4
    Last Post: - 16th June 2006, 20:46
  5. DATA on a PIC18F252
    By BigWumpus in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th October 2005, 09:05

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