Pages: [1] 2   Go Down
Author Topic: PIC uC  (Read 2127 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:



http://www.gammon.com.au/forum/?id=11109

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



Or this:



http://www.gammon.com.au/forum/?id=11637

Can't get much simpler than that.
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2650
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

UK
Offline Offline
Tesla Member
***
Karma: 104
Posts: 6360
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

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

Quote
A PIC 18F2550 0r 4550 has direct usb
You could get a "USB BitWhacker" https://www.sparkfun.com/products/762
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.  :-)

There is also http://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.)
Logged

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

Quote
"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.
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2650
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2650
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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
Logged

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

Quote
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.)
Logged

UK
Offline Offline
Tesla Member
***
Karma: 104
Posts: 6360
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello Jeff,

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
Logged

Wahiawa, Hawaii
Offline Offline
God Member
*****
Karma: 29
Posts: 583
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There is also the Chipino which is in an Aruidno Uno form factor.
https://www.tindie.com/products/elproducts/chipino-module/

Logged

0
Offline Offline
Sr. Member
****
Karma: 8
Posts: 394
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Quote
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.

Quote
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)

Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2650
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
Logged

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 42
Posts: 1176
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  smiley-razz
Logged

Pages: [1] 2   Go Up
Jump to: