Nigel Goodwin said:
Or it can take less, depending what the task actually is?.
Your background (Z80 and 8086) is probably more biased towards AVR code than the PIC?, the VERY CISC instruction sets of the Z80 and 8086 are more like the AVR than the PIC.
I came from a 6502 background (and a little 68000), and it's fairly easy from 6502 to PIC.
Bear in mind, one HUGE difference is the PIC's Harvard architecture, which does make it quite different from almost any other processor - but, in some ways, is an advantage?.
If by Harvard Architecture you mean separation of the program and data memory then there is no difference between the PIC and AVR, they are both Harvard processors. However the other 40 pin beasties including the 64 pin 68k (oooo I love those ceramic 64pin dips
) are not. Separation of data and program memory should allow a perfomance increase. The AVR executes nearly everything except conditional branches, literals and hardware multiplies in one clock cycle (others generally take 2), The PIC (like the Z80) seems to need at least 4 cycles to do anything.
I will admit that my approach to coding is influenced by the other processors and I prefer the flexabilty afforded by the AVR architecture, just my personal choice
. I like being able to do anything to any register with any other register(sounds very orthogonal and RISC like doesn't it
- except R0-R15 won't do it with any old literal that comes in from the program space, R16-R31 are more promiscous in this regard
) as well as having the freedom of otherwise RISC style addressing modes. The AVR architecture was developed by two Norwegian sudents (Alf and Vegard from memory) and AVR allegedly stands for "Alf and Vegard's RISC processor".
I'm sure the study that concluded most CISC addressing modes aren't used is because they were looking at output generated by compilers that weren't designed to take advantage of them.
This is all well and good, design a processor to suit the compiler, save several tens of thousands of transistors as well as several thousand manhours and some tenths of grams of silicon.
My advice for the novice is to just chose a microcontoller and start some where. Once you have built up some experience you can try something else. I've written for half a dozen diffferent cores and whilst there are differences between them, there are also a lot of concepts that remain unchanged. Not everything you learn will be portable but a great proportion of it will be. Don't expect to see many 5 or 6 letter nemonics for instructions in other processors though...
In time you will develop your own tastes and who knows you may decide pics and avrs are pooh and go off with ST7's ARM's or the next as yet unreleased product.
N.