Help for a new boy


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default Re: Help for a new boy

    Colin

    You haven't defined the label for 'mainloop' and tell the processor to goto mainloop. You're probably getting errors while compiling this code.

  2. #2
    Join Date
    Dec 2013
    Posts
    6


    Did you find this post helpful? Yes | No

    Default Re: Help for a new boy

    just checked the code and have got mainloop defined - don't why it didn't copy over.
    Code:
     ' Name        : Test44.pbp
    ' Compiler    : PICBASIC PRO Compiler 3.07
    ' Assembler   : PM
     'Button press turns on LED  
    
    mainloop:
    
        If PB = 0 Then ' If button pressed...
         low LED      ' Turn on LED
       Else
         high LED     ' Turn off LED
       Endif
    
       Goto mainloop  ' Do it forever
    
       End
    I am using PBP3.071 and and I guess MPASM if that is the default installed.

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Help for a new boy

    It will be easier for members to help if you post all your code. You don't have any CONFIGs, no oscillator setting, LED is not defined as a beginning.

    Are the proper pins digital by default on this device?

    Robert

  4. #4
    Join Date
    Dec 2013
    Posts
    6


    Did you find this post helpful? Yes | No

    Default Re: Help for a new boy

    The earlier code posted has all the detail

    Led var GPIO.1 etc

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


    Did you find this post helpful? Yes | No

    Default Re: Help for a new boy

    Code:
    DEFINE PIC12F629, INTRC_OSC,INTRC_OSC_NOCLKOUT,WDT_ON,PWRT_ON,MCLR_OFF, BOD_ON , CPD_OFF , PROTECT_OFF 
    Define OSCCAL_1K 1 ' PIC12F675, Calibrate internal oscillator
    DOES NOT WORK IN pbp3.xxx which is why I asked you, in fact it does not work in MPASM with ANY version of PBP as it is for the PB assembler which PBP3.xx does not support.
    Code:
    @ __CONFIG _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BOR_OFF & _FCMEN_OFF & _IESO_OFF
    above would be how to config MPASM in PBP versions earlier than PBP3.00


    PBP 3.xx configs are done as in below:
    Code:
    #CONFIG
        __CONFIG _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_ON & _WDT_ON 
    ;__config _CONFIG2, _WRT_OFF & _BOR40V
    #ENDCONFIG
    All that said you will need to make appropriate changes to what I posted for your particular chip, but that is how to format your configs
    Last edited by Archangel; - 15th December 2013 at 06:07.
    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.

  6. #6
    Join Date
    Dec 2013
    Posts
    6


    Did you find this post helpful? Yes | No

    Default Re: Help for a new boy

    Thanks for the config help

Similar Threads

  1. Replies: 2
    Last Post: - 26th February 2011, 16:56
  2. Boy, what a great place this is!!!
    By muddy0409 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 17th June 2007, 18:42

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