View unanswered posts | View active topics It is currently Thu Apr 19, 2018 11:20 pm



Reply to topic  [ 40 posts ]  Go to page Previous  1, 2, 3
 A good CPU to start with? 
Author Message

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 900
I think a lot depends on how you like to work. If you're working in C, you care about compilers and libraries. If you're working in assembly language, you care about familiarity, or regularity, or simplicity, or some combination.

I've a vague idea that the 8051 is quite a scrappy instruction set. It might be efficient but would take a bit of practice to gain familiarity.

I personally found the ARM very straightforward to program in assembly language - coming from 6502 was handy because the addressing modes have some resemblance to what I was used to. I think there are many others who say the same. There are also those who don't like it - you'd need to have a go.


Sun Mar 04, 2018 9:10 am
Profile

Joined: Sun Jul 23, 2017 1:06 am
Posts: 69
BigEd wrote:
I think a lot depends on how you like to work. If you're working in C, you care about compilers and libraries. If you're working in assembly language, you care about familiarity, or regularity, or simplicity, or some combination.

The TOYF assembly-language is about 4x more difficult than the MSP430 assembly-language --- but also about 4x easier than than the MiniForth assembly-language.

I'm not trying to make the assembly-language programmer's life easy --- I'm trying to wring as much performance out of the processor as possible --- my latest design is about 2x more efficient than the last one posted on this forum, but somewhat more difficult to program.

BigEd wrote:
I've a vague idea that the 8051 is quite a scrappy instruction set. It might be efficient but would take a bit of practice to gain familiarity.

