Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 6th May 2007, 12:56 PM   (permalink)
3v0
Moderator
 
Blog Entries: 3
3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold
Lightbulb It is BASIC or is it BABL

Various modern Basic languages have more in common with other languages then the original langauge Basic. For me it stopped being basic when they lost the line numbers.

A bit of what Wikipedia calls structured code in the original/early BASIC:
Code:
10 INPUT "What is your name: "; U$
20 PRINT "Hello "; U$
30 REM
40 INPUT "How many stars do you want: "; N
50 S$ = ""
60 FOR I = 1 TO N
70 S$ = S$ + "*"
80 NEXT I
90 PRINT S$
100 REM
110 INPUT "Do you want more stars? "; A$
120 IF LEN(A$) = 0 THEN GOTO 110
130 A$ = LEFT$(A$, 1)
140 IF (A$ = "Y") OR (A$ = "y") THEN GOTO 40
150 PRINT "Goodbye ";
160 FOR I = 1 TO 200
170 PRINT U$; " ";
180 NEXT I
190 PRINT
You can convert the modern BASIC to C or Pascal (languages from the early days but post original BASIC) much more easily then then true/original BASIC.

None of this makes the language any less useful. It just bugs me that they keep using that tired old name.

Maybe it should be called BABL:
Basic with Additions from Better Languages.

The name BASIC is used to attract people who think the language will be easier to use because they see the name BASIC and think simple. Thats marketing.
__________________
search engine for electronic parts
Junebug USB PIC programmer kit. USB Bit Wacker

Last edited by 3v0; 6th May 2007 at 12:59 PM.
3v0 is online now   Reply With Quote
Old 6th May 2007, 02:41 PM   (permalink)
Experienced Member
HarveyH42 is a name known to allHarveyH42 is a name known to allHarveyH42 is a name known to allHarveyH42 is a name known to allHarveyH42 is a name known to allHarveyH42 is a name known to all
Default

I learned programming in BASIC back in the 70's, and it was the easiest to learn compared to the other languages at the time (COBOL, FORTRAN, PASCAL, or Assembly). when I eventually was forced to move up to a IBM PC, compiled BASIC lost the line numbers, and I pretty much lost interest in programming. I was doing Assembly on a 6502, but the 286 was much different and the compilers used labels instead of memory locations.

Last fall I took the plunge into microcontrollers. I knew from the beginning that Assembly would be the best choice of language considering the limited memory. I do look at other languages for examples, but its tough to get the details I'm looking for, usually locked into library files. A HEX file dissasembler would be cool as hell.

I've been moving into more complex projects, where timing and feature setup is critical, and a higher level language would handle these much better. The BASIC compiler makes about as much sense to me as C, doubt much that I knew about BASIC will be of much use, its seems completely different.
HarveyH42 is online now   Reply With Quote
Old 6th May 2007, 05:21 PM   (permalink)
Experienced Member
gregmcc is on a distinguished road
Default

wow - that brings back memories Used to do a ton of basic programming for the PC then went onto C++ and stopped when it all went windows based - OOP
gregmcc is offline   Reply With Quote
Old 6th May 2007, 07:40 PM   (permalink)
Experienced Member
 
mramos1 is a jewel in the roughmramos1 is a jewel in the rough
Default

Every OS I have used with BASIC, the first thing I would do is port a program I wrote a LONG time ago called prebas.

I would write my code with no line numbers and used labels, prebas would then convert it and add the numbers. It was a simple program.

But I have never like the numbers. Even DEC VAX Basic had them..

But it does bring back memories.
mramos1 is offline   Reply With Quote
Old 6th May 2007, 08:05 PM   (permalink)
Experienced Member
Tim_B is on a distinguished road
Default

I can remember writing basic with line no's on my Spectrum then my Enterprise 128, Looking back I can say that it was very poor method, The language is fine but structuring your program was really hard. From what I remember about the late 70's ANSI specified a Basic with out line no's, so line no's is very old hat and cannot be compared with modern variants.

I would call my self a competent Pic Basic programmer and pretty capable of writing in Pic Asm. I have seen a few comments against Basic saying ASM is better, this misconception is made by people who have never written in basic or were unfortunate enough to have used a duff version of the pic basic.

