BASIC to PIC

Electronics Computer Programming Q&A
User avatar
Lenp
Posts: 1479
Joined: Thu Oct 26, 2006 8:11 pm
Location: Maryland
Contact:

BASIC to PIC

Post by Lenp » Tue Nov 28, 2006 7:48 pm

Over the years I've learned to do some programming with the Parallax line and now want to migrate to PIC's. I want as short a learning curve as possible since it is not a life long need!

Preferrably, some of my previous designs could be ported with mnimal rewrites to a comparable PIC. I'm old school, BS1C and the BS2 are where the designs live now!

All opinions and thoughts appreciated and considered.

Thanks gang,
Len

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl » Wed Nov 29, 2006 12:34 am

Hi there,

There is PIC basic, but you have to buy it.

I use Assembler as it comes free with the Microchip software.
It's also nice to know what each instruction is doing as assembler
is closest to the hardware.
LEDs vs Bulbs, LEDs are winning.

bodgy
Posts: 1044
Joined: Tue Dec 04, 2001 1:01 am
Location: Australia
Contact:

Post by bodgy » Wed Nov 29, 2006 2:27 am

You could look at XCSB basic, it is a structured basic and therefore becomes but a short step to 'C' if you ever felt like it.

Colin
On a clear disk you can seek forever.

User avatar
Lenp
Posts: 1479
Joined: Thu Oct 26, 2006 8:11 pm
Location: Maryland
Contact:

Post by Lenp » Wed Nov 29, 2006 3:26 am

OK, now there are two options, PIC Basic and XCSB basic.
Are there advantages /disadvantages to either(disregarding the cost)?
Which of the two is the closest to the PBasic I've been using.
Do either run like PBasic, program/load/run all in the same setting or are they more involved.
Can I still program test and debug in PBasic then load it to a PIC?
And kastly, what PIC's are a matchup to the Parallax line?

Whew, this is a tall order, so thanks in advance!

Len

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Post by philba » Wed Nov 29, 2006 7:51 am

well, I don't recommend basic for serious work but look into mikrobasic - http://www.mikroelektronika.co.yu/
there is a free version, I believe. I get a not-found error when I follow their compiler link but that's probably temporary.

bodgy
Posts: 1044
Joined: Tue Dec 04, 2001 1:01 am
Location: Australia
Contact:

Post by bodgy » Wed Nov 29, 2006 6:42 pm

Lenp wrote:OK, now there are two options, PIC Basic and XCSB basic.
Are there advantages /disadvantages to either(disregarding the cost)?
Which of the two is the closest to the PBasic I've been using.
Pic Basic will be closer to PBasic at is it an interpreted basic.
Do either run like PBasic, program/load/run all in the same setting or are they more involved.
If you mean from within an IDE, then Pic Basic has its' own IDE, XCSB is meant to be used with a text editor - but can be used with the JALcc IDE. It compiles to a hex file ready for downloading, but as it is IDE'less has no debugging facility.Can I still program test and debug in PBasic then load it to a PIC?
And kastly, what PIC's are a matchup to the Parallax line?
All 16F pics can be coded with Pic Basic to my knowledge.

Have a look on my website for XCSB code - you'll see it is very close to 'C' in structure.


Colin
On a clear disk you can seek forever.

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl » Thu Nov 30, 2006 2:47 am

Hi again,

I think i understand why you want to get a language as close to
your old language as you can get, but also keep in mind that
'assembler' for the PIC is not like assembler for a computer.
There are only 35 instructions to learn in order to program a PIC
chip in 'assembler'. It's worth learning even if you use some sort
of basic too.
I can also tell you that program translation takes some work when
translating a program from one language to another. There are
idiosyncrasies for both langauges which must be clearly understood
in all but the simplest programs before a given program will run entirely
error free in the new langauge unless someone takes the time to
write a good translator.

When it comes to the PC though, I currently program in several
languages and the only one i would want to give up entirely is BASIC
<chuckle>. I guess for the PIC it's different though :smile:
LEDs vs Bulbs, LEDs are winning.

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Post by philba » Thu Nov 30, 2006 10:05 am

al, we sure do agree on Basic.

However, I don't think pic asm is that different from more sophisticated computers' assembly language. The concepts are largely similar. In fact, for newbies, I think it's actually harder because of banking, paging, skip conditionals and so on.

User avatar
Lenp
Posts: 1479
Joined: Thu Oct 26, 2006 8:11 pm
Location: Maryland
Contact:

Post by Lenp » Sun Dec 03, 2006 6:28 am

Hey guys ... thanks.

Now that this thread seems to have slowed down some I'll sit back and consider the opinions before I proceed. I've been stuck on basic since forever and maybe this trick pony needs a few new acts!

Thanks for the info and views...

Len

cwaugs
Posts: 28
Joined: Thu Sep 01, 2005 1:01 am
Contact:

Post by cwaugs » Sun Dec 03, 2006 2:16 pm

If you're going to buy, wouldn't buy anything else but PicBasic or PicBasicPro from Melabs. Hands down the best support forum by far! Well worth the money. Stay away from Mbasic. Not Good!

User avatar
Lenp
Posts: 1479
Joined: Thu Oct 26, 2006 8:11 pm
Location: Maryland
Contact:

Post by Lenp » Mon Dec 04, 2006 4:13 am

cwaugs

No difference of opinion here, but, why do you feel PicBasic it is the best? There are so many options I am just trying to separate the wheat from the chaff!

The real issue I have is porting from the pBbasic platform to a PIC. I have several products that were developed some time ago with pBasic and am going to resurrect them for commercial use. I need to cut costs by changing the processor and really do not want to spend too much time on code rewrite especially not being sure of the product future.

A new design, from ground up, would be a different story.

Thanks for your input

Len

cwaugs
Posts: 28
Joined: Thu Sep 01, 2005 1:01 am
Contact:

Post by cwaugs » Mon Dec 04, 2006 10:15 am

The support is by far the best I've ever experienced. I'm sure you could go to the forum and get the info. (if any change is needed) because pic and stamp goes back and forth fairly easily. Try the demo, it will probably do what you need. (stamp brains are smaller?) HTH cwaugs

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl » Wed Dec 06, 2006 6:22 am

Hi again,

Philba, yeah the banking is strange huh? ha ha.
I see why they did it though, to keep the instruction bit size low.
Still, using 16 bits instead of 14 would mean a larger area of
memory could be accessed with one instruction. For some reason
they wanted to keep the size of these 'mid range' chips to 14 bits.
LEDs vs Bulbs, LEDs are winning.

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Post by philba » Wed Dec 06, 2006 1:20 pm

I suspect the reason for banking and paging is compatibility when they were forced by customer demand to go past the architecture limits. They could have changed the instruction set and thus forced people to change their code to move to the newer chips. By preserving the compatibility, they made it easy to move up but made larger programs harder to write.

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl » Fri Dec 08, 2006 4:04 am

Hi again,

Yes that's true, but it's hard to believe that in this day and age
of programming with high level languages we have to bank switch
manually.
I still like these chips however, and will continue to use them because
they really can do jobs that are really hard to do in pure analog or
using discreet digital chips.
LEDs vs Bulbs, LEDs are winning.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests