PicBasic Question (PIC16F84)


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Jul 2004
    Posts
    6

    Default PicBasic Question (PIC16F84)

    I'm new to PIC programming and was looking to create a project I found on the web. (http://www.rentron.com/PIC16F84.htm) I have all of the components needed and have a PICStart Plus programmer with Microchip MPLAB IDE.

    What I don't have is PicBasic, do I need to spend a lot of money purchasing PicBasic? or is there another way to compile my changes to the code?

    Many Thanks,

    Dan

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


    Did you find this post helpful? Yes | No

    Default

    Go here...

    http://microengineeringlabs.com/products/pbc.htm

    click on the big 'CompileSpot' Button

    This is good for simple programs only as it is limited and is intended as a "try before you buy". I can't tell you if that program on the Rentron site is too big or not - you may need to make some changes.

    If you intend to play (or be serious) with PICs, or want to move away from 'toytown' Basic Stamp into a 'grown-up' world, then buying one of MeLabs compiler products (especially PIC Basic Professional) is recommended.

    Melanie

  3. #3
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Dan,

    I took a look at your code on the URL...

    I used to use compile spot all the time. I now have PBP. 2.45. But I have no doubt that you can compile your project on compilespot... But you will have to do a couple of things in order for it to compile.

    1. Remove *all* comments.
    2. Change all the "If" statements to a case statement.
    for your 12 "If relay"
    3. Change your label ifs to if and else statements.


    Compilespot only allows 900 bytes of "basic" program... not Assembly.

    This means that you are limited to 400 characters. not words or variables or anything fancy. Shortening variable names from Relay1 to R1 saves you twice as much space. taking out all comments saves you tremendous space.


    To do this, you gotta think and act like someone as me<g>(and there are worse folks than I <g>)...Do you know how the grand canyon was formed??? Somebody rolled a penny down a mole hole... <g>

    Compilespot is excellent for learning and playing. I highly recommend it. I ended up purchasing the full version, but for 6 months I used Compilespot to get many different projects working.

    If you need help, just ask... I will see what I can do...

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  4. #4
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Dan,

    I took the program and "compressed it" so that it will compile on compilespot.com. Here is the code...
    do not add anything to it, and leave off the "End"
    do not add spaces, comments, or anything else.

    I am assuming the code I copied off that site runs.

    It is 899 bytes... compile spot allows 900..

    Dwayne



    INCLUDE "bs2defs.bas"
    r VAR b3
    s VAR b4
    se VAR PORTA.4
    TRISA=$10
    TRISB=$00
    l:
    SerIn se,N2400,[254],r,s
    Select Case r
    Case 1:
    IF s=1 Then
    High 0
    Else
    Low 0
    EndIF
    Case 2:
    IF s=1 Then
    High 1
    Else
    Low 1
    EndIF
    Case 3:
    IF s=1 Then
    High 2
    Else
    Low 2
    EndIF
    Case 4:
    IF s=1 Then
    High 3
    Else
    Low 3
    EndIF
    Case 5:
    IF s=1 Then
    High 4
    Else
    Low 4
    EndIF
    Case 6:
    IF s=1 Then
    High 5
    Else
    Low 5
    EndIF
    Case 7:
    IF s=1 Then
    High 6
    Else
    Low 6
    EndIF
    Case 8:
    IF s=1 Then
    High 7
    Else
    Low 7
    EndIF
    Case 9:
    IF s=1 Then
    PORTA.0=1
    Else
    PORTA.0=0
    EndIF
    Case 10:
    IF s=1 Then
    PORTA.1=1
    Else
    PORTA.1=0
    EndIF
    Case 11:
    IF s=1 Then
    PORTA.2=1
    Else
    PORTA.2=0
    EndIF
    Case 12:
    IF s=1 Then
    PORTA.3=1
    Else
    PORTA.3=0
    EndIF
    End Select
    GoTo l
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  5. #5
    Join Date
    Jul 2004
    Posts
    6


    Did you find this post helpful? Yes | No

    Thumbs up Thanks

    Thanks loads! your help has been very useful!

    Many Thanks,

    Dan

Similar Threads

  1. A question about PICBasic
    By ciroman in forum General
    Replies: 5
    Last Post: - 30th December 2009, 01:01
  2. New to PICBASIC Pro and have simple question
    By plyrathrt in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 22nd January 2008, 15:26
  3. Clock Question - New to PicBasic
    By cometboy in forum mel PIC BASIC
    Replies: 3
    Last Post: - 3rd November 2006, 00:39
  4. Question for all that use MELABS PICBASIC PRO
    By oskuro in forum Off Topic
    Replies: 2
    Last Post: - 24th March 2005, 17:15
  5. Basic Question about PICBASIC
    By zonkwilliams in forum General
    Replies: 1
    Last Post: - 10th March 2005, 21:55

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