microcontroller programming -- how to begin

You're right. But my objection to the AVR still stands: it has split memory area's (harvard). If you are into getting work done fast for small quantities of products, you'll run into to trouble sooner or later because that nifty routine you wrote won't work on the other processor meanwhile the clock goes tick-tack-tick-tack....

--
Reply to nico@nctdevpuntnl (punt=.)
Bedrijven en winkels vindt U op www.adresboekje.nl
Reply to
Nico Coesel
Loading thread data ...

That certainly applies to some programs - one of the most popular terminal emulator programs on Windows is Tera Term Pro, which has not been updated since 1999. It does the job it was meant to do, and does it well.

An assembler also has little need for updating, but a compiler can always be improved. Whether it is worth doing or not is a different matter, of course, but no compiler ever generates truly optimal code, and can therefore be improved. It can also be extended to support newer language features. Finally, there is the library that comes with most toolchains, which can be further developed.

One of the nice things with gcc is that if you don't want to use the latest and greatest versions, you can always get hold of old versions, and use whichever version you prefer, on whatever platform you want.

Reply to
David

[....]

They certainly have not been

That's no big deal. I develop the microcontroller code in assembly.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

Its only a difference of quantity, not a difference in concept.

No, the 486 is not Harvard.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

Have you checked into what they do. They may just go with an "always safe" method of keeping the variables alive until the routine exits.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

Actually I haven't.

I don't worry too much about it. It works well and is very economical with the

128 or 256 bytes available.

Graham

Reply to
Pooh Bear

I had thought you were joking when you said the PIC is close to the AVR. Were you actually being serious ?

Reply to
David

damn

Don't be so sure about the MCS48. Every AT/ATX and PS/2 keyboard has a MCS48 controller inside. Same goes for the controller on the motherboard. This means that every PC set ever sold with an AT/ATX or a PS/2 keyboard has 2 MCS48 controllers in it. I suppose this must have made Intel filthy rich by now from royalties.

--
Reply to nico@nctdevpuntnl (punt=.)
Bedrijven en winkels vindt U op www.adresboekje.nl
Reply to
Nico Coesel

Ken Smith schrieb:

I don't say that everything has been abandoned, I know there are free tools for 8051 development that work and are still maintained (like SDCC).

Many people don't want to use pure assembly. Anyway, you wrote there was _less_ stuff available for AVR than for 8051. Can you give any example of something you miss for AVR? I know 5 assemblers, 2 C compilers, 2 simulators, an IDE with simulator/debugger for assembler and C, an ADA compiler, a Java VM (!), various Forth interpreters... I didn't count shareware or limited demo versions.

Reply to
Andreas Schwarz

Hello Nico,

I don't know whether the level of royalties is really so high. The pain threshold to redesign something produced in these quantities is rather low. A few pennies can trigger that.

--
Regards, Joerg

http://www.analogconsultants.com
Reply to
Joerg
[....]

I didn't write the initial statement that the PIC was close to AVR.

I have defended that statement, however, by pointing out that the AVR like the PIC and the 8051, it is also a Harvard machine. This sets it apart from processors like the X86 and 1802.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

Sorry for confusing who said what.

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. And since you are happy count the PIC and AVR as similar because they both have registers (the fact that the PIC has a single register and the AVR has 32 being apparently a mere minor detail), or because they both execute instructions sequentially, then I'd say the AVR and the 486 are similar because they are processor architectures as distinct from Victorian building architecture.

It could be interesting to discus comparative microcontroller architectures, but only if we are going to leave out mindless things like "each instruction does not encode the address of the next instruction to be done" (we are not talking about Turing machines), and consider fundamental differences like the size of the register set to be relevant.

Reply to
David

How many PC's have been manufactured during the last 25 years? I suppose tens of billions. Even if Intel receives 1 cent per unit, they've made nearly a billion US dollar from the MCS48 architecture.

--
Reply to nico@nctdevpuntnl (punt=.)
Bedrijven en winkels vindt U op www.adresboekje.nl
Reply to
Nico Coesel

It might be billions of dollars, but I'd be willing to bet that relatively few keyboards or motherboards made in at least the past 5 years use an actual MCS48 (in either core form or physical IC form... if you can even still buy those!). Once a USB interface and lots of extra keys became popular, I imagine that plenty of people just re-coded their keyboard controllers from scratch on a more modern CPU.

Reply to
Joel Kolstad

Hello Nico,

But that would mean every adult, kid and infant has bought several PCs over that time...

Anyway, even if it was a billion Dollars, over 25 years that isn't a lot of money for a company of that size.

--
Regards, Joerg

http://www.analogconsultants.com
Reply to
Joerg

An i8048 holds a whopping 2k of object code. BFD. Mind you that's probably worth 20K on a more modern micro when programmed in a HLL.

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
Reply to
Spehro Pefhany
[....]

Ok lets discuss those differences.

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.

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.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

Say it's one and a quarter billion? ;-)

formatting link

Why would Intel make a nickel anymore? Surely any patents covering the 8048 have run out. I highly doubt that keyboards contain an actual 8048 anymore. It would seem this function would have been swept into an ASIC long ago.

--
  Keith
Reply to
krw

Yeah, or application-specific microcontrollers, perhaps in COB mask-programmed form. I don't think the 8048 was designed with USB in mind either. ;-) Intel never made a CMOS version (though OKI did). Really, this sort of application is one that anyone competent should be able to code up in short order on any appropriate micro. The MCS48 has a particularly nasty memory segmentation that makes the 8051 look pretty good.

formatting link
formatting link
formatting link

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
Reply to
Spehro Pefhany

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.

Reply to
David

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.