PIC uC

Hi...Is it possible for arduino to also use a PIC micro.....The one thing that stops me using arduino in a project is the AVR chip...It always has to use an extra FTDI (convert modern usb to old serial) chip....A PIC 18F2550 0r 4550 has direct usb ...Also every avr programmer has that useless 6pin DIL socket to try and adapt to a breadboard...PIC has a simple SIL socket...I believe if arduino used both avr and pic this would give people the choice in project building...building a project on a breadboard is so much easier with a pic uC and PicKit programmer....I have tried to use the avr but to many additional connections are needed
Thanks...Jeff

griffo:
building a project on a breadboard is so much easier with a pic uC and PicKit programmer....I have tried to use the avr but to many additional connections are needed

Here is my breadboard Arduino:

SIL socket for programming (need a USB to serial cable, like my PICAXE did).


Or this:

Can't get much simpler than that.

griffo:
Hi...Is it possible for arduino to also use a PIC micro.....

The answer is yes, assuming you mean use the "Arduino" IDE and the associated core library APIs.
Have a look at these links:
http://chipkit.net/chipkit-bb32/
http://chipkit.net/diy-chipkit-board/
From these you can see it just as easy to hook up a modern DIP based PIC as a dip based AVR.
However, the PIC is MUCH faster with gobs of additional resources and no messy Harvard architecture
to worry about.

More links for additional PIC based "duino" products and support forums:

http://www.chipkit.org/forum/index.php
http://chipkit.net/
http://www.digilentinc.com/Products/Catalog.cfm?NavPath=2,892&Cat=18

--- bill

I have no personal preference for Atmel or Microchip products. I built a couple of PIC projects long before Arduino appeared and chose PIC just because there was a magazine article with instructions about programming them from a PC parallel port. At that time there were no free IDEs.

I recently bought a Uno board because it was available in a Maplin store I went into for another reason - and the Uno was reasonably priced. I like the Arduino system because it worked straight out of the box on my Linux PC.

I would be very interested to know which PIC chip you are referring to and I presume the comparison is with the Atmega328. Also, what "gobs of additional resources" does it have?

I can't say I have noticed the existence of a harvard architecture so I would also be interested to know how I would notice if it wasn't there.

Also, for the "benefit" of other readers I don't understand why the Arduino community doesn't take the "Chipkit" into its community. There doesn't seem to be any value in keeping them separate. I would hate to think that Arduino was secretly a marketing department for Atmel.

...R

bperrybap:
However, the PIC is MUCH faster with gobs of additional resources and no messy Harvard architecture
to worry about.

A PIC 18F2550 0r 4550 has direct usb

You could get a "USB BitWhacker" USB Bit Whacker - 18F2553 Development Board - DEV-00762 - SparkFun Electronics
This is, hardware-wise, almost exacly what you seem to want: a USB-enabled PIC pre-loaded with a USB bootloader, so you can plug it in and upload programs without actually needing a "programmer." There are tutorials online on homebrew versions (though I guess they would have the usual chicken-and-egg problem with loading the bootloader.) And it even dates back to about the same timeframe as the original USB arduino.

Oh. There's no free "quality" C compiler, no simplified IDE, and the premade hardware costs about as much as an Arduino in spite of having fewer features. :slight_smile:

