PropBASIC

Hi,
I just finished several projects that use BS2 and Propeller micro controllers. I enjoy writing programs in BASIC so I focused on coming up to speed on PropBASIC 0.1.14.

I downloaded Propelleride with PropBASIC and installed the ide correctly on my laptop with Windows 10 operating system. I also downloaded the PropBASIC 0.1.14 instructions manual. The Propeller Activity Board is connect to the USB port com3.

On page 2 of the manual is a very simple program that should blink an LED on pin 16. The program is as follows:

DEVICE P8X32A

LED PIN 16 OUTPUT

PROGRAM Start

Start:
TOGGLE LED
PAUSE 1000
GOTO Start

After performing a BUILD on the code...the compiler gave errors on each line of code... "expected end-of-line or "["". At the top of the window in bold face the result of the compile was SUCCESSFUL...which it was not since the program was not running.

The description of each line of code is so simple...it is hard to imagine what is wrong.

What is wrong so that I can begin writing PropBASIC programs for my next set of projects? I could use your help.

I was able to save the source code as .pbas but I was not able to locate an option to set propellerride to use propbasic. How is that option selected?

The code compiles but I do not see pin 16 flashing on and off at a 1 second period.

I wanted to send some printed information to the computer screen for debugging but I don't see anyway to do that based on the instructions provided in the PropBASIC manual. In BS2 code there was a DEBUG command.

Are you running PropellerIDE Ver 0.38.5 which has the PropBASIC built in? Are your FTDI drivers current?

I just downloaded PropellerIDE 0.38.5, pasted the blink program into the editor, Save As blink.pbas, clicked on the green RUN arrow and the program compiled and loaded. It is sitting in front of me blinking at 1 second intervals. Changed the Pause line to 500, hit run and now the LED blinks twice as fast.

The PropBASIC Manual under Help indicates the PropBASIC version is 0.01.43.

Installed, pasted in your code snippet (with LED changed to pin 26) and saved as Test.pbas
Connected a Propeller FLiP to the USB port and pressed Run. LED blinks as expected.

So that confirms your code works. I won't have access to an Activity Board until the morning, but in the meantime, is it sure you have the power switch on to at least position 1 ?

And did you notice if the WX LED near the USB socket is lit? Maybe try adding a jumper wire from the SEL socket to GND or 3.3V (one of those will select WX, and the other will switch it off). You want it turned off for USB programming. You'll find that SEL socket to the right of the metal crystal can.

If you don't have the WX LED, then maybe you have an older Activity Board that requires power at the DC Jack. You could try that anyway. Your ERROR: Download timed out message would suggest a communications issue with the Activity Board, and that is most likely an FTDI driver issue, USB cable bad connection, or lack of power at the Activity Board.

I'll check in tomorrow in case this doesn't get you going. Best of luck.

Installed, pasted in your code snippet (with LED changed to pin 26) and saved as Test.pbas
Connected a Propeller FLiP to the USB port and pressed Run. LED blinks as expected.

So that confirms your code works. I won't have access to an Activity Board until the morning, but in the meantime, is it sure you have the power switch on to at least position 1 ?

And did you notice if the WX LED near the USB socket is lit? Maybe try adding a jumper wire from the SEL socket to GND or 3.3V (one of those will select WX, and the other will switch it off). You want it turned off for USB programming. You'll find that SEL socket to the right of the metal crystal can.

If you don't have the WX LED, then maybe you have an older Activity Board that requires power at the DC Jack. You could try that anyway. Your ERROR: Download timed out message would suggest a communications issue with the Activity Board, and that is most likely an FTDI driver issue, USB cable bad connection, or lack of power at the Activity Board.

I'll check in tomorrow in case this doesn't get you going. Best of luck.

Do you have a general example of how it could be used for displaying alpha numerical data from the program to the computer screen?

Sincerely,

Discovery

I haven't used PropBASIC in a long time, so this code may need adjusting for the latest version of the compiler. Attached is a library that does formatted serial output (it's basically a translation of the transmit routines from FullDuplexSerial). Some of this is a little advanced because I know how to exploit the architecture of PropBASIC (while at Parallax I worked with Bean on SX/B) and I'm comfortable with PASM.

I would not say it is dead. It has worked well for a few years, but don't look for any upgrades soon. It's like Basic Stamp and SX/B , they where written, published and can be used in the current state.