The 8051 is somewhat "scrappy" --- it is also not documented well (it wasn't in 1994, anyway), so I had difficulty learning it --- it is the most popular micro-controller of all time though, so it is worth learning.

The 80c320 has two DPTR registers whereas the 8032 (and 8051, etc.) had one DPTR. This helps a lot! For example, copying a block of data is more efficient.
The 80c320 executes an instruction in 4 clock cycles, whereas the 8032 needed 12 clock cycles, so the '320 is 3x faster. The '320 also runs at 33 Mhz. max, which is pretty fast (by 1994 standards).
In 1994 there was an 80c320 version with 2KB of RAM internal, plus the low-memory --- this was very inexpensive, assuming that it was adequate --- using external memory boosts the price a lot.

There is a version of the 80c320 that is designed to be secure. There is foil over the internal non-volatile memory that is supposed to prevent the chip from being dismantled and the non-volatile memory probed to obtain the machine-code. I don't know how well this works.

As an historical note, Testra used the 80c320 for their motion-control boards for the laser-etcher. This was not competitive in speed with the competitor's MC68000 system. This was primarily because the 80c320 has only an 8x8 multiply, but 16x16 was needed. The MiniForth (built on a Lattice isp1048 PLD) was designed to fix this problem. The MiniForth was both faster and less expensive than the M68000 system --- that was in 1995 --- now the MiniForth has been upgraded to an FPGA and is several times faster (the name has been changed to RACE).

I would expect my TOYF to be roughly comparable to the RACE --- maybe more efficient --- I'm not familiar with the RACE, but afaik it is pretty much the same design as the MiniForth (they still use my MFX for development).

Anyway --- getting back to the question of a good CPU to start with --- the 80c320 seems powerful enough to support interesting projects, but still fairly simple if you can get by with 2KB of RAM and have a single-chip board.
I would certainly go with the 80c320 rather than the 6803/6303 etc.. OTOH, the 6502 is just a lot of fun, and there is a huge nostalgia aspect --- the problem with the 6502 is that you necessarily have a multi-chip board which is complicated and expensive.


Tue Mar 06, 2018 2:55 am
Profile

Joined: Sun Jul 23, 2017 1:06 am
Posts: 69
Garth wrote:
Hugh Aguilar wrote:
Garth --- I know that you are a huge 6502 fan. It is somewhat under-powered by today's standards though. What modern processor would you recommend as being more powerful than the 6502 but still simple and easy to work with as an entry-level hardware project?

I definitely like the 65816 more than the '02, for a lot of reasons, including of course that its efficiency and ease of programming are far better than the 02's in applications where you're constantly handling 16-bit quantities. People get scared of it though, even if for invalid reasons; so my website focuses on getting people to see what can be done first with the '02, with frequent appetite-whetting nudges to consider the '816.

The 65c816 is a lot more powerful than the 65c02 for working with 16-bit data and/or programs that are large enough to need data-structures --- the '816 also can access up to 16MB of memory.

The reason why I like the Dallas 80c320 though, is that it has instructions for working with 1-bit data.

I have read that in the late 1980s there was a 6502 version that had instructions for working with 1-bit data. If such a thing is available today, and it has on-chip RAM and PIA so you don't need a complicated multi-chip board, then I would prefer that to the '320 --- the '320 lacks an indexed addressing-mode so it is pretty hard to program --- the 65c02 is much easier to program.

My 65ISR has instructions for working with 1-bit data (borrowed from the '320), and it has an indexed addressing-mode (borrowed from the 65c02) --- the 65ISR-abu can access up to 16MB of memory --- so it is intended to be the best of both worlds!


Sun Mar 11, 2018 3:01 am
Profile

Joined: Tue Dec 11, 2012 8:03 am
Posts: 240
Location: California
All the 65c02's being made today have the bit-manipulating and branch-on-bit instructions SMB, RMB, BBS, and BBR, but it's only for zero page, initially wanted by Rockwell for their microcontrollers with I/O in ZP. Nearly all of the large volume of 65's being made today are in dedicated-purpose microcontrollers, ASICs. There is the 65c134 65c02'based microcontroller available OTS from WDC, again with the bit instructions, but unfortunately its ROM is mask-programmed, so if you want your own ROM, it has to be outboard, and then you forfeit a lot of your I/O pins to interface to it.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources


Sun Mar 11, 2018 4:33 am
Profile WWW

Joined: Tue Dec 11, 2012 8:03 am
Posts: 240
Location: California
Something I have done many times is to put input bits that are of individual significance on bits 6 and 7 of ports, because the BIT instruction transfers these to the V and N flags for subsequent condition branching without having to AND-out the irrelevant bits, and put outputs on bit 0 of the ports, so that like for a clock line of a bit-banged synchronous-serial port, you can make it a 1 with INC <port> (assuming you already know that bit is a 0), or make it a 0 with DEC <port> (assuming you already knew it was a 1), without regard to what was in A, and without affecting it. If you want a pair of out-of-phase bits, you can do this with bits 0 and 1, and use INC and DEC to go between 01 and 10, again without affecting the rest of the byte.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources


Sun Mar 11, 2018 4:39 am
Profile WWW

Joined: Sun Jul 23, 2017 1:06 am
Posts: 69
Garth wrote:
Something I have done many times is to put input bits that are of individual significance on bits 6 and 7 of ports, because the BIT instruction transfers these to the V and N flags for subsequent condition branching without having to AND-out the irrelevant bits, and put outputs on bit 0 of the ports, so that like for a clock line of a bit-banged synchronous-serial port, you can make it a 1 with INC <port> (assuming you already know that bit is a 0), or make it a 0 with DEC <port> (assuming you already knew it was a 1), without regard to what was in A, and without affecting it. If you want a pair of out-of-phase bits, you can do this with bits 0 and 1, and use INC and DEC to go between 01 and 10, again without affecting the rest of the byte.

Those are pretty good techniques. :-)

The 65c02 has the (zp),Y addressing-mode --- this allows it to work with data-structures --- you can have as many pointers in use in zero-page as you need.
The 65c02 (and 6510) was used in personal computers in the 1980s --- I would still consider the 65c02 to be a good choice for small computers --- for example, a POS terminal.

I'm dubious of the 65c134 that you mentioned above that has 192 bytes of RAM and 4KB of ROM. You aren't going to use your (zp),Y addressing-mode at all --- a lot of the features of the 65c02 aren't going to be used.
For a tiny application that needs only 192 bytes of RAM, the PIC16 or ye olde 8051 seem like more appropriate choices.

The Dallas 80c320 has 2KB of RAM internal to the chip --- as I said though, the '320 is more difficult to program.
If there were a 65c02 version with at least 2KB of RAM internal to the chip, that would be pretty cool --- this could likely be accomplished with an FPGA using a 65c02 core, as FPGAs can have a lot of RAM internal to the chip.


Mon Mar 12, 2018 4:56 pm
Profile

Joined: Sun Jul 23, 2017 1:06 am
Posts: 69
Garth wrote:
As far as "today's standards" in performance, those are vast overkills for many projects likely to to be taken up by individuals. Graphics processing seems to be the major hog of processing power in PCs, tablets, smart phones, etc.; yet none of the dozen or so products I've brought to market using microcontrollers even had any use for a multiply instruction, and they were mostly dealing with 8-bit quantities and doing bit tests and bit-twiddling. They were very I/O-intensive, not really processing-intensive, and they had very little human interface.

These all used PIC16 microcontrollers, whose microprocessor is poor compared the '02, even performancewise, but especially in capabilities. (A 1KB array variable for example is not possible on a PIC16 microcontroller.) The newer PIC16F1 line added some kludges to try to remedy some of the PIC16 problems, and the PIC18 took it further; but it's still rather poor IMO.

However, the popularity we see with these shows that what some people may call "underpowered" is not a problem for many control applications. In spite of their lousy processor, I have used PIC16's because of their nice sets of onboard I/O modules, their timers, processor support, their availability in many variations from many distributors, low price, etc.. I have written a nice set of macros to hide the ugly programming details that are constantly needed, for example their backwards logic of "if such-and-such it true, then don't do this," or their mickeymouse table look-up method or jump table method; so I don't mind the programming so much anymore.

Here is the latest/greatest in the 8051 family: http://www.keil.com/dd/docs/datashts/da ... 89c420.pdf

I have used the PIC16. I agree that it is pretty prickly, although after you develop some macros it gets better.

I am more interested in the 8051 family because they can either be used in single-chip mode (similar to the PIC chips) or they can have external memory. So, you have a wider range of applications, but only have to learn one instruction set.

I didn't know the PIC chips had: "availability in many variations from many distributors." I thought they were only from MicroChip.
The 8051 family has been second-sourced by a lot of chip makers during its three decade history, and there are many variations available with different I/O configurations.

This thread asking for a "good CPU to start with" is unlikely to provide any useful information. How do we know where we should start if we don't specify where we want to end up? What is the goal? There is a lot of difference between Garth's favorite processor, the 65c816, and this DS89c420. That doesn't mean that one is better than the other though. There is some overlap in what they do, but they are really for different purposes --- and there are yet other ISAs that are also quite different from either of these --- my TOYF and 65ISR designs are both pretty far out; not similar to each other or to anything else.


Tue Mar 20, 2018 6:27 pm
Profile

Joined: Tue Dec 11, 2012 8:03 am
Posts: 240
Location: California
Hugh Aguilar wrote:
I didn't know the PIC chips had: "availability in many variations from many distributors." I thought they were only from MicroChip.

Yes, I think Microchip is the only manufacturer; but you can get their parts from lots of different distributors, "distributor" meaning for example Mouser, Digi-Key, Jameco, Allied, Arrow, Avnet, Future Electronics, etc..

Quote:
This thread asking for a "good CPU to start with" is unlikely to provide any useful information. How do we know where we should start if we don't specify where we want to end up? What is the goal?

I had to review where this topic started, to refresh my memory. We haven't heard from Koriban in almost four years, and there was a gap between posts of about two and a half years in the middle of the topic. I originally understood it to mean, "What's a good processor to start with to learn about building a computer and about programming in assembly language" (even if a higher-level language is used also).

Quote:
"There is a lot of difference between Garth's favorite processor, the 65c816,"

For me, what it has going for it is familiarity, and that there's more power there than meets the eye, and that I'm somewhat optimistic about its future. The familiarity point won't be true for everyone, only those already into the 65 family, mainly meaning people who have gotten a start in 6502 somewhere along the way. It does have appeal though in its having a relatively simple bus structure and programming model. It's not quite as simple as the 6502's, but it's a natural step up from the '02.

And rather than jumping around on different processor families or trying to get cozy with lots of processors, I think there's something to be said for focusing on one and getting really good at it, whether it's the 65 family or another family. For my interests, the 65's are well suited. If I were interested in certain other fields of computing, it might not be so well suited. I take the same "stick with one" approach to other parts in my work as well, for example op amps or switching regulator controller ICs, because through use, you learn important nuances that might not be obvious or clear in the data sheets. There are thousands of these on the market. Certainly one op amp or switching regulator controller IC can't be best the whole range of things you might want, nor can you be familiar with very many; but the required learning investment keeps me from jumping to a new one without good reason.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources


Wed Mar 21, 2018 7:30 am
Profile WWW

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 900
It's worth noting that Koriban had three or four specific CPUs in hand and wondered which was a good one to start with - that's not quite the request for a universal recommendation that it might seem from the title.


Wed Mar 21, 2018 8:46 am
Profile

Joined: Sun Jul 23, 2017 1:06 am
Posts: 69
Garth wrote:
Hugh Aguilar wrote:
"There is a lot of difference between Garth's favorite processor, the 65c816,"

For me, what it has going for it is familiarity, and that there's more power there than meets the eye, and that I'm somewhat optimistic about its future. The familiarity point won't be true for everyone, only those already into the 65 family, mainly meaning people who have gotten a start in 6502 somewhere along the way. It does have appeal though in its having a relatively simple bus structure and programming model. It's not quite as simple as the 6502's, but it's a natural step up from the '02.

The 65c816 was originally designed to be used in the Apple-IIgs computer, and that lasted for a while. Later on, the '816 was used in the Super Nintendo game computer (Mario and his dinosaur Yoshi), and that lasted for a while.

I still think the '816 would be a good choice for a small computer. An example would be a POS terminal. Another example would be a computer used in a factory for the employees to clock in and out, and to enter information regarding which jobs they are doing and how much time they spend on the jobs, etc.. Factories typically use a regular PC for this, which is a huge overkill in processing power, plus the PC is large physically, plus the PC is not shielded from dust very well. An '816 computer could work well at this --- the Dallas 89c420 that I mentioned would be a terrible choice because no high-level language (C or Forth) is a good fit.

OTOH, the '420 is faster than an '816 and a lot less complicated in regard to how many chips are on the board, so it seems like a better choice for a micro-controller.

The '420 has an 8x8 multiply --- 16x16 would be better for the PID algorithm --- afaik, the '816 doesn't have multiply at all.

What I was saying above, is that without specifying what the goal is, there is no way to argue for one processor or another as being the better choice.

Garth wrote:
And rather than jumping around on different processor families or trying to get cozy with lots of processors, I think there's something to be said for focusing on one and getting really good at it, whether it's the 65 family or another family. For my interests, the 65's are well suited. If I were interested in certain other fields of computing, it might not be so well suited. I take the same "stick with one" approach to other parts in my work as well, for example op amps or switching regulator controller ICs, because through use, you learn important nuances that might not be obvious or clear in the data sheets. There are thousands of these on the market. Certainly one op amp or switching regulator controller IC can't be best the whole range of things you might want, nor can you be familiar with very many; but the required learning investment keeps me from jumping to a new one without good reason.

I agree --- don't be a: "Jack of all processors and a master of none" --- find one that is reasonable, then get good at it.

I invented the TOYF because I wanted to be good at something. :)

I could pick an existing processor, such as the hugely popular ARM Cortex, but I doubt that I would ever distinguish myself at all. The bottom line is that I don't have a college degree, so I'm automatically disqualified from programming mainstream processors --- there will always be somebody with a college degree applying for the same job.

It does seem unlikely that anybody else will be interested in the TOYF --- I think it is a pretty efficient design --- it is not backed up by any major chip-maker though, so the TOYF is destined to be a VCIW (voice crying in the wilderness).

The 65c816 and eZ80 are VCIWs too --- a small computer such as I described above (POS terminal or factory data-entry terminal) is likely to be built on the ARM Cortex (the Raspberry Pi, Beagle Bone, etc.) --- there is not much call for 8-bit computers any more.


Wed Mar 21, 2018 5:39 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 40 posts ]  Go to page Previous  1, 2, 3

Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software