Re: microcontroller programming -- how to begin



Rich Grise wrote:
On Fri, 02 Jun 2006 20:17:52 +0200, David wrote:

Ken Smith wrote:
In article <447f2e71$1@xxxxxxxxxxxxxxx>, David <david@xxxxxxxxx> wrote:
Ken Smith wrote:
[....]
It's true that the AVR, like the PIC and the 8051, are Harvard, while the x86 is von Neumann. But that's only one aspect of the architecture - in many other ways, they are completely different.
Ok lets discuss those differences.

And since you are happy count the PIC and AVR as similar because they both have registers
Yes, they both use the concept of the register. ie: a very special memory location that can be used in ALU operations. There have been a few attempts at processors where there are no "registers" in that all operations took data from RAM and put the result into RAM. IIRC: The Intel 432 was an example of this.

or because they both execute instructions sequentially,
I was thinking of a bit slice design that did not have this property when I wrote that. In some "very long instruction word" designs, the address of the next instruction in encoded in each instruction. These machines are light years different from things like PICs or x86s.

There are certainly processor architectures that use significantly different architectures, making the PIC and AVR seem similar in comparison. I have read of several processor designs (some only theoretical, others made in practice) that use two, three or four stacks instead of having any data registers. But I think it's reasonable to divide architectures in groups according to the number of general purpose registers. RISC architectures like the MIPs, PPC and AVR, along with hybrids like the MSP430 and the 68k have multiple orthogonal registers. Accumulator-based designs like the PIC or the COP8 have a single main register. A third group has several specialised registers, like the x86 and the Z80. And a forth group has no registers at all, like the MARC4.

I guess how "different" two architectures are depends on what you see as important in the design, and is always a subjective measure. But I think most people who have looked at the ISAs for the PIC, the 8051 and the AVR will see each as very significantly different, with the 8-bit width of the ALU being about the only common factor.

I got nostalgic for the 6502; it's a very neat processor for little stuff;
it's got like 256 general purpose registers called "page 0" which live in
RAM, right next to the 256-byte stack. So, I went looking, and there's
VHDL and Verilog cores for it all over the place! (I made a keyboard
interface with one once. :-) )

Cheers!
Rich


Page 0 on the 6502 is not a set of registers - it is a page of memory which can be accessed with shorter (and therefore faster) addressing modes than the rest of the memory. The 6502 has one general purpose register (the accumulator A), two index registers (X and Y), and a stack pointer, status register and program counter.

But I agree it's a very neat processor - it helped make the BBC one of the fastest and most advanced home micros available in its day. The BBC was significantly faster than the spectrum, even though the 6502 on the BBC ran at 2 MHz (IIRC) on the first systems, and is pure 8-bit, while the Z80A powering the spectrum ran at 3.5 MHZ (again, IIRC) and can do a fair amount of 16-bit arithmetic directly. Part of this was the 6502 (it used fewer clock cycles per instruction than most contemporary processors, and had a pipelined instruction decoder), and part of it was the genius of the Acorn engineers (the same bunch that gave us the ARM). If you want to see some impressive coding, look for a listing of the BBC's MOS rom - to save space, the various tables frequently overlapped with each other and with executable code!

One of my first real assembly programs was for the 6502 - it was a disassembler, running on the BBC micro (actually it was partly assembly, partly Basic).
.



Relevant Pages

  • Re: microcontroller programming -- how to begin
    ... they both have registers ... memory location that can be used in ALU operations. ... address of the next instruction in encoded in each instruction. ... There are certainly processor architectures that use significantly ...
    (sci.electronics.design)
  • Re: microcontroller programming -- how to begin
    ... happy count the PIC and AVR as similar because they both have registers ... In some "very long instruction word" designs, ... There are certainly processor architectures that use significantly ... like the x86 and the Z80. ...
    (sci.electronics.design)
  • Re: Pros and Cons of GNU toolchain
    ... GCC may not be easily portable to some micro-controller ... It deals pretty well with CISC architectures like the IA32, ... lots of similar registers. ...
    (comp.arch.embedded)
  • Re: microcontroller programming -- how to begin
    ... There have been a few attempts at processors where there are no "registers" in that all operations took data from RAM and put the result into RAM. ... There are certainly processor architectures that use significantly different architectures, making the PIC and AVR seem similar in comparison. ... I have read of several processor designs that use two, three or four stacks instead of having any data registers. ... A third group has several specialised registers, like the x86 and the Z80. ...
    (sci.electronics.design)
  • Re: High-bandwidth computing interest group
    ... few dedicated registers? ... There are GPUs with 256-1024 SP FPUs on them. ... 32b SP in a given operation, in parallel in one instruction. ... pipelining, e.g. spreading an 8 element vector over 2 cycles. ...
    (comp.arch)