Proton PICBASIC vs MeLabs PICBASIC


Closed Thread
Results 1 to 23 of 23
  1. #1
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187

    Thumbs up Proton PICBASIC vs MeLabs PICBASIC

    Proton PICBASIC vs MeLabs PICBASIC what´s the diffrent`s?

    Great forum btw.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Fredrick View Post
    Proton PICBASIC vs MeLabs PICBASIC what´s the diffrent`s?

    Great forum btw.
    Person 1 - PicBasicPro is the BEST!

    Person 2 - No...Proton Rocks!

    Person 1 - No...PicBasicPro is best!

    and so on and so on...

    Person 3 - Person's 1 and 2 are both wrong!!!

    Get the datasheets/instruction manuals for both of them. Read them. Figure out what you want to accomplish. You might end up going with free assembly, or maybe even C, or something else entirely.
    Personally, I've only used PicBasicPro. I like it and like it a lot.
    I'm sure there's nothing wrong with Proton Basic, and if I'd have bought Proton instead of PicBasicPro, the argument would be the other way around in reverse upside down.

  3. #3
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default

    Ok thanx.
    It´s like PC or MAC then...

    So both Proton and MeLabs PICBASIC can do the same job! ?

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    yup, both WILL do the same job, the power is back to the keyboard, not in your hard drive...

    There's a lot of thread about that here, do a little search within the forum.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    I too have never used Proton before.

    And all I can say is that there was a group of people here that used to be pretty good with PBP, who suddenly switched to Proton.
    You'll now find those same people over at the Swordfish forum.

    I would not recommend Swordfish for beginning programmers.

    But if you're proficient in a language like Delphi (pascal), Javascript, or other "Highly Structured" languages, you might find Swordfish easier to work with.

    _
    DT

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Down side... for 18F only
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default 18f

    Oh yeah, forgot about that.

    Been back to PBP long enough not to remember.
    Yes, I thought I had switched to Swordfish at one point.

    But really, I've never come across anything I couldn't do with PBP.
    Well, with a little ASM added

    _
    DT

  8. #8
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    and...
    {.mod ...}
    '
    '
    {.endmod}



    As i said, the power is back to the keyboard.

    I agree, PROTON may have better function set built-in. Where's the fun?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  9. #9
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    I own both, and for the most part, I agree with the above comments. There are some significant differences worth noting.

    PicBasic Pro (PBP) was designed to be a PIC alternative to Basic Stamp 2's. It's very good at that, and its code runs much faster than stamps. It is very easy for beginners to transition to PIC's from Stamps. I've made some good code with it. You pay for version updates.

    Proton+ Development Suite (PDS) was designed to be a good PIC compiler, with many commands being Stamp compatible. (They've also added some similar commands that are optimized for your specific use, instead of a "catch-all" command.) PDS has a broader command range, and compiles code much smaller and runs faster than PBP. (My PBP code converted to PDS was about 20% smaller!) The current Beta version, which is available to all licensed users, has many new powerful features, like automatic variable saving for interrupts. (This makes a few of Daryl's add-in code obsolete.) There are three levels of optimization for even more compact code, that can save up to another 15%. For 18F's, both high level and low level interrupts are supported. Plus, you get a development board simulator to test your code in. PDS has a macro capability to make your own commands, and call them with parameters, just like any other basic command. I'm one of those who "switched", and most of what I do is now PDS.

    Both forums have excellent support.

    And yes, Swordfish looks neat, but it's only 18F's. I'm sure that will change, eventually, but probably towards more advanced PIC's. It's "structured", but that really only has a benefit if you are writing huge code (which 16F's and smaller can't handle). In reality, you can write structured code in PBP or PDS, too; it just looks slightly different.

  10. #10
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    For those who don't know, Swordfish was written by the same guy who wrote MicroCode Studio (PBP IDE) and also the IDE for Proton.

  11. #11
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    mikroBasic for PIC is another procedural basic. It's very advanced in some areas (e.g. handling interrupts), less so in others. It has a ton of libraries although they tend to be 18F oriented. It's worth investigating if you're trying to decide on a PIC development language. It costs less than PBP and you don't need a license for apps that are smaller than 2K.

  12. #12
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126


    Did you find this post helpful? Yes | No

    Default

    I have a copy of MikroBasic, but find it frustrating that it does not have equivalents to SerIn2 command with time-outs if there is no data. So for any serial you need to write an interrupt routine otherwise the serial receive is a blocking command...

    But on the other hand it does support GLCD, Ethernet parts and CF or SD Cards out of the box.

    bill

  13. #13
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by bcd View Post
    I have a copy of MikroBasic, but find it frustrating that it does
    not have equivalents to SerIn2 command with time-outs if there is no data. So for
    any serial you need to write an interrupt routine otherwise the serial receive is
    a blocking command...
    Hi Bill,

    I have never used the MikroBasic compiler but after a quick
    look at the PDF manual I have a solution for your software UART
    timeout problem.

    Best regards,

    Luciano


    From page 257 of MikroBasic for Pic.
    (This is the original sample code).
    Code:
    ' Here's a loop which holds until data is received:
    
    error = 1
    
    do
      data = Soft_Uart_Read(error)
    loop until error = 0
    Here is a version with timeout using BREAK to exit the Do loop:
    Code:
    ' Here's a loop which holds until data is received
    ' or the timeout value has reached 10000. 
    
    Dim MyTimeOutCounter as longint
    Dim MyError as byte
    Dim MyData as byte
    ....
    ....
    
    MyError = 1
    MyTimeOutCounter = 0
    
    Do
    
      MyData = Soft_Uart_Read(MyError)
      
      MyTimeOutCounter = MyTimeOutCounter + 1 ' increment our timeout counter
      
      If MyTimeOutCounter = 10000 Then ' you will have to adjust this value
         Break  'Exit the Do Loop
      End if
    
    Loop until MyError = 0
    
    If MyError = 0 Then ' Optional IF 
      ' Serial transfer was successful
    Else
      ' Timeout occured
    Endif
    Last edited by Luciano; - 9th January 2008 at 11:58.

  14. #14
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by bcd View Post
    I have a copy of MikroBasic, but find it frustrating that it does not have equivalents to SerIn2 command with time-outs if there is no data. So for any serial you need to write an interrupt routine otherwise the serial receive is a blocking command...
    But writing an interrupt routine is a piece of cake and examples are easy to find - I think they are even included.

  15. #15
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    I don't use Mikrobasic, but here is an easy way to do it without interrupts...just translate the code to proper syntax. (And set the symbols of cTxReg etc. to the appropriate values. Leading characters are: c=constant, b=byte.)

    bDelayTime = 0
    CheckForData:
    if cTxReg = cDataWaiting then 'check hardware Tx register for incoming data.
    serin = bSerialDataIn 'get data...
    goto SerialDataReceived
    else 'no data waiting...
    pause 1 'wait 1ms...change to match your baud rate, since some speed may overwrite
    bDelayTime = bDelayTime + 1
    if bDelayTime = cMaxWaitTime then
    goto NoSerialDataReceived
    endif
    goto CheckForData
    endif

  16. #16
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    For those wanting to do it with interrupts, do a quick search for "buffer" on the Proton forum. ( http://www.picbasic.org/forum/ ) Les, the PDS author, wrote a subroutine for 18F's to buffer all incoming serial data. It should be possible (given enough ingenuity) to convert it to PBP or Mikrobasic.

  17. #17
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tenaja View Post
    I don't use Mikrobasic, but here is an easy way to do it without interrupts...just translate the code to proper syntax. (And set the symbols of cTxReg etc. to the appropriate values. Leading characters are: c=constant, b=byte.)

    bDelayTime = 0
    CheckForData:
    if cTxReg = cDataWaiting then 'check hardware Tx register for incoming data.
    serin = bSerialDataIn 'get data...
    goto SerialDataReceived
    else 'no data waiting...
    pause 1 'wait 1ms...change to match your baud rate, since some speed may overwrite
    bDelayTime = bDelayTime + 1
    if bDelayTime = cMaxWaitTime then
    goto NoSerialDataReceived
    endif
    goto CheckForData
    endif
    Hi,

    Your code does not work with software UARTs.

    Software UART routines use bit-banging techniques and can use almost any I/O pin
    of the microcontroller. Software UARTs have big limitations and if the microcontroller has
    hardware UARTs just use them!

    Best regards,

    Luciano

  18. #18
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Luciano View Post
    Your code does not work with software UARTs.
    This is absolutely true.

  19. #19
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    For those wanting to do it with interrupts, download the Soft Uart for P12 by Warren Schroeder project from http://www.mikroe.com/en/projects/

    It's an excellent tutorial as well as an interrupt driven full-duplex software UART. The code is quite simple and easy to follow.

  20. #20
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    One nice thing about Proton+ is in the forum, Les the compiler author occasionally posts misc. PDS code. (In addition to helping out on the forum when needed.) For instance, he's posted a full Space Invaders game that works with the Crownhill development board... which is modeled in the VSM simulator so you can play it right on your PC screen (or the actual development board).

    He's also posted code to use as a serial buffer for the hardware usart, so it will receive data in the background, and fill it in when you get around to using a hserin command. More examples are speech decompression routines, and a full .wav file player design with CF FAT and audio out routines.

    These are just a few examples. Some of them can easily be ported to PBP; others may take some work.

  21. #21
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dhouston View Post
    For those wanting to do it with interrupts, download the Soft Uart for P12 by Warren Schroeder project from http://www.mikroe.com/en/projects/

    It's an excellent tutorial as well as an interrupt driven full-duplex software UART. The code is quite simple and easy to follow.
    Hi,

    Full-duplex software UART is not possible or possible only if the baud rate
    is very low and interrupts are used. (Software UARTs use bit-banging).

    Soft Uart for P12 by Warren Schroeder:

    If you look at the code you will see that RX uses an interrupt and that in
    the SUB TX_19200 interrupts are disabled. This means that while
    you are sending data you cannot receive data at the same time. (Not Full-duplex).

    Best regards,

    Luciano
    Last edited by Luciano; - 9th January 2008 at 19:31.

  22. #22
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Luciano View Post
    Full-duplex software UART is not possible or possible only if the baud rate is very low and interrupts are used. (Software UARTs use bit-banging).
    It could be done if you send and receive in the interrupt. Set it to interrupt at 2*baud, and alternate Tx/Rx. At 9600 baud, with 19200kHz interrupt rate on a 20MHz crystal, you get 260 code cycles to perform each...that should be more than enough, and cycles left over for other regular code. You might even get close to that rate with a 4MHz crystal if you are thrifty with your code.

    Or, in the interrupt do the Tx send first, then all Rx work, then Tx setup for the next bit, without alternating, so the "Tx send" portion is actually very short and always the same length. This might be more efficient, but maybe a little more coding.

  23. #23
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126


    Did you find this post helpful? Yes | No

    Default MikroE Basic

    Luciano -

    I will try that code. The last time I tried the Soft_Uart_Read was blocking. I see v6.0.0.0 has a heap of changes.

    I just found it frustrating when trying to convert a simple working PBP program to MikroE Basic. What better way to learn a new language than to convert code you already know and understand in PBP.

    I'll stick with PBP for now until I need ethernet or have some time to do some test projects.....

    bill.

Similar Threads

  1. PICBasic Pro vs. Proton Dev System
    By hjsong in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th February 2007, 05:17
  2. PICBasic Pro vs Proton PICBasic
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd November 2006, 17:11
  3. help me Proton PICBASIC version compl
    By samirouf in forum mel PIC BASIC
    Replies: 2
    Last Post: - 1st May 2005, 20:25
  4. Question for all that use MELABS PICBASIC PRO
    By oskuro in forum Off Topic
    Replies: 2
    Last Post: - 24th March 2005, 18:15
  5. Proton development board with Picbasic
    By pjsmith in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 25th July 2004, 23:19

Members who have read this thread : 2

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