For me, Spin wins. I live, breathe, and think in Spin; all of my Propeller consulting is done in Spin. That said, there are others who do amazing things in PropBASIC, C, Forth, and now Blockly. That's the great thing about the Propeller: you get multiple cores and the language of your choice to solve problems.

As it turns out, the write-ups and discussions that I read regarding the PropBASIC language answered my needs for a language that would be written in BASIC, a language that I prefer for my applications, store the main program in EEPROM so that the code would execute immediately after power-up, execute applications in COGs for mathematics, and perform signal processing.

I must utilize parts of other's programs to learn how to place code in the EEPROM and how to get data into and out of COGs. Since few people recall much about PropBASIC, that fact will make my effort very hard.

On the other hand, there are other languages that are available to run on the Propeller and that is a good thing for people like Jon who work at the nuts and bolts of code.

I am wondering if there is a store house of existing PropBASIC software programs that are available for me to utilize as I push ahead in implementing BASIC-on-a-Propeller.

PropBasic is very cool...I use it exclusively for the Prop. Spin is also cool but slooooow compared to PropBasic. I still don't understand why people would want to have the Prop jumping through so many hoops, consuming more clock cycles and power than is necessary.

I am also a fan of Viewport (no-longer supported), which is also compatible with PropBasic. With Viewport, you can simply "watch" a variable and it will show up on the terminal screen.

Discovery,
Sorry I didn't see this thread sooner, but it looks like you have solved the initial problem.
I am the developer of PropBasic and I use it everyday.
If you have any further questions feel free to ask on the forums and I will help as much as I can.

There has been some fixes to PropBasic and I'll have to post a new version since it looks like at least some people as still using it.

I still don't understand why people would want to have the Prop jumping through so many hoops, consuming more clock cycles and power than is necessary.

My commercial projects tend to get big (recent project was 6000+ lines of compiled code) -- Spin, while slower I admit, has great code density.

Still... back in the days of SX/B I created a lot of small commercial products for EFX-TEK using it; then we switched everything to the Propeller. Our most popular controller is the HC-8+; perhaps I should create a PropBASIC template for it (I have several Spin templates that our customers use).

It's a lot to ask, I know, but I wish PropBASIC had it's own, dedicated edit/compile tool.

@Bean: Have you ever looked at the Xojo compiler? It's x-platform and may have all the right tools to create a nice, stand-along PropBASIC IDE/compiler.

@Bean: Have you ever done white-paper on translating a Spin+PASM object to PropBASIC. I have several library files from many years ago, but things may have changed in recent years -- I'm not sure if any of them will still work.

Others: Is anyone using their favorite editor and CLI to compile/load programs?

My observations-
I ONLY use PropBasic to program the prop.
I use Geany as an ide- works great- theres instructions somewhere on how to make it work. Theres no colour coding for the text- not a problem for me.
I have dozens of little proggies for all sorts of modules.
I've had hundreds of hours of fun thanks to PropBasic.
I find the error reporting can be confusing- but close examination of the code usually shows the problem- eventually- though it can be frustrating.
You HAVE to break statements that have multiple 'actions' into separate actions i.e.-
x=z+y-3 becomes
x=z+y
x=x-3

Probasic is sufficiently different to say qbasic or freebasic (which I also use a lot) to have to 'get used' to it. In this regard I start a new project by re-naming an old project and then commenting out all the code except for the boiler plate stuff like-

DEVICE P8X32A, XTAL1, PLL16X
FREQ 80_000_000

etc.

and then using that as a syntax reference and reminder how to do things.
When you get a program running take a look at the created spin file - there you will see just how it encoded into assembler- I'ver learned enough assembler from that to tweak it for special cases.

Vga output is as easy as adding LOAD "VGA.lib" under boiler plate and using the provided functions. (and of course adding vga connector and d/a resistors- plenty of info on that.)

AND although you are limited normally as to how big a program will fit into a cog (as its all assembler) there is an LMM mode which is great for the large but less time critical stuff.

I love it to pieces and would be happy to pay for it.

When the prop2 comes out, I will definately get a P2 module, BUT, if there is no PropBasic for it, it may not get used too much.

I don't publish my code for fear of embarrassment and mockery from the language wars pseudo intellectuals.

Hi
I don't publish my code for fear of embarrassment and mockery from the language wars pseudo intellectuals.

Dave

I wish you would. When learning a new programming language, I find it very useful to read other folks programs and figure out what they are doing and how they do it. For example I have found Jon's programs very useful for seeing advanced methods of Spin programming, many of which I would never have thought of.