I know 2 pic compiler writers and I can say that there exception asm programmers, so by using one of there basics you get the best of both worlds. The ease and readability of basic and the excellent code produced.

For a Pic beginner there are 3 things they have to contend with
1 Actually learning to program and think with a programmers head
2 Lean a programming language
3 Lean about pic's

Now if you have non of those 3 then BASIC is the obvious choice.
Its very easy to read
It's very forgiving of a bad programming style
It takes care of all the pic stuff for you.

For example

The classic Flashing led

device 16f84
dim led as portb
loop:
toggle led
delayms 500
goto loop

If you decided to write it in asm you would have to write a delay routine before you could even think about making it flash then find out how to do toggling in asm then include the appropriate Pic file.

I would always though recommend that people once they get going at least understand how a pic works under the skin.

I like to think I think asm and program basic
Tim_B is offline   Reply With Quote
Old 7th May 2007, 12:31 AM   (permalink)
Experienced Member
 
mramos1 is a jewel in the roughmramos1 is a jewel in the rough
Default

Pic BASICs (or any basic) are good IMHO. But, for the pic, there are limits of the lite free ones (Mikroe.com is the better of lite/free ones). But anyway, some have bloat, some are a poor version of BASIC (like the old line numbered BASIC that did not have if_then else endif). You can get the job done, but structured BASIC is nice.

But I can write the code in BASIC or ASM.

If it is a simple, small, get it out fast project. For sure look at BASIC (note I said simple).

If it is a timing (software timing) critical project you have to research and pick the right way to go. Many people use Pic BASIC pro and ASM. Many use MikroBASIC and ASM..

But I do agree, if you have not learned and used (a good) Pic BASIC you will not like BASIC and it is not really fair to knock what you do not know.
mramos1 is offline   Reply With Quote
Old 7th May 2007, 01:34 AM   (permalink)
Experienced Member
Mike, K8LH is a name known to allMike, K8LH is a name known to allMike, K8LH is a name known to allMike, K8LH is a name known to allMike, K8LH is a name known to allMike, K8LH is a name known to all
Default

Anyone who generalizes about one language being better than another is pretty much a moron. They all have their advantages and disadvantages. However I appreciate those Forum members with valid cohesive and coherent reasons for preferring one language over another.

For those PIC hobbyists like me with an almost non-existent budget it seems we're pretty much limited to Assembler or C18. I'd love to add a recent BASIC language offering to my 'toolbox' but I simply don't have the funds to purchase a BASIC language.

I envy those hobbyists that do have the funds and I would happily steer them toward a BASIC language called Swordfish which at first glance seems to be the nicest BASIC implementation I've come across.

Have fun. Mike
Mike, K8LH is online now   Reply With Quote
Old 7th May 2007, 02:08 AM   (permalink)
3v0
Moderator
 
Blog Entries: 3
3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold
Default

Quote:
Originally Posted by Mike, K8LH
Anyone who generalizes about one language being better than another is pretty much a moron.
It is said that computer languages are a lot like religion. The one you learn first is always the most comfortable, the one most people prefer. Unless a person has studied/used several languages in depth he lacks the ability to make a sound judgment regarding the merits of any language.

Most people who know several languages will agree with your statment
Quote:
They all have their advantages and disadvantages
.

I too am sensitive to software prices. Esp since software tools seem to become obsolete faster then I can afford to buy them.
__________________
search engine for electronic parts
Junebug USB PIC programmer kit. USB Bit Wacker
3v0 is online now   Reply With Quote
Old 7th May 2007, 02:59 AM   (permalink)
Experienced Member
Mike, K8LH is a name known to allMike, K8LH is a name known to allMike, K8LH is a name known to allMike, K8LH is a name known to allMike, K8LH is a name known to allMike, K8LH is a name known to all
Default

