CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Slightly OT: PIC vs ARM
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

Slightly OT: PIC vs ARM
PostPosted: Tue Feb 03, 2015 2:18 pm     Reply with quote

Hey PIC Veterans,

I've been playing with an ARM M0 from STmicro and it's kinda funny how everyone is running to 32bit for the simplest of tasks.

but when I look at the machine code, all those extra instructions to do byte-sized or word-sized work that don't exist even for 16bit PICs (I didn't compare to PIC32 -- since I know it's kinda messy like ARM)..

But the inefficiency of the instruction sets for ARM vs. PIC 8/16bit.

Kinda interesting to observe.

Anyone else jump into these other venues recently for a PIC Comparison?

-Ben

p.s. I'm so unhappy with XC8. OMG that's another thread entirely.
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Ttelmah



Joined: 11 Mar 2010
Posts: 19454

View user's profile Send private message

PostPosted: Tue Feb 03, 2015 3:40 pm     Reply with quote

In terms of sheer chip quantity the small processors still win. When you are putting together things like a smart card that is supplied in 6digit numbers you don't want the power use/cost of anything bigger.

However it is sad that Microchip haven't produced a really 'enhanced' mid end PIC family. Kept the same basic architecture, but with all the peripherals re-mappable (some are getting close on this), and then had single cycle save of all the main registers (this was on the Z-80, something like 30 years ago - a swap instruction that switched between two register sets). Suddenly for the cost of a very few bytes of RAM, you have tiny interrupt latency. Add a hardware divide, and you'd have a single chip that could be used to replace just about all the existing PIC18's, and some of the PIC24's etc., without having to have the 'plethora' of models, which perhaps tends to put people off the PIC.
The 'PIC-18X', would be a dream for so many things.....
jeremiah



Joined: 20 Jul 2010
Posts: 1340

View user's profile Send private message

PostPosted: Tue Feb 03, 2015 7:03 pm     Reply with quote

Unless I am misunderstanding yall, the PIC24 family has some of that:
1. Byte, word, and double modes for some instructions (not all, but MOV off the top of my head has this option).
2. Remappable pins (at least on the main family lines I have used)
3. PUSH.S, POP.S for single instruction context save
4. Hardware divide (and multiply)

Am I misunderstanding?
ELCouz



Joined: 18 Jul 2007
Posts: 427
Location: Montreal,Quebec

View user's profile Send private message

PostPosted: Wed Feb 04, 2015 6:12 pm     Reply with quote

jeremiah wrote:

4. Hardware divide (and multiply)

Am I misunderstanding?


I can confirm that the PIC24 have Arithmetic Logic Unit (ALU)...

Multiply/Dividing/Multi Bit shifting all done in hardware Very Happy


I think the perfect PIC18 is a PIC24 in DIP/PDIP that support 5V completely would be the best thing happening to the hobbyist community!
_________________
Regards,
Laurent

-----------
Here's my first visual theme for the CCS C Compiler. Enjoy!
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Thu Feb 05, 2015 3:13 am     Reply with quote

ELCouz wrote:

I think the perfect PIC18 is a PIC24 in DIP/PDIP that support 5V completely would be the best thing happening to the hobbyist community!


As a professional, I've not used any through-hole ICs in the last ten years, and have no wish to ever again. For my work, the QFP packages are generally most suitable, because they offer reasonably good density (bang per mm2 of board space), acceptable track layout and can be built using manual production techniques if required. We have been using more and more (leadless) QFNs but these offer some "challenges" to manual assembly, especially getting the under chip pad soldered correctly - fine in reflow, not so fine manually.

I've not yet bitten the bullet and gone for BGAs. Luckily, there are relatively few PICs, and no 16/18s that I can think of, that offer that package option.

ARMs however are often a different kettle of fish. On the whole ARMs are placed at higher price/performance/capability than PICs. They have more RAM, more bits, and more pins. All the ARMs I've used were BGA and were all built using pick & place and reflow. There are now more lower end ARMs that have moved price/performance-wise into PIC territory. But so far in my current employment I've not had any application that would necessitate a move up to ARMs (though the threat if having to deal with colour touch screens and plug-in software technology would have done it had it materialised) There would be quite a lot of costs associated with such a move. We'd have to buy and maintain the toolset for a start, and there could well be the BGA issue, not to mention the step-up in complexity that necessitated it in the first place.

