Pages: [1] 2 3   Go Down
Author Topic: Im learning PIC, dont kill me  (Read 2653 times)
0 Members and 1 Guest are viewing this topic.
Florida
Offline Offline
Full Member
***
Karma: 0
Posts: 171
1 Cor 10:31
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just thought Id post here mainly to get some reactions but also in case anyone else has had the trouble Ive been having. I made judicious use of the month microchip decided to send out free samples without any shipping/handling/misc fees and ordered a few PIC microcontrollers to play with (plus some parts in case the OBDuino project ever ends up working out). And boy, Ive never been more grateful for the arduino development environment.

The PIC scene is chaos, from what my few days of searching have turned up. No matter how many times you tell me, Im not going to program in straight assembler, and Im not gonna shell out several hundred dollars for a new IDE when microchip gives away an amazing one for free. There is a huge dearth from what ive seen of simple getting started tutorials for working with a free C compiler. The one exception is this site: http://www.gooligum.com.au/tutorials.html I would like to give a huge shoutout to David for making such amazing tutorials, and if anyone wants to expand their horizons a bit (if only to gain an appreciation for what you already have), I highly recommend learning from these tut's.

(Btw, the reason im using pics right now instead of arduino is so that I can make my girlfriend a nifty led matrix V-day gift, but dont have any cheap atmegas on hand-darn my procrastination)
Logged

Central Indiana, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 203
So many projects, so little time...and money!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I had dabbled with PIC for a while too.  A friend had given me a PIC Start plus programmer and I too had ordered free samples.  Assembly code is awful!  After more grief than anyone should bear, I bought an Arduino.  What a wonderful tool!  I will NEVER go back to PIC.  Do yourself a favor.  Order the Arduino now, finish your project with the PIC, and then kick yourself for procrastinating after you've successfully used some of the Arduino example sketches.  That will take about an hour after opening the box.  smiley  You won't regret buying the Arduino, but you sure will wish you never touched the PIC.  Well...maybe it will help you appreciate the Arduino that much more.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Two different subjects are being discussed here. C/C++ Vs Assembly language and PIC Vc AVR.

No argument here that starting out with a higher level language like C/C++ Vs Assembler is a much better and productive route for someone starting out fresh in this hobby. Assembler has it place and if anyone is really interested in how the base processor works, registers, status bits, etc then only Assembler will really unlock all that knowledge, however to just get a newcomer productive quickly then higher level languages are the way to go.

PIC Vs AVR is more of a religious/fan boy thing. Both make good products, and Microchip/PIC seems to be the larger company with a larger product line and user base. If the Arduino team had started with a PIC processor and developed the same IDE I would think it would have not made much of a difference to the existing users. However the the Arduino team, wanting a full open source platform, probably PICed (pun!) AVR because of the open source AVR/GCC C/C++ compiler that they could build on top of.

Lefty

« Last Edit: February 10, 2010, 10:42:59 am by retrolefty » Logged

Cardiff
Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think Arduino has a far better progression to professional AVR programming, whereas PICBasic teaches you nothing about real PIC programming.
Logged

Lancashire, UK
Offline Offline
Edison Member
*
Karma: 9
Posts: 1991
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Had a play with Picaxe, which is sort of like arduino (with PIC chips) with a preprogrammed bootloader.  Uses basic for prgramming, widely used in British schools because its so cheap. Its simple to get going, runs for weeks on 3 AA batteries, but its fairly limited and not a patch on Arduino.

http://www.rev-ed.co.uk/picaxe/
Logged


Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 5581
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
However the the Arduino team, wanting a full open source platform, probably PICed (pun!) AVR because of the open source AVR/GCC C/C++ compiler that they could build on top of.

That is probably the main reason. I don't know of any open-source PIC compilers (I would love to see an open source PIC Basic compiler).

I started out using the Arduino when I moved my linux workstation to a 64-bit distro (Ubuntu); I had been using an old 32-bit install of SuSE up until then. I was playing with a Basic Stamp 2 (based on a PIC) module I had (from Parallax) using their free tokenizer library and some glue scripting I created for my editor (so I could easily compile and upload to the Stamp). It worked pretty well, and I was beginning to do some serial comms stuff with the Stamp when I migrated.

The tokenizer library Parallax supplied no longer worked - it was written for 32-bit only, and there was only a binary supplied that was statically linked (!) to other libraries on the system, so there was no way to work around it (like using IA32 libs - I tried). I contacted Parallax, and they told me that they had no further contact with the programmer of the tokenizer library and they didn't have the source code, either. I was perfectly willing to compile it myself for 64-bit had they had the source code...

