18F4520 Configs


Closed Thread
Results 1 to 9 of 9

Thread: 18F4520 Configs

  1. #1

    Thumbs up 18F4520 Configs

    Hi all,

    i've just read retepsnikrep' post about the 16F886 config and i have a similar question:

    Can anyone show me an example of the configs using MPASM for the 18F4520 ?

    I have tryed many different options but ended up with errors compiling.

    Thanks
    Last edited by ruijc; - 10th June 2010 at 12:40.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    What are the parameters?
    In the meantime goto
    program files-microchip-mpasm suite
    there you will find an inc file for the chip. At the end of the file all of the config options are listed.
    Dave
    Always wear safety glasses while programming.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Greetings mackrackit,

    I've looked in the folder you mentioned and the file is called P18F45K20.INC.

    I've looked inside the file and found the OSC ( _FOSC_HS_1H EQU H'F2' ; HS oscillator ) and MCLR ( _MCLRE_OFF_3H EQU H'7F' ; RE3 input pin enabled; MCLR disabled ) lines.

    However, i'm trying to place these into the code but i'm not being able to succeed.

    Tryed stuff like :

    @ __CONFIG _CONFIG1, _FOSC_HS_1H
    @ __CONFIG _CONFIG3H, _MCLRE_ON_3H

    but dont work

  4. #4
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ruijc View Post
    but dont work
    Hmm, not too much to go on here, but..

    Have you read the wiki here:
    http://www.picbasic.co.uk/forum/cont...o-your-Program ? Especially the end where it says don't forget.....

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Thanks scalerobotics,

    Got it working,

    just a quick question:

    The lines remarked in PBP's Inc file are default settings ? This means if i dont add the config lines in the code PBP will set these fuses by it self ( and by remarking them there will be no default settings ).

    Is this correct ?

    Thanks

  6. #6
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ruijc View Post

    The lines remarked in PBP's Inc file are default settings ? This means if i dont add the config lines in the code PBP will set these fuses by it self ( and by remarking them there will be no default settings ).

    Is this correct ?
    Yes, you've got it. You can either edit it in PBP's inc files, and change it chip by chip. Or you can remark them out of PBP's inc files, and put them in your code for each project. They are the default settings. I usually copy them into my project, remark them out of PBP's inc file, and use them as a starting point.

    Glad you've got it working.

    Walter

  7. #7


    Did you find this post helpful? Yes | No

    Default

    I agree with you and that's how i'll do

    Thanks Walter

    My best regards
    Rui

  8. #8
    latitjuig's Avatar
    latitjuig Guest


    Did you find this post helpful? Yes | No

    Default p18f45k20 beginer, help please!!!

    Hi everybody. I got a pickit3 with a p18f45k20 chip. I would like to program in C. I would like to control a dc motor by pressing the button on the demo board or by connecting two switches, on for forward motion and one for reverse. can ANYBODY please help me with an example and please tell me what compiler i need to download etc. ive got mplab.
    Or if it is easier to control a servo motor a example will be appriciated aswell. thanks

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


    Did you find this post helpful? Yes | No

    Default

    I would like to program in C
    Your best bet for finding help would be on the forum for the C compiler you're using. Not on one for a BASIC compiler...
    Regards,

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

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