There is also GitHub - sirloon/jaluino: Automatically exported from code.google.com/p/jaluino
Someone already mentioned ChipKit, which is a pretty brilliant board, but it's based on PIC32 rather than the 8bit PICs you mentioned, and it also has the FTDI you're trying to avoid. (I don't know why; FTDI seems to do a much better job supporting USB than most vendors!)
And there's also Arduino Leonardo, which uses a USB-enabled AVR chip, so it doesn't need the FTDI (or equiv.)

"gobs of additional resources"

the ChipKit "Uno32" board uses a PIC32MX320F128 32-bit (MIPS architecture) microcontroller that runs at 80MHz, has 140k of flash and 16k of RAM and provides 42 IO pins (12 analog.) That's a pretty good start.

Robin2:
I would be very interested to know which PIC chip you are referring to and I presume the comparison is with the Atmega328. Also, what "gobs of additional resources" does it have?

I can't say I have noticed the existence of a harvard architecture so I would also be interested to know how I would notice if it wasn't there.

If you haven't noticed the Harvard architecture messiness on AVR then you are not storing any constant data in flash.
In the AVR using gcc you have to use constructs outside of the normal C language to access the flash because it is a separate address space.
(That is what the all the PROGMEM stuff is for).
Not only is this slower than having direct access to the memory space but it requires using access routines and really muddies up
your code because you can't just do things like declare const structures and access the data members directly from flash.
Bottom line is Harvard Architecture makes the internal h/w simpler and often faster because of
that simplicity but often makes some of the s/w more complex, particularly code that has const data.
Dealing with const data messy and often a pain to port to other platforms because the code to deal
with it is often proprietary to that chip. Sure you can wrap things in portability macros,
but it still a pain and can often slow down the non Harvard implementations because the code
can't be written to directly access data structures in FLASH.
Other AVR compilers may be able to better hide the alternate memory space accesses
required on a Harvard Architecture,
but the extra overhead of accessing these memory spaces will still be there.

As far is resources go, have a look at the links I provided.
The PIC chips used in the standalone breadboards are PIC32MX250F128B
which is a good comparison for a atmega32 as both are 28 pin DIP and
they are in the same price ball park for hobbyist (under $5 quantity 1)
and both are relatively easy to hook up on a protoboard or breadboard.
The atmega328 AVR is not even in the same class as the newer PICs.

As far as a few high level additional capabilities:
The PIC is a 32 bit processor vs an 8 bit AVR.
The PIC can be clock much faster (40mhz vs 20mhz)
It has 128k FLASH vs 32k FLASH, 32k RAM vs 2k RAM.

Capabilities not in the m328 AVR:
multiple of these ports: SPI, UART, i2c.
DMA capabilities and a realtime clock.
Native USB support.
With native USB support you don't even need an FTDI board/chip or
a PICkit to update the firmware, assuming the chip has the
bootloader pre-burned into it.

set and clear registers. On AVR you have to use special instructions
on the desired register to get atomicity and it only works on a single bit at a time, and even
then it can only be used when the bit is known at compile time.
It means that on AVR, there is additional overhead to ensure atomicity
when there are multiple bits involved or the bits are not known at compile time.

--- bill

Robin2:
Also, for the "benefit" of other readers I don't understand why the Arduino community doesn't take the "Chipkit" into its community. There doesn't seem to be any value in keeping them separate. I would hate to think that Arduino was secretly a marketing department for Atmel.

I totally agree.
To me, the latest DIP PIC chips are much more interesting than DUE
since they are cheap, easy to work with, and 5v tolerant.
I'd much rather have a "uno" type board with a dip PIC on it rather than
a DUE.

In the bigger picture, the arduino community is taking the Chipkit stuff in.
(Support is available in MPIDE)
It just isn't happening within the "Official Arduino" code controlled and released by the Arduino team.

--- bill

DMA capabilities and a realtime clock.
Native USB support.

Careful; there are several ChipKit boards, and not all of them have DMA, and MOST do not have direct USB support (in some cases, the CHIP has native USB support, but it doesn't have the (few) additional components or connector.)
(For instance, the "Network shield" for the ChipKit Max32 is very-depressingly more expensive than the Arduino Ethernet shield, even though the chip on the Max32 itself already has an ethernet MAC, and USB support, and ... Sigh.)

Thanks Bill for all that info.

The truth is that I'm unlikely to want all that performance. For me, it's starting to crossover to what I might call a "full" computer and if I had an application that needed all that stuff I would start to wonder about using a "real" PC (or perhaps a RaspberryPI - but I don't have a TV to view the output!) and taking advantage of programming it in JRuby to reduce the "cost" of program writing.

On the other hand it's nice to see that the PIC is available in a DIP version.

...R

Hello Jeff,

griffo:
Hi...Is it possible for arduino to also use a PIC micro.....

have a look at the pinguino project. They use both 8 bit (18f2550, 4550, 26j50, 47j53) and 32 bit PICs (32MX220/250, 32MX440, 32MX795).

The IDE is written in Python and is similar to the arduino IDE.

Additional information about compatability pinguino vs. arduino you can get here.

Oliver

There is also the Chipino which is in an Aruidno Uno form factor.

The Arduino environment is well supported on Pic32 but not on earlier chips.
See: http://chipkit.net

The key issue is not the IDE (written in portable Java), but the compiler and libraries. Chipkit & vendors have put a lot of effort into converting over many popular Arduino libraries.

Arduino was secretly a marketing department for Atmel

From Atmel's point of view, Arduino is an outstanding marketing tool. Nothing secret or unethical involved. The CEO of Arduino and a founder of Atmel AVR appeared together onstage at the last New York Maker Faire. They were announcing the new 32bit line beginning with the Due.

Atmel's rival Microchip took notice and launched the Chipkit venture. In other words they knew a bandwagon when they saw it.
In the 32bit world, the chips are very similar. Having chip competition is good for the Arduino community.

PIC is MUCH faster

This is a misleading comparison between 8bit and 32bit. We must compare the 32bit offerings with each other.

The main practical advantage of the 32bit PIC chips is their 5volt tolerance on digital inputs. In addition Microchip has some DIP versions not just surface mount.

We can safely ignore the quasi-religious dispute over Harvard Architecture. Big Endians vs. Little Endians (see Gulliver's Travels)

My "speed" comment was respect to comparing the two 28 pin DIP microcontrollers I mentioned.
It is not misleading in that it was a direct comparison of what you are getting in those 28 pin packages
for the same amount of money. It wasn't meant as a generic PIC vs AVR statement.

I think the Harvard Architecture is somewhat of an issue since having it makes the code "ugly",
often slower , and often non portable across other platforms since it doesn't allow direct access to the data
and requires access routines.
Think of how much simpler things would be for newbies if they didn't' have to mess with all the PROGMEM stuff.
Just declare your data const and be done with it.
They also often surprised that a string literal ends up chewing up the very limited ram on the AVRs.

--- bill

There's a lot of whining in this thread.... If you don't like AVR, don't use it. Arduino is far from the only beginner framework out there. And as noted, there have been plenty of ports to other platforms with various degrees of compatibility. These can be grafted in to the Arduino IDE if you're so inclined, although the IDE is my least favorite thing about the Arduino platform, so I dunno why that would be anyone's goal.

Harvard architecture is not sloppy, nor "ugly". It's a rather elegant way of keeping the executable instructions safe from accidental (or not) harm. If PCs had used something similar, we wouldn't constantly be fighting buffer overflow security holes. Not that it's a perfect solution. Every choice has its compromises. Again, if you don't like it, you have PLENTY of other options. Coming on here and preaching to the world about how it's so obviously flawed is going to change no minds at Atmel, nor Arduino. Also, I don't think Arduino is going to abandon AVR since backward compatibility seems to be a high priority to them. I don't think that implies any devious relationships, I think it's just part of supporting a mature product portfolio. AVR was, and is, a fine choice.

Not using AVRs because of a serial pinout or FTDI is just silly though. It's an electronics development platform. You can't come up with a way of converting 2x3 to 1x6? You're not going to get very far in this hobby if that's all it takes to stop you.

Sorry for my grumpiness. :stuck_out_tongue:

Food Fight!!!

Actually both AVR & PIC use versions of the Harvard architecture.
2 quotes from Wikipedia:
"PIC is a family of modified Harvard architecture microcontrollers made by Microchip Technology"
"The AVR is a modified Harvard architecture 8-bit RISC single chip microcontroller which was developed by Atmel in 1996"

Microcontrollers use this approach because it maps well to software stored in flash memory. Big computers like the Raspberry Pi ( :)) use the von Neumann uniform-memory architecture developed at MIT.

The PIC32 has a harvard bus structure, but a single address space, which is an "interesting" hybrid. A lot of ARM processors do this as well. (some things are "easy" when you have 32bits of address space!) The 8 and 16 bit PICs have more traditional (and AVR-like) Harvard architectures.

I agree with this - but it will be far more effective if the Arduino community extends itself to include the PIC based products. That way Arduino users can directly choose products without also having to choose a separate community.

...R

That's like saying the Ford community would be more effective if it extended itself to include Toyota cars.

I couldn't disagree more with this analogy.

A much better analogy would be a driving school using Fords and Toyotas for tuition so that pupils get to experience both makes.

I'm all for competition between chip makers. I see no need for competition, confusion and antagonism between communities.

...R