I wish I could have put it so elegantly. Of course that's what I meant. When you become proficient in several languages you gain valuable knowledge and experience that helps you decide when it's appropriate to use one over another. BTW, my first language was Apple ][ Integer BASIC and Applesoft BASIC (1979). I did however have to write the real-time operating system firmware for the EPG and EPG-II character generators in 1984 (the earliest versions of the current "TV Guide Channel") using 6502 assembly language.

In a way I suppose having limited funds forced me to become proficient in Microchip's free assembler and C18 tools and I'm very thankful that both are "main stream" and shouldn't dissappear anytime soon. If Swordfish BASIC could somehow become Microchip BASIC they (Microchip) would have a pretty well rounded toolsuite offering. And if was a 'free' tool, man, that would be sweet.

Which brings up a question. Why doesn't Microchip have a BASIC language offering? Do they not consider it a viable language? Or, were they happy with the commercial BASIC offerings?

Last edited by Mike, K8LH; 7th May 2007 at 03:08 AM.
Mike, K8LH is online now   Reply With Quote
Old 7th May 2007, 03:18 AM   (permalink)
Experienced Member
 
Leftyretro has a spectacular aura about
Default

Quote:
Originally Posted by Mike, K8LH
I wish I could have put it so elegantly. Of course that's what I meant. When you become proficient in several languages you gain valuable knowledge and experience that helps you decide when it's appropriate to use one over another. BTW, my first language was Apple ][ Integer BASIC and Applesoft BASIC (1979). I did however have to write the real-time operating system firmware for the EPG and EPG-II character generators in 1984 (the earliest versions of the current "TV Guide Channel") using 6502 assembly language.

In a way I suppose having limited funds forced me to become proficient in Microchips free assembler and C18 tools and I'm very thankful that both are "main stream" and shouldn't dissappear anytime soon. If Swordfish BASIC could somehow become Microchip BASIC they (Microchip) would have a pretty well rounded toolsuite offering. And if was a 'free' tool, man, that would be sweet.

Which brings up a question. Why doesn't Microchip have a BASIC language offering? Do they not consider it a viable language? Or, were they happy with the commercial BASIC offerings?
Well my guess is that Microchip's main market, it's bead and butter, is the commercial embedded systems companies and ASM and C probably is used by 99% of those companies exclusively. I suspect we hobbyist are just small potatoes for MC and Basic is most likely not on their radar screen.

Lefty
Leftyretro is offline   Reply With Quote
Old 7th May 2007, 07:32 AM   (permalink)
Experienced Member
 
Blog Entries: 2
gramo is just really nicegramo is just really nicegramo is just really nicegramo is just really nice
Default

There's an overwhelming amount of support out there for PIC Basic over C, the same trend runs right across the board from PIC's to PC's.

Perhaps they just couldn't deliver a package as refined and reliable as what is commercially available?
__________________
Spency.

PIC Micro's - Your mind is the limit

PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net
gramo is offline   Reply With Quote
Old 7th May 2007, 08:31 AM   (permalink)
Experienced Member
Tim_B is on a distinguished road
Default

One recurring theme I have been seeing is the desire to have a free product, and that has to be first class and supported for life, this in reality is nigh on impossible.

As I said I know 2 commercial basic compiler writers and I know you very difficult to make a living from it, its always a side line. So to ask them to just give a full product away is not a viable option. To give the support you have to be around for long enough and with out an income you will never be able to.

I agree that some people (me I suppose) see Basic vers other languages as a religion and even religions have sub sects.

So there is no ambiguity my religion is BASIC worshipping the incarnation know as PROTON with leaning now towards Swordfish.

One thing is I know my religion and amongst the sub sects My favourite's are there because technically there the best.

I do not write in C (about the only other major serious religion) as I do not under stand it and I see no point learning it. I know there is no advantage (for me) in learning it as I can do just as well in Proton as I could in C.

Inevitably religious sects try to convert you to there's which can be a real pain in the ass, so my preaching is for the undecided. My main purpose is though to educate the mass's to learn how to play with pic's and to have fun.

The obligatory link to the my cathedral is www.protongeeks.com
Tim_B is offline   Reply With Quote
Old 7th May 2007, 10:47 AM   (permalink)
Experienced Member
 
mramos1 is a jewel in the roughmramos1 is a jewel in the rough
Default

Mike K8LH,

Give MikroBASIC a look. It is free to use up to 2K of code. Best for the price on the lite version.

Also, a new one is http://www.sourceboost.com/. It is free as beta right now. Will be around $70 when it is complete. Support is pretty good as well.

I have it working inside if MPLABS which is what I was after, so I can use all the tools. So BASIC + ASM + MPLABS + ICD2 =
mramos1 is offline   Reply With Quote
Old 7th May 2007, 11:12 AM   (permalink)
3v0
Moderator
 
Blog Entries: 3
3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold
Default Popularity stats.

Quote:
Originally Posted by gramo
There's an overwhelming amount of support out there for PIC Basic over C, the same trend runs right across the board from PIC's to PC's.
I was having fun with my original post in regards to how BASIC has morphed witout a name change. I did not mention C or BASIC vrs C. Others added that tired theme. But if we are going to go there here is the closest thing I found to real stats on language popularity.

http://www.tiobe.com/tpci.htm has a listing of languages in use.
Quote:
The TIOBE Programming Community index gives an indication of the popularity of programming languages. The index is updated once a month. The ratings are based on the world-wide availability of skilled engineers, courses and third party vendors.
I do not claim they are the last word but it looks about right regarding popularity. I do not expect to find many people programing a micro in Java.

Popularity in order of rank
  1. Java ....19%
  2. C ........15%
  3. C++ ...10%
  4. PHP ......9%
  5. VB .......8%
As you can see VB is a 8% where as the C is at 15%. The score for the C family (C, C++, C#) is about 30%. If you trust these numbers C is about 2 or 3 times more popular then VB.

I could care less about popularity. My favorite non micro language is C# which come in at 3.5% which is aa little less then half of VB use and ranks 8th.

More often people who program professionals do not have the luxury of choosing the language, Code written in X can not be maintained in Y. If you work in a shop where all the code is written in X you will code in X.

At the professional nobody cares what your favorite language/religion is. Everyone plays nice.
__________________
search engine for electronic parts
Junebug USB PIC programmer kit. USB Bit Wacker
3v0 is online now   Reply With Quote
Old 7th May 2007, 11:24 AM   (permalink)
Experienced Member
 
Blog Entries: 2
gramo is just really nicegramo is just really nicegramo is just really nicegramo is just really nice
Default

That’s a rather inaccurate tool to base popularity, as it, (quote)

Quote:
The ratings are calculated by counting hits of the most popular search engines
"C" is a much more broad term to search for than "Basic", and as a result, your going to end up with very inaccurate results. Consider this extract from devzone

Quote:
After reading this, I decided to try a manual comparison myself. I ran a test using Google and the query string provided in the TIOBE explanation (+"<language> programming" -tv -channel). Here are the results:

Java 13,600,000 hits
PHP 12,800,000 hits
Basic 7,810,000 hits
C 5,760,000 hits
Perl 5,610,000 hits
C# 4,660,000 hits
C++ 4,610,000 hits
Python 1,120,000 hits
Ruby 236,000 hits
Cobol 192,000 hits

Hmmm. This does not feel quite right. I'm sure Cobol has a bigger web presence, so maybe the query of "Cobol Programming" as a phrase match is too limitting as that may not be how Cobol people talk? Maybe they say "Programming in Cobol" instead? Or "Cobol Portal for Programmers". When removing the "Programming" part of the query, Cobol has 16,400,000 results. Wowzers. PHP jumps to 5,030,000,000. MEGA-WOWZERS! Let's look at the more raw hits and see where they stand, then we can come up with a revised query. This is the hits based on the query +<language> -tv -channel just to keep it similar:

PHP 5,030,000,000 hits
Basic 1,550,000,000 hits
Java 917,000,000 hits
Perl 328,000,000 hits
Python 231,000,000 hits
C++ 215,000,000 hits
Ruby 135,000,000 hits
C# 114,000,000 hits
Cobol 16,400,000 hits
__________________
Spency.

PIC Micro's - Your mind is the limit

PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net

Last edited by gramo; 7th May 2007 at 11:47 AM.
gramo is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Dragonfly 16F877A PIC Tutor with LCD & 4x4 keypad. Comments? William At MyBlueRoom Micro Controllers 6 27th November 2006 03:13 AM
free pic basic complier dstich Micro Controllers 7 1st August 2006 07:13 PM
Assembly to Basic Coding AZdave Micro Controllers 3 23rd January 2005 02:27 PM
PIC basic and Basic stamp Cyborg Micro Controllers 5 21st April 2004 08:44 AM
Can a Basic Stamp support 2 serial ports? Scruit Electronic Projects Design/Ideas/Reviews 13 15th August 2003 02:07 PM



All times are GMT. The time now is 12:11 AM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.