Personally I like ARMs. They have the power and ease of use to do anything I want them to. They have had the wherewithal to cope with anything I've thrown at them - tons of memory in linear addressing space in particular - none of the Harvard limitations and issues - with fast, capable CPUs. I like PICs too, but they are much more like old-fashioned computers, with limitations and issues to be got round, than "modern" processors. On balance, if I had a free choice, and didn't have to foot the bill, I'd choose to work exclusively with ARMs, and not faff around with PICs. But then I don't have a free choice: in my day job I inherited the use of PICs and I'm fairly stuck with them, and actually they aren't all that bad :-)

While I used to be an avid electronics hobbyist, but right from the early days of micros I found them very limited and much preferred working with "real" computers :-). I've never played with PICs, only worked with them professionally. These days I really don't like having busmen's holidays. In my free time I prefer to sing, take photos, do historical reenactment and, well, anything other than electronics and computers.
Ttelmah



Joined: 11 Mar 2010
Posts: 19454

View user's profile Send private message

PostPosted: Thu Feb 05, 2015 5:08 am     Reply with quote

Some of the PIC24's are moving that way, but there are major shortfalls.

First, push, and pop don't help much with the register saving. They only save _one_ register at a time. Want to save twenty registers, and it is twenty push's, and twenty pop's to get them back. The PIC24, takes as long as a PIC16 or 18, to get into or out of the interrupt handler. The point about quite few older processors, was they had single cycle operations, that saved all the critical registers, either by moving a memory pointer, to relocate the working registers, or by having ghost copies of the registers, and switching. Really fast responses to interrupts are critical for an embedded processors and it is an area where the PIC does increasingly badly. Increasingly, because each chip generation has more and more registers....

For ElCouz, I have to say 3.3v, is honestly easier than 5v now.

The PIC18's only have 8*8 hardware multiply. The multiplication/division on the PIC24's, not that much better. Really slow by modern standards.

Yes, the family has some parts of this, but I find myself wanting to have a single slightly 'upmarket' PIC, without having to choose from a hundred models, so I can have a smaller part bin. Imagine something in the PIC24 family, with the pin layout/peripherals of the 18FxxK22, an improved ALU, and a single instruction response to interrupts at a couple of priority levels, and all the peripherals re-mappable.

I'm a great believer in using more powerful chips for more complex tasks (ranging from Arduino's through embedded PC's), but love the PIC for simpler tasks, but want something that just fills the gap a little more above the current models.
jeremiah



Joined: 20 Jul 2010
Posts: 1340

View user's profile Send private message

PostPosted: Thu Feb 05, 2015 11:32 am     Reply with quote

I've really enjoyed using the PIC24 family, specifically variants of the PIC24FJ64GA004.

1. Single Instruction multiply
2. Majority of the pins and peripherals are remappable, which makes it very flexible.
3. Single Instruction context save for interrupts using the Shadow Register hardware. Makes interrupts faster, which I like.
4. Decent RAM (8+k) and ROM
5. Multiple interrupt levels
6. Low power variants (10s of nA in sleep mode)
7. Small package options

I've been working with them for over 7 years now and aside from the occasional errata issue, I have really enjoyed them. I'm still looking for an ARM that is 16bit bit or higher with good low power options and size all at the same time. I would like to branch out some.
guy



Joined: 21 Oct 2005
Posts: 297

View user's profile Send private message Visit poster's website

PostPosted: Thu Feb 05, 2015 1:58 pm     Reply with quote