I did some more searching, and found Processing and the Arduino, and was instantly hooked. A quick order thru SparkFun and a week later I had the blink sketch running.

I have been burned too many times by closed source; the only thing I run currently now that is closed-source is the NVidia OpenGL drivers - I'll probably be burned by them someday, too (but what choice do I have for high-speed 3D graphics under linux?).
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have been burned too many times by closed source;

I agree. Even if you find a good fairly priced close source compiler, you still end up having to pay for version upgrades forever. Total full open source both for software and hardware, and being multi-platform (PC,Mac,Linux) is what made the Arduino platform unique in the industry and what any whanna be, (32 bit or not) has to compete against to get my attention.

Lefty
Logged

Cardiff
Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I don't know of any open-source PIC compilers (I would love to see an open source PIC Basic compiler).

There are no PIC Basic compilers, the PIC runs an interpreter unless you burn compiled C or assembler to it.
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 135
Posts: 6763
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
There are no PIC Basic compilers
Sure there are.  PicBasic from melabs.com,  XCSB form xcprod.com, and mikroBasic from mikroe.com to name a few.

There are also several C compilers that have "freeware" versions restricted to certain amounts of generated code.  I've used cc5x from bknd.com, and found it useful.  Also, some PICs are supposedly (somewhat) supported by the SDCC (Small Device C Compiler), which is an open source project.  For some reason SDCC doesn't seem very widely used.

There is no definitive reason that an arduino-like system couldn't be build around a PIC instead of an AVR.  There have been assorted "near" misses that haven't caught on much (USB Bitwhacker.  PicAXE.)  Someone has recently been trying to do something similar using JAL as the language (JAL ("Just Another Language") is a sort of C/Pascal hybrid.)   It can be diverting to consider the reasons why there have not been big successes in this area...
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

dont forget that guy who ported arduino onto a pic

oh and I have a 32 bit bitwhacker, I find it extremely frustrating to work with ... not totally on a software side but it eats up an entire breadboard

i would desolder the male pins I have on it, but the pads are so small they would vaporize, and if I put female headers on it, then I cant see which pins are which

and all the ports are scattered all over the place, you might have A13 then G8 next to each other

then the software, you need special versions of the uploader, which no one really tells you unless you go digging around the forums, then magic tricks in mplab

once you finally get it working with each other, you memorized the 1000000000 page pdf datasheet right? been programming pics for a decade using a needle and a 9v battery right

no? well have fun and see ya  :-/
« Last Edit: February 11, 2010, 12:40:53 pm by Osgeld » Logged


SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 135
Posts: 6763
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The actual technical advantages of Arduino are actually amazing small, considering the massive improvement in usability that they seem to produce.  Worth getting philosophical about, since if you can figure out how to do it over and over again, you can probably get rich and solve all the worlds problems at the same time!
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Worth getting philosophical about, since if you can figure out how to do it over and over again, you can probably get rich and solve all the worlds problems at the same time!

Heck yea, maybe we should get the Arduino team to help the US congress on a health care bill.  ;D

Lefty
Logged

Florida
Offline Offline
Full Member
***
Karma: 0
Posts: 171
1 Cor 10:31
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ive actually used arduino for a while now, and have three boards "sorta." I really enjoy the ease of making simple programs because of the hardware abstraction, and that seems hard to come by on the PICs im using. I did finally manage to get a decent C compiler I like and now my project is on track for the big Vday. After delving in tho, I do see a lot of value to going further than arduino, and am glad to have to sparingly modify registers directly.
Logged

Rural Arizona
Offline Offline
Edison Member
*
Karma: 7
Posts: 1711
Incorrigible tinkerer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
maybe we should get the Arduino team to help the US congress on a health care bill.

Yeah,  right:  then we'll be invaded by a wave of tea-party types,  flooding the board with GIFs of "Palin 2012" campaign posters,  and demanding that the use of Arduinos be banned in U.S. schools because it's open-source,  and a stalking horse for "European soshulism" [sic]

Logged

Rural Arizona
Offline Offline
Edison Member
*
Karma: 7
Posts: 1711
Incorrigible tinkerer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
There is no definitive reason that an arduino-like system couldn't be build around a PIC instead of an AVR.

Depends on the PIC:  the low-end ones are completely unsuitable to an Arduino-style environment,  because the hardware can't support C (much less C++) well.  Maybe some of the more "upscale" ones can,  but I've only worked with the 16Cxx range,  so I don't know much about their architecture.

Is there a "sub-family" of PICs that offers the fairly-orthogonal expandibility of the ATMegas?  
Logged

Pages: [1] 2 3   Go Up
Jump to: