Shop OBEX P1 Docs P2 Docs Learn Events
PBasic and BASIC, differences? — Parallax Forums

PBasic and BASIC, differences?

MimewarMimewar Posts: 10
edited 2010-08-17 13:01 in BASIC Stamp
I am familiar with Parallax BASIC, but I want to program proper uCs so, BASIC is the logical next step. What are the differences between Parallax BASIC, and BASIC? Will the Stamp homework board accept BASIC, instead of PBASIC? I don't want to have to learn C, or assembly. I'd rather branch out into BASIC proper, and start building.

Thanks
Shane

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-08-10 21:17
    If you plan to work with "proper uProcessors" you should learn c. There is picBasic for the pic processor from http://melabs.com/.
  • bill190bill190 Posts: 769
    edited 2010-08-10 22:11
    Every "Basic" I have ever programmed in has been quite different actually!

    And that is because the hardware or device I was using had certain unique things and they designed their Basic for those things.

    And the same goes for the C programming language. I programmed in C for old DOS computers and nothing I did for that would work on a microcontroller these days. And C on a UNIX computer looks quite different from C elsewhere.

    And now they have Microsoft Visual Basic and that does not look anything like the Basic I learned on!

    I would suggest finding the microcontroller you want to learn about or need for a project, then see what programming languages are available, then pick what you are most familiar with or would like to learn. But there will probably be many differences from where that same programming language is used elsewhere...
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-08-11 12:23
    The difference between PBASIC and Dartmouth BASIC is that PBASIC is written for "microcontrollers" and is BASIC Stamp specific while Dartmouth BASIC is tailored to specific microcomputers.

    http://en.wikipedia.org/wiki/Dartmouth_BASIC

    PBASIC Programming
    http://www.google.com/url?sa=t&source=web&cd=4&ved=0CB8QFjAD&url=http%3A%2F%2Fa.parsons.edu%2F~traviss%2Fcc%2Flab%2Fpropeller%2FPBASICProg.pdf&ei=v_diTO7tF4bkuAP3lomeCg&usg=AFQjCNGtiLs1aNoO-dGapyjmfpUy_Wg88A

    PBASIC Language Basics
    http://www.google.com/url?sa=t&source=web&cd=3&ved=0CBsQFjAC&url=http%3A%2F%2Fpeabody.sapp.org%2Fclass%2Fdmp2%2Fread%2FPbasic.pdf&ei=v_diTO7tF4bkuAP3lomeCg&usg=AFQjCNHxvi9A0PvIkGopOqTZC-ZkbJ3tNw

    You can practice BASIC with PBASIC and a Stamp or some other version of BASIC on a PC. You may also use a version of BASIC on the Propeller chip. Mike's FemtoBASIC is a great place to start.

    Humanoido
  • MimewarMimewar Posts: 10
    edited 2010-08-11 19:24
    OK, so let's assume I have a handle on where to go as far as languages. Will this function the same as a stamp, as far as I/O pins?
    http://www.parallax.com/Store/Microcontrollers/AllMicrocontrollers/tabid/758/CategoryID/1/List/0/SortField/0/catpageindex/2/Level/a/ProductID/12/Default.aspx

    I would need to add a crystal, volt regulator, and eeprom, but this is the same thing correct? Why can't any old PIC be programmed in PBASIC, or BASIC?

    Seems to me, if I want to be lazy about it, I get a few PIC16F57s, crystals and eeproms, and program in PBasic for the mean time.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-11 20:23
    The link you supplied is for the pre-programmed PIC16F57 that is the same as the one on the Stamp module. To make it work, you need a resonator or crystal and an EEPROM at a minimum. The Stamp module includes a voltage regulator, a voltage detector (to generate a reset pulse), and some discrete resistors and transistors that provide the RS232 programming interface. If you have a good regulated 5V supply and a good reset signal, you could do without the separate 5V supply and reset circuitry.

    The PBasic interpreter is proprietary to Parallax. There's no way for you to program your own PIC16F57s with the PBasic interpreter. You have to buy the pre-programmed devices from them.

    FYI, the EEPROM is a specific size (2K bytes or 16K bits). You can't use just any size EEPROM.
  • bill190bill190 Posts: 769
    edited 2010-08-11 21:45
    Mimewar wrote: »
    Why can't any old PIC be programmed in PBASIC, or BASIC?

    Pic chips (made by Microchip) have what is called Harvard architecture. That means the "program memory" or rom is on a different bus than "data memory" or ram.

    Because of this, there are unique variable terms used like rom and ram, and functions which move data around or access memory have two sets! One for rom and one for ram.

    I'm not familiar with Basic for Pic, but with C, a common "function" is strcpy, which is used to copy a string. But Pic C also has strcpypgm2ram, strcpyram2pgm, and strcpypgm2pgm!

    Then Pics are different "sizes", let's say small, medium, and large. You might need one compiler for the small, another compiler for the medium, and yet another compiler for the large.

    That would be nice if one language worked for everything! But over the years I have had to learn this language to do one thing, another language to do another thing, and yet another language to do something else.

    Luckily once you learn one language, it is easier to learn another. And Parallax makes it as trouble free as possible (Basic Stamp and Propeller). Very good documentation and an excellent forum here.
  • ChupacabraChupacabra Posts: 3
    edited 2010-08-17 13:01
    Shane,

    As other members have stated, the bottom line is you cannot program a raw PIC micro with PBASIC. It's just not going to happen. As for C language programming of PIC's, your other two threads on this topic had some perfectly good suggestions (links to both posts below, please see my suggestion in the first link).


    http://forums.parallax.com/showthread.php?t=124284

    http://forums.parallax.com/showthread.php?t=124679


    Thanks,
    James
Sign In or Register to comment.