I never worked with anything other than PICs so I am amazed over and over again at what they squeeze into those tiny parts at a ridiculous price (for example take a look at the peripherals on the PIC16F1704 at $0.67 ! There's a whole PCB full of parts inside). I also enjoy the DIP packages for those early prototyping stages. As a freelance you pay for your design mistakes Embarassed

Recently I did a project with the PIC24. Again I was dazzled - user-friendly DMA, high MIPS, plenty of resources but at the end of the day, also due to CCS compiler's bugs I didn't quite enjoy working with it.
Another downside was that there is no mentioning of protection diodes for the pins (to VSS and VDD). This adds A LOT of parts to the BOM + placement costs. I think they forgot about the concept of a microCONTROLLER rather than a uProcessor.

Altogether I'm very happy with the combination of PICs + CCS and option of [rarely] inserting a few lines of assembly in the code. Can't seem to let go of MPLAB Wink
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Feb 06, 2015 10:02 am     Reply with quote

guy wrote:
also due to CCS compiler's bugs I didn't quite enjoy working with it.



Wait until you use XC8/16 where the "optimization" you pay for in the PRO version is really the compiler you should get while the free compiler has lots of trash instructions thrown in to make it crappy and suck up space.

So now -- the paradigm is that the developers have to worry about when to insert and remove trash instructions -- and when they MISS one, they end up screwing up your code with compiler bugs that they can't seem to fix (I know, I sent DETAILED ASM pointing to the offending instruction only to have support give me dumb looks through email).

And if they HAVE fixed it - their response is to upgrade to the latest version, which, if you're not on support - your stuck.

A little different from CCS whereas if you find a bug that's a real stopper, they give you a free update that fixes that bug. Microchip -- no such luck.

And I found about 5-6 such bugs strewn throughout various versions of XC8 between PRO and Free versions.

So even though the compiler is "ok" -- (even CCS runs into bugs too) -- Microchip's handling is "all about the money" now because they don't own XC8 -- it's pretty much licensed Hi-Tech C. (IIRC)
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
guy



Joined: 21 Oct 2005
Posts: 297

View user's profile Send private message Visit poster's website

PostPosted: Fri Feb 06, 2015 10:55 am     Reply with quote

Microchip doesn't know know software... Never did.
A friend had saved my life by recommending CCS. Other compilers have registers and addresses #DEFINEd in the code which makes the code non-migrateable - out of the question.
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Feb 06, 2015 11:06 am     Reply with quote

Their compiler would be ok if it just WORKED...

I get it that bugs happen.

but their model of designing in a "crappy compiler mode" which now distracts from just focusing on writing the best compiler they can coupled with their new pay-to-get-stuffed licensing model...

And their incompetent tech support.

Ugh.

Microchip should just hire the Gurus here (if they didn't already have full time jobs, I'm sure.)

Sorry - I didn't mean to turn this into a Microchip rant.
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
ELCouz



Joined: 18 Jul 2007
Posts: 427
Location: Montreal,Quebec

View user's profile Send private message

PostPosted: Fri Feb 06, 2015 11:21 am     Reply with quote

I just wished that the microchip supported open source compiler such as GCC from the beginning like Atmel.... we would have PICduino instead of arduinos now...

I completed the 2015 CCS survey....

I asked for PIC32 (Good thing to do if they want to survive in long term)
And more drivers (less time we spent doing drivers is better for us)


PS: I know the PIC32 is a very different beast but they should support it ... the minimum at least so they could continue to compete with Microchip XC32 compiler...
_________________
Regards,
Laurent

-----------
Here's my first visual theme for the CCS C Compiler. Enjoy!
ELCouz



Joined: 18 Jul 2007
Posts: 427
Location: Montreal,Quebec

View user's profile Send private message

PostPosted: Sun Feb 08, 2015 5:36 pm     Reply with quote

I wonder if the effort is so great and worth it to switch to the PIC32 family than learn any other better ARM platform?

If I understand at this point PIC32 is no more a microcontroller (more like a processor)

Do anyone here tried the PIC32 platform since it's launch in 2007?
_________________
Regards,
Laurent

-----------
Here's my first visual theme for the CCS C Compiler. Enjoy!
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sun Feb 08, 2015 9:50 pm     Reply with quote

I've done a couple designs for customers based on the PIC32 with built-in ethernet.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
ELCouz



Joined: 18 Jul 2007
Posts: 427
Location: Montreal,Quebec

View user's profile Send private message

PostPosted: Mon Feb 09, 2015 4:36 am     Reply with quote

bkamen wrote:
I've done a couple designs for customers based on the PIC32 with built-in ethernet.

-Ben


How hard is the transition from 8-bit to 32-bit platform?

I know we can only compare to MPLAB (because CCS don't offer any PIC32 support yet)...
_________________
Regards,
Laurent

-----------
Here's my first visual theme for the CCS C Compiler. Enjoy!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group