Searching \ for 'pic basic' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/languages.htm?key=basic
Search entire site for: 'pic basic'.

Truncated match.
PICList Thread
'Pic basic'
1996\11\24@145220 by Tony Matthews

flavicon
face
I was just wondering if anyone had an opinion on pic basic like
described in nuts&volts.I've written lots in basic some in C and a
little in assembly.But I prefer basic.I'm an instant gratification sorta
guy I guess. Tony M.

1996\11\26@140737 by myke predko

flavicon
face
Hi Tony,

Since nobody else has responded I'll put in my two cents worth.

I was really disappointed/shocked in the performance numbers Scott Edwards
quoted in the article; they were something like 1,000x slower than what I
would consider a "decent" compiler (I seem to remember that a hand-written
assembler could be as much as 1,400x better) for the speed the PIC was
running at.  Now, it is 10-50x better than the STAMP, but it's really pretty
slow.

The "C" Compilers out there are a lot better in terms of producing
fast/reasonable code.

>I was just wondering if anyone had an opinion on pic basic like
>described in nuts&volts.I've written lots in basic some in C and a
>little in assembly.But I prefer basic.I'm an instant gratification sorta
>guy I guess. Tony M.

I thought Clint Eastwood said that the only thing wrong with instant
gratification was that it took too long...

myke

Today, the commercial sector is advancing computer and communication
technology at a breakneck pace.  In 1992, optical fiber was being installed
within the continental U.S. at rates approaching the speed of sound (if
computed as total miles of fiber divided by the number of seconds in the year).

Aviation Week and Space Technology, October 28, 1996

1996\11\26@143032 by Don McKenzie

flavicon
face
> >I was just wondering if anyone had an opinion on pic basic like
> >described in nuts&volts.I've written lots in basic some in C and a
> >little in assembly.But I prefer basic.I'm an instant gratification sorta
> >guy I guess. Tony M.

www.labyrinth.net.au/~donmck/picbasic.html
will give you some text to crunch on.

DonTronics Tullamarine, Australia
http://www.labyrinth.net.au/~donmck

1996\11\26@211942 by Tony Matthews

flavicon
face
myke predko wrote:
{Quote hidden}

That's what I had assumed. The same as on a pc since forever
I wrote initially in basic or c then converted the subroutines one at a
time to assembly.What I was wondering at the time was whether this was
practical on a pic whether the code in compiled basic would even fit to
start with but then I realize now that it was not a fair
question.Besides my Microchip data book has arrived and I think I'll go
with the assembly to start with.It looks reasonably doable
Thanks Tony M.

1996\11\27@171441 by Dave Mullenix

flavicon
face
> I was really disappointed/shocked in the performance numbers Scott Edwards
> quoted in the article; they were something like 1,000x slower than what I
> would consider a "decent" compiler (I seem to remember that a hand-written
> assembler could be as much as 1,400x better) for the speed the PIC was
> running at.  Now, it is 10-50x better than the STAMP, but it's really pretty
> slow.

Which Pic BASIC was he talking about?  PBASIC from Parallax is an
interpreter.  The "compile" option merely copies the interpreter and the
P-Code into a PIC.

There are also one or two true Pic BASIC compilers out there that produce
native PIC code.

The latter should be much faster than the former.

1996\11\28@022039 by Antti Lukats

flavicon
face
At 04:13 PM 11/27/96 -0600, you wrote:
>> I was really disappointed/shocked in the performance numbers Scott Edwards
>> quoted in the article; they were something like 1,000x slower than what I
>> would consider a "decent" compiler (I seem to remember that a hand-written
>> assembler could be as much as 1,400x better) for the speed the PIC was
>> running at.  Now, it is 10-50x better than the STAMP, but it's really pretty
>> slow.
>
>Which Pic BASIC was he talking about?  PBASIC from Parallax is an
>interpreter.  The "compile" option merely copies the interpreter and the
>P-Code into a PIC.
>
>There are also one or two true Pic BASIC compilers out there that produce
>native PIC code.

I know 5 PIC Basic "compilers" two of them are "pseudo" ie copy the
interpreter to
PIC code

1 Parallax Compiler: CODE.OBJ resides at 0400h in C58 prog mem
2 PIC Basic Compiler (FED): I think, (never seen, cani prove) is same style
 as Parallax Compiler, ie copies P-CODE to C64 prog mem
