|
SeaBass Language CompilerNew: Try our SeaBass online demo! Programming microcontrollers in assembly language is difficult. That's why most microcontrollers have C language support. While C is easier than assembly language, it is still tough to learn. That's why many microcontroller users like to use Basic. Unfortunately, Basic isn't always supported on every microcontroller, and even when it is, the Basic compilers are often not as efficient and capable as the system C compiler. So how do you choose between assembly, C, and Basic? With SeaBass, the new language translator from AWC, you don't have to! You can write Basic-like programs for nearly any microcontroller that supports C. What's more you can directly access existing C libraries, mix C code with your programs, and even embed assembly language if your C compiler supports it (and most of them do). With SeaBass you get the best of both worlds. Writing SeaBass code is efficient for you, and the C compiler will generate efficient code that executes on your microcontroller. SeaBass works with our PIC16F APP-II kit (in conjunction with the open source SDCC compiler) and with our Atmel ATMega APP-IV kit (using GNU C). However, SeaBass will work with nearly any C compiler on nearly any processor. For example, you can read how to use SeaBass with the Rabbit Semiconductor devices and Dynamic C. As an example, consider our APP-IV kit. This board uses an Atmel ATmega8 and works well with the free GNU C compiler. Here's part of a SeaBass program for this board: DIM j OUTPUT(B,0) OUTPUT(D,7) TOGGLE(D,7) FOR j= 1 to 25 TOGGLE(B,0) TOGGLE(D,7) NEXT This sets PORTB pin 0 and PORTD pin 7 to outputs and then flips the state of PORTD pin 7. Next a FOR loop causes the bits to flip back and forth repeatedly. It's easy to include C libraries in your programs or even call C functions: Dim i,q
for i= 1 to 10
q=adc_convert(1)
@printf("Value= %d\n",q);
next
Here, the code uses the C library adc_convert to read an analog value. It then uses the C-language printf call to write a string to the serial port. SeaBass can also handle the entire build process on supported platforms (and you can customize this support for other compilers). However, SeaBass always creates a C source file so advanced users can study its output or use platform debugging tools. How simple is it to use SeaBass? It's easy. You can use SeaBass as a command line program or in a windowed interface:
Press Compile, and you are done. On supported platforms, this will not only generate a C source file, but also invoke the C compiler to build an object file ready for programming. With the APP-IV, SeaBass will even download the program to the chip automatically! The LanguageSeaBass supports most common Basic keywords, plus a few special keywords. Remember, you can also call C and assembly routines, so functions supported by your C compiler are also available.
There are a few differences between SeaBass and traditional Basic that you should be aware of:
There is one exception to the last rule. Although C uses == and != as operators, SeaBas recognizes = and <> for these operations just as Basic does. Want to Know More?You can read the SeaBass manual online. In addition, check out this article about using SeaBass. If you use the Rabbit Semiconductor (Z-World) devices you might be interested in this article. You can even try out a demo of SeaBass online. If you'd like to get the latest set of examples to examine (or to refresh the copy on your CDROM) you can find them in sbexample.zip. Get it NowSeaBass is just $9.95 with the purchase of a complete APP-II or APP-IV kit (bare board kits are not eligible for this promotion). SeaBass requires Windows 98 or higher, a C compiler (open source compilers are included on our CDROM included with the APP-II and APP-IV), and target hardware with a programmer (for example, our APP-II or APP-IV).
|
![]()
[Kits] |
[Math] | [PS/2] |
[Pulse In] | [Pulse Out] |
[I/O] | [A/D] |
[PWM] | [Position Sensing] [PIC Programming] | [RS232]
| [PLD/FPGA] | [NetPorter]
[MicroTasks/Consulting] |
[Components] |
[Products] |
[News] | [Search] |
[Documents] | [Projects] |
[Resources] | [Updates] |
[FAQ] |
[Support]
[PDF Catalog]
Jump to PAKs: I, II,
III, IV, V,
VI, VII, VIII,
IX, X, XI,
XII PicoPAK:
VIII
Site contents © 1997-2008 by AWC, 310 Ivy Glen, League City, TX 77573 (281) 334-4341