Is Picbasic good enough??


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Twasnow's Avatar
    Twasnow Guest


    Did you find this post helpful? Yes | No

    Default example

    Here is an example where you wouldn't want to use picbasic. at least I wouldn't.
    1) I am currently controlling DC 2 motors via an H-Bridge, each motor requires 3 outputs from the pic, Enable and two direction (both directions are needed for quick stop) I have to output two PWM's each are dynamic in pulse-width, depending on a speed selection for each motor, and an encoder feedback to ensure they go at the required speed, or to compare the two motors to ensure they rotate the same amount. The encoders are each pulsing up to an average of 2 KHz. The PWM pulses are output at a frequency of approx 4Khz. Every 200 pulses I recieve from the encoders (100 ms), I update the PWM. I get the commands (speed/direction for each motor) from another PIC via a 4bit bus that is also read every 100ms, I also output a status pulse when a task is complete.

    now maybe you could do this with basic, but I wasn't even going to try, I wrote this in ASM, but hey if I am wrong plesae correct me.

  2. #2
    toalan's Avatar
    toalan Guest


    Did you find this post helpful? Yes | No

    Default

    Okay here is an example that something that happened to me in Picbasic.

    For some reason Tmr2 was triggering an interrupt, even when disable the intterupt apparently some of the picbasic code was enabling it. I had no idea what part of the code was doing that, so I copied and pasted line by line into a new program and for some reason that stopped the tmr2 intterupt from being triggered.

    My point is that, I read the datasheet, but I do not know how exactly picbasic handles many of the registers.Honeslty previously i never read the datasheet and just plugged code into Picbasic, but now I read the datasheet I know exactly which registers I need to set, but sometimes Picbasic just overwrites my settings. I guess I could dump the Compiled program into ASM, but debuggin ASM based on someone else's interpretation on how to do things in ASM is just too much of a headache.

    Neccessity is the mother of all invention, I guess Picbasic in some of its shortcoming has forced me to learn much more about the MCU than I wanted to, which is a good thing in the long run but a pain in the short run.

    The PicBasic guys need to beef up their manual to show more advanced users what it is doing in ASM.

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


    Did you find this post helpful? Yes | No

    Default

    Hummm.

    PBP has been ok for me. It is powerful, yet somewhat easy to use. I am a professional programmer, using C/C++ with Borland Compilers. About the only complaint I have with PBP, is syntax of the functions. But I also realize that this is a difference between the compilers too!
    I prefer the following:

    for(c=0;c<10;c++)
    {
    if(c==5) then printf("Number is equal to %2d", C);
    }

    Opposed to something like this:
    For c=0 to 10
    if(c=5) then print("Number is equal to ",c);
    next c

    Then the added "endif" and "wend". when a finishing bracket in C takes care of it all.

    I have also noticed that some statements will show errors if they are on the same line. But if you put the exact statement on a second line..presto!

    in reality, it is not a "limitation" of PBP, but more of a Syntax difference. A difference that is harder for me to get used to, after programming 25 years in another language. Thus, it is not a fault of PBP, but a fault of the user (meaning me).

    I will say that pbp has done a wonderful job, and i clap my hands to the programmer.

    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...

Similar Threads

  1. Need help deciding = BASCOM 0r PICBASIC
    By Chris DeHut in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 26th January 2006, 16:38
  2. Picbasic VS C Compiler
    By koossa in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 11th October 2005, 21:44
  3. Replies: 22
    Last Post: - 12th July 2005, 17:39
  4. PicBasic Fundamentals
    By Billyc in forum General
    Replies: 9
    Last Post: - 4th May 2004, 10:04
  5. PicBasic Pro & PicBasic syntax different
    By Billyc in forum General
    Replies: 5
    Last Post: - 16th April 2004, 21:19

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