3 MEL Basic Compiler: True Compiler, asm output
4 TB84: (James) student project, free in source code form, generates asm 16C84
5 BASX: (Greg) never released, generates asm for 16CXX

Q: which ones you did mean, by two native generating compilers?

5 was never released,
4 is useless,
2 isnt compiler i think,

it leaves us with only one native code generating PIC compiler: 3 from MEL?
and thats only one I can count?
or are there some more compilers? I am really interested if...

>The latter should be much faster than the former.

MEL Basic compiler is pretty much as fast as PIC can be (in native exec)

BTW I am writing a Basic compiler for AT89C2051 seems so easy that I might
just add PIC code generator to it later. Comments?

antti
-- Silicon Studio Ltd.
-- http://www.sistudio.com


'Pic basic'
1996\12\01@105431 by myke predko
flavicon
face
>> I was really disappointed/shocked in the performance numbers Scott Edwards
>> quoted in the article; they were something like 1,000x slower than what I
>> would consider a "decent" compiler (I seem to remember that a hand-written
>> assembler could be as much as 1,400x better) for the speed the PIC was
>> running at.  Now, it is 10-50x better than the STAMP, but it's really pretty
>> slow.
>
>Which Pic BASIC was he talking about?  PBASIC from Parallax is an
>interpreter.  The "compile" option merely copies the interpreter and the
>P-Code into a PIC.

Sorry for taking so long to reply; I had to find the original article.

It's the Micro Engineering Labs BASIC - for $100.00.

The article is in Scott Edward's April 1996 "Stamp Applications" of Nuts &
Volts.

In it, Scott shows the section of code:

 again:
  b1 = b1 + 1                  ;  increment b1
  toggle 0                     ;  toggle pin 0
  goto again

and then goes on to give the following performance results:

 BS1, 4 MHZ            479 Hz
 .
 :
 16C84, compiled 4 MHZ 7215 Hz


Now, my thought was that any decent compiler would produce the following code:

again
 incf   b1                     ;  increment b1
 movlw  0x01                   ;  toggle pin 0
 xorwf  PORTB                  ;  Assume pin 0 is in PORTB
 goto   again

This can be improved to:

 movlw  0x01                   ;  Setup Pin to Toggle
again
 incf   b1                     ;  increment b1
 xorwf  PORTB                  ;  toggle pin 0
 goto   again

Although while I would expect this type of optimization for a workstation
compiler, I wouldn't think that it would be reasonable for a Hobbyist one.

The first loop takes five instruction cycles to run (the second four) - five
instructions running at 4 Mhz (1 MHz Instruction cycle frequency) means that
the loop would run at 200 KHz.


I guess I exaggerated a bit for the relative improvement - I was talking
about 1,000x when I should have said 30x.

But, I think you can see that there is area for concern/improvement.  Not
only in terms of speed, but also in terms of instruction space; what is the
PIC executing during this loop?

>There are also one or two true Pic BASIC compilers out there that produce
>native PIC code.
>
>The latter should be much faster than the former.

According to the article, this Compiler is creating native code.

myke

Today, the commercial sector is advancing computer and communication
technology at a breakneck pace.  In 1992, optical fiber was being installed
within the continental U.S. at rates approaching the speed of sound (if
computed as total miles of fiber divided by the number of seconds in the year).

Aviation Week and Space Technology, October 28, 1996

1996\12\01@163921 by kirsi

flavicon
face
At 10:53 AM 12/1/96 EST, you wrote:
{Quote hidden}

Myke, you forgot that MEL' PBASIC compiler is Compiler from Basic Stamp Basic,
not a PIC Basic compiler.

To be compatible with BS1 the compiler uses internal 16 bit mathm
b1 = b1 + 1
will result in 16 bit addition!

TOGGLE instruction makes pin output and toggles state, those
the compiler must access Bank 1 to access tristate control.
and later toggle the port pin.

so there are things todo in such simple code too :)

>This can be improved to:
>
>  movlw  0x01                   ;  Setup Pin to Toggle
>again
>  incf   b1                     ;  increment b1
>  xorwf  PORTB                  ;  toggle pin 0
>  goto   again

Yep this would be real nice. :)

>Although while I would expect this type of optimization for a workstation
>compiler, I wouldn't think that it would be reasonable for a Hobbyist one.
>
>The first loop takes five instruction cycles to run (the second four) - five
>instructions running at 4 Mhz (1 MHz Instruction cycle frequency) means that
>the loop would run at 200 KHz.

I checked our multi-target Basic compiler with PIC as target with your
code and got 50 KHz for the same loop.

Well our compiler only supports byte vars. And does not make any optimising.

>I guess I exaggerated a bit for the relative improvement - I was talking
>about 1,000x when I should have said 30x.
>
>But, I think you can see that there is area for concern/improvement.  Not
>only in terms of speed, but also in terms of instruction space; what is the
>PIC executing during this loop?

see above, it is also translating pin  number to bit mask. and resets watchdog
at every basic instruction.

>>There are also one or two true Pic BASIC compilers out there that produce
>>native PIC code.
>>
>>The latter should be much faster than the former.
>
>According to the article, this Compiler is creating native code.

Hm, I checked the native compiler and got 12.8 KHz for your loop.
Maybe I did something wrong.

antti
-- Silicon Studio Ltd.
-- http://www.sistudio.com

1996\12\01@205628 by Walter Banks

picon face
> >
> >The article is in Scott Edward's April 1996 "Stamp Applications" of Nuts &
> >Volts.
> >
> >In it, Scott shows the section of code:
> >
> >  again:
> >   b1 = b1 + 1                  ;  increment b1
> >   toggle 0                     ;  toggle pin 0
> >   goto again
> >
> >and then goes on to give the following performance results:
> >
> >  BS1, 4 MHZ            479 Hz
> >  .
> >  :
> >  16C84, compiled 4 MHZ 7215 Hz
> >
> >
> >Now, my thought was that any decent compiler would produce the following
code:
{Quote hidden}

I think the output would be more likely to be 100KHz. 5 instructions on and 5
instructions off.

>
> I checked our multi-target Basic compiler with PIC as target with your
> code and got 50 KHz for the same loop.

I just checked the MPC compiler and it generates the 5 instruction sequence
first
shown above.

One of our other compilers surprised me with the following code sequence
equivalent.


     movlw  0x01                   ;  Setup Pin to Toggle
again
     xorwf  PORTB                  ;  toggle pin 0
     goto   again

The missing increment was caused by a default non-volitile variable that was
never
again referenced in the program. Its value did not matter.

True comparitive benchmarks are tough to write.

Walter Banks

1996\12\01@235240 by myke predko

flavicon
face
Walter Banks said:

>> >The first loop takes five instruction cycles to run (the second four) - five
>> >instructions running at 4 Mhz (1 MHz Instruction cycle frequency) means that
>> >the loop would run at 200 KHz.
>
>I think the output would be more likely to be 100KHz. 5 instructions on and 5
>instructions off.

Sorry, yes, you're right.  I meant to say that the loop would execute at 200
KHz, not the LCD flashing.

{Quote hidden}

I'm impressed; that's the sort of performance I would expect from a
professional compiler.

>True comparitive benchmarks are tough to write.

This may sound cynical, but I don't know if there's any such beast as a
"True comparitive benchmark".  Any benchmarks I've seen seem to be more
marketing tools than anything else (anybody else remember the Intel i86 vs.
Motorola 68K benchmarking fiasco of the early '80s?).

myke

Today, the commercial sector is advancing computer and communication
technology at a breakneck pace.  In 1992, optical fiber was being installed
within the continental U.S. at rates approaching the speed of sound (if
computed as total miles of fiber divided by the number of seconds in the year).

Aviation Week and Space Technology, October 28, 1996

1996\12\02@134108 by Chuck McManis

flavicon
face
Sanity check time:

Someone else wrote:
> I was really disappointed/shocked in the performance numbers Scott Edwards
> quoted in the article; they were something like 1,000x slower than what I
> would consider a "decent" compiler (I seem to remember that a hand-written
> assembler could be as much as 1,400x better) for the speed the PIC was
> running at.  Now, it is 10-50x better than the STAMP, but it's really pretty
> slow.

The PIC is a computer, each interpreted BASIC statement takes some number of
PIC instructions to execute, a compiler removes the interpreter part and
substitutes
for it just enough instructions to accomplish the computation. So ask yourself
this:

A.) "How many PIC instructions would it take me to implement TOGGLE 1 ?"

