The good folks at Parallax make the popular Basic Stamp^(TM) controller, which is well-suited for certain types of projects. We at Vesta Technology make the SBC2000 Single Tasking and Multi-tasking controllers, which we feel are better suited for the pricing and functionality requirements of original equipment manufacturer (OEM) developers. This comparison is intended to highlight some of the differences between the Basic Stamp^(TM) and Vesta's Single Tasking engines: the SBC2000-062, the SBC2000-074, and the MC2000-074 with its Dev-074 carrier board. Vesta's Multi-tasking boards, the SBC2000-188, SBC2000-332, and MC2000-332 with its Dev-332 carrier board, are not compared below because their power and price put them in a different class.
Programming Environment
The Basic Stamp and the SBC2000 each have their own proprietary version of Basic. Vesta Single Tasking Basic (VSTB) costs $99 (less, if you buy it as part of a development kit). The Parallax P-Basic that runs on the Basic Stamp is available for free from the Internet or in CD form when you buy a board. We feel our Vesta Basic language and its development environment have more of the features that experienced software engineers demand, and is well worth the money.
Vesta Technology also offers a Multi-tasking version of Vesta Basic for use with our SBC2000-188 and SBC2000-332, but it is not discussed below because it would be an inappropriate comparison. However, it is worth noting that the two versions of Vesta Basic are very similar and that porting Vesta Single Tasking Basic code to Vesta Multi-tasking Basic is fairly simple and straight forward. If the time ever comes that your product has outgrown VSTB, VMTB and the Vesta Multi-tasking boards will be a natural next step.
Speed
On average, Vesta Basic running on an SBC2000-074 runs equivalent operations approximately 3 to 5 times faster than P-Basic running on a Basic Stamp II. Individual operations in Vesta Basic execute anywhere from about 2.5 to over 5 times the speed of the equivalent P-Basic operation. Click here for details.
Capacity
P-Basic provides 26 bytes for variables on the Stamp II. The Stamp I provides 12 bytes of variable storage, 2 bytes of which are not available if you execute any GOSUB statements. The SBC2000-062 provides 30 bytes for global and static variables, and 54 bytes for stack space.
The SBC2000-074 and MC2000-074 provide 48 bytes for global and static variables, and 95 bytes for stack space. The stack space holds subroutine nesting information and local variables. If you need more room for global and static variables, the compiler will allow them to occupy part of the stack space (54 bytes on the SBC2000-062, 96 bytes on the SBC2000-074).
The Stamp I provides just 256 bytes of EEPROM for code space. P-Basic on the Stamp II is limited to 2K bytes for program code and data in EEPROM. Vesta boards are available now with up to 32k of EEPROM and Vesta Single tasking Basic will support up to 64k bytes of code and data space.
Variable types
Parallax P-Basic allows one-dimensional arrays. Vesta Basic allows both one- and two-dimensional arrays. Arrays can be automatically allocated by the compiler, or application code can specify absolute locations within the EEPROM at which they will be placed. Arrays of constant data can be declared that take up less memory than regular arrays.
Both languages support bit, byte, and word-sized integer variables, but Vesta Basic also supports 32-bit floating-point variables and arithmetic, including transcendental functions.
VSTB does Arithmetic the way you expect
P-Basic evaluates expressions left-to-right with no precedence other than parenthetical grouping. Vesta Basic provides proper precedence relations for arithmetic operators (multiplications are done before addition, etc. unless modified by parentheses).
P-Basic treats division as an unsigened operation, Whereas in Vesta Basic all arithmetic operation are treated as signed. Only printing with SDEC will specifically deal with negative numbers.
Real Procedures and Functions
P-Basic provides a GOSUB to label. Vesta Basic provides named subroutines as well as functions that return values and can be used directly in expressions. VSTB also allows local variables to be declared within subroutines and functions. P-Basic does not support any local variables at all. VSTB's support of stack-based local variables allows routines to be used recursively, and and reduces the interaction between the internal code in subroutines and the code in the main application.
VSTB provides more levels of subroutine calls
The Stamp I allows you to have 16 subroutines defined in an application. The Stamp II allows 256 subroutines defined in an application. Both boards limit you to nesting calls no more than 4 deep. The SBC2000-062 provides 54 bytes, and the SBC2000-074 provides 94 bytes of stack space for function calls, parameters, and local variables. Each subroutine call takes 4 bytes, not counting any parameters passed to or local variables declared in the subroutines. A function call takes 4 bytes plus the number of bytes in the return value. This means that subroutines can be nested up to 13 levels deep on the SBC2000-062 and up to 23 levels deep on the SBC2000-074 and MC2000-074.
Language Syntax and Capabilities
Parallax P-Basic provides structures such as GOTO, GOSUB ... RETURN, FOR ... NEXT, and IF THEN.
VSTB provides control structures such as DO WHILE ... LOOP, DO ... LOOP UNTIL, SELECT ... CASE ... ENDCASE, and IF ... [ELSE ...] ENDIF. VSTB also provides named subroutines with arguments, named functions with typed return values, and global, local, and static variables. Both languages support FOR ... NEXT loops.
Powerful Debug
In P-Basic "debug" means recompiling the program with DEBUG statements strategically placed through out your code, then executing the application while watching for those DEBUG messages to come up. This means that not only must you make a pretty good guess as to where the problem is, but you must also physically enter the DEBUG statement into your code and be sure to remove it later, without inadvertently breaking something else.
Vesta Basic allows you to see the value of specific variables change as you step through each and every line of code, one line at a time. That way, you can see every value of the variable without having to guess where the problem occurs. This also allows you to see the flow of control in your program. Remember: the reason bugs exist in the first place, is because something isn't working the way you expected, if you can see all of what's going on, instead of guessing what may be going on, you will be able to diagnose problems much faster.
The Vesta Basic debug monitor is enabled by compile switch that is set from the Integrated Development Environment (IDE) with the click of a check box. Vesta Basic even allows you to query the value of variable on-the-fly,as you are stepping through the code. It works like this: you use the Vesta Basic IDE to set up a window that shows the values of variables you're interested in. Then you click in a check box to turn the debug switch on. With a single click of an icon, the IDE automatically compiles, downloads and resets your program. Other buttons are provided that allow you to start, stop or single step execution, and each line of code is highlighted on the screen as it is executed. At any point, you can highlight a variable in the code and click an button that will add that variable to the list of "watched" variables.
Easy I/O
Aside from DEBUG, Parallax P-Basic doesn't provide a traditional PRINT statement; the programmer must write their own print function for each individual peripheral. Vesta Basic has built-in peripheral interfaces to devices such as a standard LCD, a 4x4 keypad or to a serial port. We also provide a PIPE function to make it easy to redirect output.
We're not kidding when we say Vesta Basic's pin control is so easy it'll make you giggle to use it. Well, maybe if you're a real grouch you'll just smile: GLOBAL pinA AS BIT = 5, 2 declares a variable called pinA that is the value of Port 5, Pin 2. You can read it, you can wright to it, and you don't have to set it's direction explicitly.
P-Basic provides the SEROUT statement, which can transmit text strings of up to 5 characters on the Stamp I, and can also print the contents of a byte variable as a character or a decimal number. It supports baud rates of 300-2400 baud on the Stamp I and up to 50k baud on the Stamp II.
Vesta Basic has a PRINT statement which can handle constant strings of up to 255 characters, printing the result of an expression as an integer (or a floating point on an SBC2000-074), or printing the low byte of an integer expression as a character. Output can be directed to a serial port (the SBC2000-074 has two) or to the LCD. Multiple strings and expressions can be used in a single PRINT statement. The serial port(s) default to 9600 baud but can be reprogrammed for other rates.
Events, Interrupts, Timers and Serial Ports
Parallax P-Basic does not provide an asynchronous control transfers; your program must monitor conditions explicitly in the main loop if you wish to respond to any change in these conditions. What you get is a linear execution environment, where program control is only transferred to another routine in response to explicitly-coded statements. In other words, if you want to execute a particular piece of code when something occurs, you have to watch for that something to happen and deliberately go to that code.
Vesta Basic supports event-driven programming, with two timers, serial ports, and four interrupt lines able to generate events which cause program control transfers. You can set your code up so that when the event occurs, you automatically go to the code you want to execute, and you don't have to explicitly watch for the event to occur. In other words, events are monitored in the background while your code does something else.
Background PWM capabilities (set and forget) are available with VSTB, and a periodic interrupt provides a built-in time-of-day clock. The PWM output on a Stamp is inactive when other statements are executing.
Vesta Basic maintains seconds, minutes, hours, and day-of-week information. Sub-second timing information is also available. The Stamp boards do not provide anything like this.
Vesta Basic Examples are Modular
Several examples of P-Basic code are provided by Parallax, but they are all separate applications. Because the more modern features of VSTB make it possible, Vesta's example code has been written so that it is easy to use individual subroutines and functions from one application in another application. Many of the files provided by Vesta are not even complete applications, but rather collections of routines which can be incorporated into your application simply by using INCLUDE "filename" in your application.
Hardware Design
The Vesta SBC2000 line of single-tasking embedded controllers, are larger than the Basic Stamp controllers, and provide some of the connectors, supporting electronics, and software to simplify control of common peripheral devices.
The SBC2000-062 provides standard power and LCD connectors, a touch keypad connector, serial connector that can be used for downloading applications from Vesta Basic on your PC, and a general 6-pin I/O connector that can be used for digital and/or analog (depending on the model) input and output.
The SBC2000-074 provides the same ports as the SBC2000-062, plus a second serial port, 9 pins for general digital and analog I/O, a TTL connector, and a connector for our Vesta Addressable Serial Transfer (VAST) port, which allows connection of multiple peripheral devices on a network using the SPI or IIC protocols (click here to see a list of Vesta Peripherals).
The Basic Stamp II provides 24 pins that are arranged in two rows without any port connectors. The Basic Stamp I provides 14 pins without connectors. The Basic Stamp Rev.D board has a breadboard area, and a place to snap-on a regular 9v battery but provides no connectors.
Carrier Boards
The Basic Stamp design lends itself to the use of carrier boards, and Parallax offers several, including the two described here. The Basic Stamp I Carrier provides a snap-on battery connector, a 3-pin serial connector to their P-Basic software running on a PC (like ours), and a breadboard area. The Basic Stamp II Carrier provides the battery connector, a D-sub type serial connector for download, and a large breadboard area.
The Vesta approach is a little different. Our customers tend to be experienced OEM engineers who are not interested in education so much as bringing new products to market. By providing certain common connectors as standard, we can integrate them properly into the language, and save our customers the trouble of reinventing them.
Another advantage of integrating the connectors is that we can optimize IO pin usage. Several IO lines are common to both the keypad interface and the LCD. On the SBC2000-074, these lines and others are also shared with the VAST connector. The VAST connector allows you to hook up a multitude of IO peripherals using a shared set of IO pins, and the software support in VSTB makes it easy to use our peripheral boards or your own.
If you don't need VAST expansion, keypad, or LCD in your application, the lines assigned to those purposes can be put to use as general digital inputs or outputs.
If you have a need for even smaller and lighter boards, or don't want to have cable connections to your peripherals, you might consider our MC2000-074. This is effectively an SBC2000-074 without the dedicated connectors. Instead, it has four single-row headers along the edges of the board. This makes it a less-expensive board, and allows it to be plugged into an application-specific platform board (ASB).
|