EmbeddedRelated.com
Forums
Memfault State of IoT Report

Question regarding PIC 18 series performance verses MSP430F149

Started by Obelix December 17, 2003
Question regarding PIC 18 series performance verses MSP430F149:

Currently I'm using a TI MSP430F149 running at 12Mhz (overclocked) in
a prototype.  For various reasons I'm considering using a PIC 18Fxxx,
but want to know before I bother porting the code/building hardware if
the PIC running at a 10MHz instruction clock will give me similar
performance to the MSP430 at 12Mhz.  Here are some details of my
application.

- Application mixed C and assembly source

- 2 A/D channels sample rate 25kHz

- only other I/O is a single output pin

- Software algorithm contains a Least Squares Fit on 8 A/D samples
(several 8x8 multiplies)

- Otherwise the software involves mainly counting samples and stepping
through simple state machines based on the data

-MSP430 at 12Mhz takes 38uSec to process both data channels  between
40uSec samples

The PIC A/D seems more than adequate and the 18 series part have the
hardware multiplier that I need.  My uncertainty is that although the
PIC has the Harvard Architecture and other features that allow all
instructions to be single cycle is it really more speed efficient than
a part like the MSP430 which has single cycle register to register
instructions, but variable clocks per instruction on RAM and
peripheral accesses depend on addressing mode etc.

My question has more to do with PIC performance in general rather than
a specific device comparison.
On 17 Dec 2003 07:33:08 -0800, the renowned gt5513e@hotmail.com
(Obelix) wrote:

>Question regarding PIC 18 series performance verses MSP430F149: > >Currently I'm using a TI MSP430F149 running at 12Mhz (overclocked) in >a prototype. For various reasons I'm considering using a PIC 18Fxxx, >but want to know before I bother porting the code/building hardware if >the PIC running at a 10MHz instruction clock will give me similar >performance to the MSP430 at 12Mhz. Here are some details of my >application. > >- Application mixed C and assembly source > >- 2 A/D channels sample rate 25kHz > >- only other I/O is a single output pin > >- Software algorithm contains a Least Squares Fit on 8 A/D samples >(several 8x8 multiplies) > >- Otherwise the software involves mainly counting samples and stepping >through simple state machines based on the data > >-MSP430 at 12Mhz takes 38uSec to process both data channels between >40uSec samples > >The PIC A/D seems more than adequate and the 18 series part have the >hardware multiplier that I need.
You do know the PIC has an effite 8 x 8 hardware multiplier compared to the manly 16 x 16 multipler on (many of) the MSP430s? If that's all you need, fine.
> My uncertainty is that although the >PIC has the Harvard Architecture and other features that allow all >instructions to be single cycle is it really more speed efficient than >a part like the MSP430 which has single cycle register to register >instructions, but variable clocks per instruction on RAM and >peripheral accesses depend on addressing mode etc. > >My question has more to do with PIC performance in general rather than >a specific device comparison.
I have not compared the two in an organized way, but I suspect a 40MHz 18Fxxx PIC will run maybe 1/3 slower than a 12MHz MSP430, depending on the exact instructions. Much slower than that if you're doing 16 bit or better math. On some floating point comparisons I made, the MSP430 was much faster even at a kosher 8MHz (supposedly 25MHz is coming RSN). But, for your particular application, you've only got to write a few hundred instructions and simulate to find out.. suggest you do that. Best regards, Spehro Pefhany -- "it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com
In comp.arch.embedded Obelix <gt5513e@hotmail.com> wrote:
> The PIC A/D seems more than adequate and the 18 series part have the > hardware multiplier that I need. My uncertainty is that although the > PIC has the Harvard Architecture and other features that allow all > instructions to be single cycle is it really more speed efficient than > a part like the MSP430 which has single cycle register to register > instructions, but variable clocks per instruction on RAM and > peripheral accesses depend on addressing mode etc.
Many instructions on the PIC18 are not single-cycle. We found that a 40MHz PIC18 (i.e. 10MHz instruction cycle) typically operated at about 7 MIPS (PIC18 MIPS, so about the same as most 8/16-bit baby micros) over typical mixes of compiler-generated code. pete -- pete@fenelon.com "There's no room for enigmas in built-up areas."
In comp.arch.embedded Spehro Pefhany <speffSNIP@interlogdotyou.knowwhat> wrote:
> I have not compared the two in an organized way, but I suspect a 40MHz > 18Fxxx PIC will run maybe 1/3 slower than a 12MHz MSP430, depending on > the exact instructions. Much slower than that if you're doing 16 bit
I'd certainly say this is ballpark right, possibly even over-estimating the PIC18's horsepower - I think it would be slightly than your guess. I'd estimate that a 40 MHz PIC would be something like 58% of the processing power of a 12MHz MSP430. (My rough calculation starts from the assumption that a 48/12MHz PIC18 running capable of running everything single-cycle, if such a device existed, would be "roughly equivalent" to a 12 MHz MSP430; so scale by a factor of 5/6 for clock speeds, and then scale by a factor of about 0.7 for the two-cycle instructions on the PIC which seem to reduce a 10MHz device to about 7 MIPS - we've measured this on a few mixes!) pete -- pete@fenelon.com "There's no room for enigmas in built-up areas."
Obelix wrote:
> Question regarding PIC 18 series performance verses MSP430F149: >
I've used both and they're both nicely fast. But the F149 is faster because it's really a 16 bit processor, while the PIC18 is really an 8 bit processor. Obviously this affects arithmetic, but also "normal" code such as pointer work. And of course the F149 has a more -uh- conducive memory model. Take a look at the instruction sets. -- Mike Page BEng(Hons) MIEE www.eclectic-web.co.uk
In comp.arch.embedded Mike Page <mike@scrubeclectic-capsweb.blameco.swenuk> wrote:
> Obelix wrote: >> Question regarding PIC 18 series performance verses MSP430F149: >> > > I've used both and they're both nicely fast. But the F149 is faster > because it's really a 16 bit processor, while the PIC18 is really an 8 > bit processor. Obviously this affects arithmetic, but also "normal" code > such as pointer work. And of course the F149 has a more -uh- conducive > memory model. Take a look at the instruction sets.
It's also worth pointing out that code quality on PIC18 compilers varies very widely. Microchip's own compiler started off appalling and has improved a bit. IAR's compiler started off appalling and has become fairly tolerable. ;P Don't expect to be able to port code that expects a single unified memory space to the PIC easily though (e.g. code that jumps along pointer chains through ROM and RAM). IAR offer a generic tagged pointer type that can address both code and data space (and a Godsend it is sometimes) but using it is expensive. You quite simply can't do that with the Microchip compiler. pete -- pete@fenelon.com "There's no room for enigmas in built-up areas."
Obelix wrote:
> Question regarding PIC 18 series performance verses MSP430F149: > > Currently I'm using a TI MSP430F149 running at 12Mhz (overclocked) in > a prototype. For various reasons I'm considering using a PIC 18Fxxx, > but want to know before I bother porting the code/building hardware if > the PIC running at a 10MHz instruction clock will give me similar > performance to the MSP430 at 12Mhz. Here are some details of my > application.[edit]
Since it is very unwise to overclock a CPU in anything intended to become a product, perhaps a 16MHz mega-AVR might be worth considering in addition to the PIC. Besides the faster clock than PIC, the AVR can make much tighter assembly and especially C code than the PIC (though I must admit I haven't worked with PIC18, only PIC16). I've been wading through a lot of AVR-GCC (free AVR C compiler) listings lately, and I've actually learned some more efficient assembly techniques from the compiler than I knew how to do by hand. It's really quite good. Good day! -- _____________________ Christopher R. Carlen crobc@earthlink.net Suse 8.1 Linux 2.4.19
Obelix wrote:
> Question regarding PIC 18 series performance verses MSP430F149: > > Currently I'm using a TI MSP430F149 running at 12Mhz (overclocked) in > a prototype. For various reasons I'm considering using a PIC 18Fxxx, > but want to know before I bother porting the code/building hardware if > the PIC running at a 10MHz instruction clock will give me similar > performance to the MSP430 at 12Mhz. Here are some details of my > application.
<snip> The MSP is being overclocked at 12MHz, presumably to get the 38us < 40us :) If your MSP430 is running 8 bit data variables, then they are not going to be hugely different. Grab the PIC18 tools, port the code, and check it ? You could also consider something like the C8051F120, which is 100MHz, and has a 16x16 2 clock mul/Acc - that WILL be a step up in speed. -jg
Chris Carlen wrote:
>
... snip ...
> > Since it is very unwise to overclock a CPU in anything intended > to become a product,
We used to do the equivalent with semiconductors. However, the devices were marked "SAT", meaning "selected at test". Whatever characteristic that was needed and exceeded manufacturers ratings was culled from the parts bin before installation. This sometimes allows you to build cutting edge instrumentation. -- Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net> USE worldnet address!
Although most responses I've seen favour the MSP, one thing they have 
all missed is the gains you can make by hand coding any maths in 
assembler. Most C compilers steal your valuable registers from you. On 
the MSP registers are the key to high performance. Almost any direct 
register operation can be done in a single cycle. Where maths routines 
are concerned, except for the very occasional jump, at 2 cycles, the MSP 
executes 1 instruction per cycle using registers, and the constant 
generators. You need to understand firts how many instructions are 
interpreted, anything using a value that can be assigned to a constant 
generator (eg BIS #1,foo)
uses the CG register as the source. If foo is also a register it 
effectively becomes a register/register operation.

Al

Obelix wrote:

> Question regarding PIC 18 series performance verses MSP430F149: > > Currently I'm using a TI MSP430F149 running at 12Mhz (overclocked) in > a prototype. For various reasons I'm considering using a PIC 18Fxxx, > but want to know before I bother porting the code/building hardware if > the PIC running at a 10MHz instruction clock will give me similar > performance to the MSP430 at 12Mhz. Here are some details of my > application. > > - Application mixed C and assembly source > > - 2 A/D channels sample rate 25kHz > > - only other I/O is a single output pin > > - Software algorithm contains a Least Squares Fit on 8 A/D samples > (several 8x8 multiplies) > > - Otherwise the software involves mainly counting samples and stepping > through simple state machines based on the data > > -MSP430 at 12Mhz takes 38uSec to process both data channels between > 40uSec samples > > The PIC A/D seems more than adequate and the 18 series part have the > hardware multiplier that I need. My uncertainty is that although the > PIC has the Harvard Architecture and other features that allow all > instructions to be single cycle is it really more speed efficient than > a part like the MSP430 which has single cycle register to register > instructions, but variable clocks per instruction on RAM and > peripheral accesses depend on addressing mode etc. > > My question has more to do with PIC performance in general rather than > a specific device comparison.
-- Please remove capitalised letters to reply My apologies for the inconvenience Blame it on the morons that spam the net

Memfault State of IoT Report