B) "How many PIC instructions would it take to switch on the TOGGLE byte code,
    interpret an argument, and then change the state of the pin?"

Now Divide B by A and that is your maximum speed up. If you *EXPECT* a 1000x
improvement then you think it would take 1000 instructions to implement a single
BASIC command. That is clearly unrealistic. 10x - 50x says to me "It takes
between
10 and 50 times more instructions to interpret a byte code than it does to do it
directly." Which is a reasonable statement.

--Chuck

1996\12\02@135959 by mike

flavicon
picon face
In message  <spam_OUT32A25DCC.1E3FTakeThisOuTspambytecraft.com> .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU writes:
> > >
> > >The article is in Scott Edward's April 1996 "Stamp Applications" of Nuts &
> > >Volts.
> > >
> > >In it, Scott shows the section of code:
> > >
> > >  again:
> > >   b1 = b1 + 1                  ;  increment b1
> > >   toggle 0                     ;  toggle pin 0
> > >   goto again
> > >
[much snipping]
{Quote hidden}

Walter,

If it wasn't the MPC compiler, which one was it?

Regards,



Mike Watson

1996\12\02@163141 by Bradley, Larry

flavicon
face
Here is the code produced when I ran it thru the PicBasic compiler:

Basic:
again:
  b1 = b1 + 1                  ;  increment b1
  toggle 0                     ;  toggle pin 0
  goto again

Compiler output in asm:

_again      movf  _B1,W
     call  R0@0W
     movlw 001h
     call  add@0W
     movf  R0,W
     movwf _B1
     movlw 000h
     call  toggle@
     @GOTO _again

Note the three subroutine calls ... not quite as tight as Myke's code.
The first call loads R0 from W. Then the constant "1" is loaded into W,
and a subroutine is called to do the addition. Then registers are mucked
about with and the toggle subroutine is called.


I'm no compiler expert, althought I did study the subject years ago, and
wrote some compiler code as a fun project.

Converting "b=b+1" into "increment b" is what is called peephole (or
local) optimisation ... look at a single statement, and see if the code
can't be tightened up. Obviously the MEL compiler is not doing this in
what is probably the most obvious case of peephole optimization, since
most computers have an increment/decrement instruction, and this
contruct is so commonplace.

It is same, therefore, to assume that the MEL compiler doesn't do any
optimization. But for $99, perhaps one should not expect much.

What is real interesting about the MEL compiler is that they provide the
library in source form, and the compiler produces ASM out the back end.
It would be possible (although a fair bit of work) for a person to
optmize code manually, assuming one knew assembler. Of course, if one
did, one would probably write in assembler from the beginning, wouldn't
one!

We must recognize what the MEL PicBasic compiler was meant to do ....
provide a means to write code for a 16C84, in Basic. The code will be
faster for two reasons ... it does not have to be interpreted, and more
important, it does not have to be read from S-L-O-W serial EEPPROM.
Hopefully, it will also be small, since the compiler only includes those
library routines it needs, whereas the real BASIC interpreter has all
the library code builtin.

I'm sure the folks at MEL could produce a much better version of the
compiler if there was an economic incentive to do so.

Larry

>----------
>From:  myke predko[SMTP:mykespamKILLspamPASSPORT.CA]
>Sent:  Sunday, December 01, 1996 10:53 AM
>To:    Multiple recipients of list PICLIST
>Subject:       Re: Pic basic
>
(snip)
{Quote hidden}


'PIC BASIC'
1998\08\29@022034 by Lester Wilson
flavicon
face
For those of you who use PICBASIC

there is a PICBASIC mail list running

.....PICBASIC-LKILLspamspam.....qunos.net

Its supported by MP Labs and Crownhill Associates ( UK Distributor)

Regards

Lester Wilson
Crownhill Associates Limited
The Old Bakery
New Barns Road
Ely, Cambs.
CB7 4PW
Tel: +44 (0) 1353 666709
Fax: +44 (0) 1353 666710

1998\08\29@025419 by Don McKenzie

