[Beginner Tutorial] How to get started with PICBASIC PRO Demo, MPLAB & PICKIT 2


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: [Beginner Tutorial] How to get started with PICBASIC PRO Demo, MPLAB & PICKIT 2

    I am programming with a 16F628A and can't figure out the code for the PIC configuration. I am using a 20mhz crystal and have configured the program with the DEFINE OSC 20. I am at a loss to get the chip config to be accepted though.
    Thanks

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: [Beginner Tutorial] How to get started with PICBASIC PRO Demo, MPLAB & PICKIT 2

    Hi,
    For 20MHz operation you need to set the HS_OSC option. If you're using PBP3 then try
    Code:
    #CONFIG
       __config _HS_OSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
    #ENDCONFIG
    /Henrik.

  3. #3
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: [Beginner Tutorial] How to get started with PICBASIC PRO Demo, MPLAB & PICKIT 2

    My little bit of advice don't forget:-
    :-

    MCLRE_ON means that MCLRE acts as a reset pin. It needs to be tied to +5v with a resistor (10K or similar)

    Caught me out several times…. Or turn just off if you don't need a reset facility.

    //Andy

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: [Beginner Tutorial] How to get started with PICBASIC PRO Demo, MPLAB & PICKIT 2

    I copied the code to the program file and still got syntax errors.

    #CONFIG
    __config _HS_OSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
    #ENDCONFIG

    I am using MicroCode Studio Pro to complile the program and PICKIT2 for programming.
    Thanks
    Dave

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: [Beginner Tutorial] How to get started with PICBASIC PRO Demo, MPLAB & PICKIT 2

    Quote Originally Posted by citationjet100 View Post
    I copied the code to the program file and still got syntax errors.

    #CONFIG
    __config _HS_OSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
    #ENDCONFIG

    I am using MicroCode Studio Pro to complile the program and PICKIT2 for programming.
    Thanks
    Dave
    . . . and no mention of which version of PBP . . .
    Hi Dave,
    The configs you are using are only for version 3.xx and later versions to come.
    If you are using any earlier version this thread has everything you need to know: http://www.picbasic.co.uk/forum/showthread.php?t=543

    ver 3.xx Make sure you have some spaces just before __config as Assembly is fussy that wayName:  config.png
Views: 6759
Size:  3.5 KB
    Last edited by Archangel; - 18th October 2014 at 22:57. Reason: add img
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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