flavicon
face
Lester Wilson wrote:
>
> For those of you who use PICBASIC
>
> there is a PICBASIC mail list running
>
> EraseMEPICBASIC-Lspam_OUTspamTakeThisOuTqunos.net
>
> Its supported by MP Labs and Crownhill Associates ( UK Distributor)
>
> Regards
>
> Lester Wilson
> Crownhill Associates Limited

Where can users find instructions on how to subscibe Lester?
I did ask mEL, but was told it would be posted but I still wonder where
and when.

Don McKenzie  donspamspam_OUTdontronics.com   http://www.dontronics.com

Don's Download Dungeon http://www.dontronics.com/download.html
For more details, send a blank message to @spam@infoKILLspamspamdontronics.com
or KILLspamsimstickKILLspamspamdontronics.com or RemoveMEbasicsTakeThisOuTspamdontronics.com

1998\08\30@135250 by Lester Wilson

flavicon
face
Hi
since my earlier posting mentioning the PIC BASIC mail list. Many people
have mailed me asking exactly how they should subscribe.
to clarify the matter and to end the postings to this list on the subject.
To subscribe to the PIC BASIC mail list send a message to
spamBeGonemajordomospamBeGonespamqunos.net
and in the message put
subscribe TakeThisOuTpiclist-lEraseMEspamspam_OUTqunos.net

regards
Lester

{Original Message removed}


'pic basic'
1998\12\14@081105 by andrej.vuga
flavicon
face
Hello!

Does someone know, where can I find a free or shareware basic compiler
for PIC 16F84?

Thanks in advance
                                                   Andrej

1998\12\15@025816 by Dr. Imre Bartfai

flavicon
face
Hi,

look at http://people.frankfurt.netsurf.de/wky/pic.htm#table4

Imre


On Mon, 14 Dec 1998, Andrej Vuga wrote:

> Hello!
>
> Does someone know, where can I find a free or shareware basic compiler
> for PIC 16F84?
>
> Thanks in advance
>                                                     Andrej
>
>


'PIC Basic'
1999\01\18@011722 by James Donley
picon face
I am looking for a copy of PIC Basic

Please respond to me offline

Thankyou
Jim

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


'PIC Basic'
1999\09\03@052430 by ist
flavicon
face
Does anyone know where to find a Free trial / just free version of PicBasic?

Best Regards

Lars T

-----Original Message-----
From: pic microcontroller discussion list
[RemoveMEPICLISTspamTakeThisOuTmitvma.mit.edu]On Behalf Of Andy Midev
Sent: den 3 september 1999 11:17
To: PICLISTEraseMEspam.....mitvma.mit.edu
Subject: Melabs PicBasic help needed


I have lost the PicBasic files PBL.INC,
PBH.INC, and B16C84.INC.

Please, could somebody send me these files
via email?

Thanks in advance.

   Andy

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

1999\09\06@002938 by kypros.vassiliou

flavicon
=?iso-8859-1?Q?Lars_Th=F6rnqvist?= wrote:
>
> Does anyone know where to find a Free trial / just free version of PicBasic?
>
> Best Regards
>
> Lars T
>
> {Original Message removed}


'PIC Basic'
2000\03\15@154526 by Jawed Mateen
flavicon
face
part 0 358 bytes
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META content='"MSHTML 4.72.3110.7"' name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#000000 size=2>Did any body used PicBasic Pro Compiler?How does
it works?</FONT></DIV></BODY></HTML>

</x-html>

2000\03\15@164155 by andy howard

flavicon
face
>Did any body used PicBasic Pro Compiler?How does it works?


I have used it, but you can learn to program PICs in assembly about as
quickly as you can master PBP. And you'll have a better understanding of
PICs if you habitually use assembly code too.

Anyway, to answer your question, it works fairly well, is DOS based and
stable, sort of integrates with MPLAB, has good support for I/O etc.
You'll still need to use some assembly for tricky bits though.

As someone else has said, the documentation isn't very well laid out and
if you're a beginner you'll need some tutorial material too (there's
plenty of that on the web of course).

Overall I'd say it's a bit expensive for what it is, given that there
are some perfectly good C/Forth/other compilers around for less (and
indeed for free); but it does what it claims to do and does it without
any fuss.












.

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...