Author Topic: 6502 Cpu wanted  (Read 7150 times)

0 Members and 1 Guest are viewing this topic.

Offline Chopsticks

  • Regular Contributor
  • *
  • Posts: 64
  • Country: au
6502 Cpu wanted
« on: February 14, 2017, 04:41:40 pm »
hi everyone,

Im studying engineering at uni and while I've been learning to code on MCU's I've developed quite an interest in older 8-bit computers. however I can't seem to find any local (aus) suppliers of 6502 cpu's and related peripheral chips. i usually do a lot of my shopping through element14 but they don't stock these parts so i was wondering if anyone knew of a supplier that sells theses at a fair price or perhaps if anyone had any old chips laying around that they would part with?
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 1950
  • Country: de
    • Frank Buss
Re: 6502 Cpu wanted
« Reply #1 on: February 14, 2017, 05:36:32 pm »
eBay doesn't look too expensive:

http://cgi.ebay.com/170828631732

Just don't buy this one  ;)

http://cgi.ebay.com/192041375586
So Long, and Thanks for All the Fish
 


Offline borjam

  • Supporter
  • ****
  • Posts: 593
  • Country: es
  • EA2EKH
Re: 6502 Cpu wanted
« Reply #3 on: February 14, 2017, 06:58:04 pm »
Turns out Jameco Electronics still has them in stock!

http://www.jameco.com/z/6502-Major-Brands-MPU-R6500-CISC-8-Bit-1MHz-40-Pin-CDIP_43191.html

They seem to stock other vintage offerings like Z80, 6809... No M68000 though!
« Last Edit: February 14, 2017, 06:59:49 pm by borjam »
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 6897
Re: 6502 Cpu wanted
« Reply #4 on: February 14, 2017, 07:09:30 pm »
The W65C02 is still in production, and is stocked by Mouser.   
 
Normally I'd go off on a long spiel about the best way to design a retro CPU board with modern glue chips, with a USB interface for loading code and control, so you don't have to suffer the traditional EPROM based build - burn - crash development cycle, but Hackaday have reviewed the Western Design Center's development boards with 65C02 and related cores and it turns out WDC have already done all the hard work for you.  See http://hackaday.com/2015/07/29/review-single-board-65c02-and-65c816-computers/.  Not cheap mind you, but by the time you've added up the cost of a N.O.S. 6502 CPU, 6520 PIA, 6522 VIA, and stuck them on a board with RAM, FLASH, glue logic and a FTDI USB <> parallel chip that can emulate a COM port for host communications, you'll be up to a significant proportion of the WDC boards price.    Then you have a long hard road ahead of you porting a 6502 monitor ROM to your board.   On time factor alone it would be cheaper to wash car windows, do odd-job or flip burgers to pay for one of the WDC boards rather than attempting to roll your own.
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 1950
  • Country: de
    • Frank Buss
Re: 6502 Cpu wanted
« Reply #5 on: February 14, 2017, 07:13:41 pm »
Another idea is to buy a C64 or 1541 floppy on eBay, and then desolder any chips on it. C64 is better, because you get the CPU (6510, but it is the same as a 6502, except for an additional 8 bit GPIO), two 6522 VIAs, the SID sound chip and the VIC graphics chip, and you can sell the rest like the PLA or the DRAM, if you don't need it. Of course, don't buy a working C64, would be a sacrilege, you can get broken ones for cheap. Usually the RAM or PLA is broken, so chances are high that the CPU still works.
So Long, and Thanks for All the Fish
 

Online brucehoult

  • Frequent Contributor
  • **
  • Posts: 714
  • Country: nz
  • Currently at SiFive, previously Samsung R&D
Re: 6502 Cpu wanted
« Reply #6 on: February 14, 2017, 07:16:48 pm »
Turns out Jameco Electronics still has them in stock!

http://www.jameco.com/z/6502-Major-Brands-MPU-R6500-CISC-8-Bit-1MHz-40-Pin-CDIP_43191.html

They seem to stock other vintage offerings like Z80, 6809... No M68000 though!

Looking back with 35 years hindsight, it's amazing how similar in concept the 6809 is to the x86. Same number of registers, just arranged differently. A couple of secondary opcode pages. Very similar ModR/M byte.

It felt much nicer to use at the time though. A couple of friends and I designed/built our own wire-wrapped board using one, wrote simple OS and compiler...
 

Offline jpb

  • Super Contributor
  • ***
  • Posts: 1413
  • Country: gb
Re: 6502 Cpu wanted
« Reply #7 on: February 15, 2017, 05:38:58 am »
If you just want to do 6502 assembler it might be worth picking up an old BBC model B micro if there are any locally.

The assembler is embedded in the BBC Basic which makes it quite easy to use and powerful (you can use the BASIC for macros and conditional assembly and so on).

I did have a BBC Master in my attic which I bought ages ago for £50 but I had to get rid of it when I moved house recently.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 6202
  • Country: us
Re: 6502 Cpu wanted
« Reply #8 on: February 15, 2017, 06:06:21 am »
There's the T65 and several other 6502 softcores you can use on an inexpensive FPGA. You get all the support chips "for free" that way too. I've got a 6502 system running on a $13 FPGA board.
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 3223
  • Country: gb
  • Will design for cookies
Re: 6502 Cpu wanted
« Reply #9 on: February 15, 2017, 06:41:07 am »
If you just want to do 6502 assembler it might be worth picking up an old BBC model B micro if there are any locally.

^^^ This!

Either a model B or a Master 128 will do, and make sure you also pick up a copy of the Advanced User Guide which describes the built-in assembler in detail, as well as the other hardware. There really is no better way to make a 6502 accessible.

If you want to build something, don't waste time actually wiring up a 6502 from scratch. Get the BBC machine and build something to plug into one of its various expansion ports, which are easy to use and will readily connect to modern hardware.
 

Online brucehoult

  • Frequent Contributor
  • **
  • Posts: 714
  • Country: nz
  • Currently at SiFive, previously Samsung R&D
Re: 6502 Cpu wanted
« Reply #10 on: February 15, 2017, 07:44:26 am »
If you just want to do 6502 assembler it might be worth picking up an old BBC model B micro if there are any locally.

I see there are real masochists here :-) I've done more than enough 6502 asm in my time. Painful. They were cheap and that was the best thing about them. The 6809 was massively more pleasant to program. But the modern AVR beats both hands-down. And are super cheap *today*.

I'm also really enjoying programming the RISC-V in my "HIFive1" Arduino clone in asm. Very straightforward and easy to learn -- even more than ARMs.
 

Offline eugenenine

  • Frequent Contributor
  • **
  • Posts: 674
  • Country: us
Re: 6502 Cpu wanted
« Reply #11 on: February 15, 2017, 07:48:45 am »
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 6202
  • Country: us
Re: 6502 Cpu wanted
« Reply #12 on: February 15, 2017, 08:04:03 am »
If you just want to do 6502 assembler it might be worth picking up an old BBC model B micro if there are any locally.

I see there are real masochists here :-) I've done more than enough 6502 asm in my time. Painful. They were cheap and that was the best thing about them. The 6809 was massively more pleasant to program. But the modern AVR beats both hands-down. And are super cheap *today*.

I'm also really enjoying programming the RISC-V in my "HIFive1" Arduino clone in asm. Very straightforward and easy to learn -- even more than ARMs.

I like working with the retro stuff. It really makes you appreciate how far we've come in some areas. It also makes one appreciate just how capable some of the old hardware was, despite its simplicity. It amazes me what people have squeezed out of the humble 6502.
 

Offline jpb

  • Super Contributor
  • ***
  • Posts: 1413
  • Country: gb
Re: 6502 Cpu wanted
« Reply #13 on: February 15, 2017, 08:22:41 am »
If you just want to do 6502 assembler it might be worth picking up an old BBC model B micro if there are any locally.

I see there are real masochists here :-) I've done more than enough 6502 asm in my time. Painful. They were cheap and that was the best thing about them. The 6809 was massively more pleasant to program. But the modern AVR beats both hands-down. And are super cheap *today*.

I'm also really enjoying programming the RISC-V in my "HIFive1" Arduino clone in asm. Very straightforward and easy to learn -- even more than ARMs.
The ARM chip was based on the 6502. The 6502 has a nice simple instruction set and I think the designers of ARM (from Acorn) designed ARM along the same lines but with 32 bit registers and a barrel shifter and a few other goodies. The 6502 is definitely nicer to program than say the 8086 family.
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 3223
  • Country: gb
  • Will design for cookies
Re: 6502 Cpu wanted
« Reply #14 on: February 15, 2017, 08:54:02 am »
The ARM instruction set was new from the ground up, and there's really no similarity between it and 6502.

Examples: ARM2 has a set of 16 registers, of which 13 are completely general purpose, and conditional execution for every opcode. The 6502 has A, X and Y, all of which are 8 bit only. The only conditional operations are short range relative jumps, and indirect operators work differently depending on whether X or Y is the index.
 

Online brucehoult

  • Frequent Contributor
  • **
  • Posts: 714
  • Country: nz
  • Currently at SiFive, previously Samsung R&D
Re: 6502 Cpu wanted
« Reply #15 on: February 15, 2017, 08:55:16 am »
If you just want to do 6502 assembler it might be worth picking up an old BBC model B micro if there are any locally.

I see there are real masochists here :-) I've done more than enough 6502 asm in my time. Painful. They were cheap and that was the best thing about them. The 6809 was massively more pleasant to program. But the modern AVR beats both hands-down. And are super cheap *today*.

I'm also really enjoying programming the RISC-V in my "HIFive1" Arduino clone in asm. Very straightforward and easy to learn -- even more than ARMs.

I like working with the retro stuff. It really makes you appreciate how far we've come in some areas. It also makes one appreciate just how capable some of the old hardware was, despite its simplicity. It amazes me what people have squeezed out of the humble 6502.

Trust me, I remember how far we've come!!!

6502 just takes SO MUCH CODE to do anything. And you don't have that much memory to put it in.

Ok, so you use zero page as registers. A lot of registers. Now add two variables in zero page together. If they're 8 bit then that's four instructions, seven bytes of code, eleven clock cycles. If they're 16 bit then it's seven instructions, thirteen bytes of code, twenty clock cycles. For 32 bit it's thirteen instructions, twenty five bytes of code, thirty eight clock cycles.

8 bit AVR has 32 registers. You add two registers with one instruction, two bytes, one clock cycle. If you need 16 bit then it's two instructions, four bytes, two clock cycles. For 32 bit it's four instruction, eight bytes, four clock cycles. More than three times less code and about ten times fewer clock cycles. Same with Thumb or RISC-V, except they handle 32 bit variables with a single two-byte one clock cycle instruction (Thumb is a bit lacking in registers, but RISC-V isn't).

Don't even talk about trying to manage a C/Pascal style stack! The only sane thing to do is go to a bytecode interpreter or threaded code, which adds yet more slowness. At least if you didn't need recursion zero page is big enough that you could probably allocate every function in your program its own little argument/scratch area (and even overlay areas for functions that couldn't call each other).

I appreciate how far we've come. Really. I don't need to re-live it :-)

On the other hand -- let's make a 6502 back end for LLVM!!!
 

Online brucehoult

  • Frequent Contributor
  • **
  • Posts: 714
  • Country: nz
  • Currently at SiFive, previously Samsung R&D
Re: 6502 Cpu wanted
« Reply #16 on: February 15, 2017, 09:19:53 am »
If you just want to do 6502 assembler it might be worth picking up an old BBC model B micro if there are any locally.

I see there are real masochists here :-) I've done more than enough 6502 asm in my time. Painful. They were cheap and that was the best thing about them. The 6809 was massively more pleasant to program. But the modern AVR beats both hands-down. And are super cheap *today*.

I'm also really enjoying programming the RISC-V in my "HIFive1" Arduino clone in asm. Very straightforward and easy to learn -- even more than ARMs.
The ARM chip was based on the 6502. The 6502 has a nice simple instruction set and I think the designers of ARM (from Acorn) designed ARM along the same lines but with 32 bit registers and a barrel shifter and a few other goodies.

Just a few other goodies :-)

Quick! What does this simple ARM instruction (valid from the first Archimedes PCs) do?

LDMIAEQ SP!, {R4-R7,PC}

Well! It loads five registers from memory. It adds 20 to the stack pointer register. One of the registers is the PC, so it's a branch instruction -- probably a function return. Oh, and it does all that only if the Z condition code flag is set. It's a conditional return from a function.

Very RISC!

What I find really scary is that IA part .. Increment After .. is only one of four options you could put there: also Increment Before, Decrement Before, or Decrement After. And you could use any register as the base register, not only the stack pointer.

I love ARM, really I do. It's better than x86. But it's far from simple!

The 6502 is definitely nicer to program than say the 8086 family.

Better than 8080, for sure. Better than 8086. probably not. Worse than i386 or x86_64 for sure.

ARM is nicer to program than any x86.

It turns out the worst thing about the 8086 family is actually Intel's documentation, mnemonics, and assembler format. And the hideous complexity of implementing it to go fast.
 

Offline Chopsticks

  • Regular Contributor
  • *
  • Posts: 64
  • Country: au
Re: 6502 Cpu wanted
« Reply #17 on: February 15, 2017, 04:41:49 pm »
thanks everyone for all the info and pointers to where to buy/acquire a 6502 cpu. the idea of getting a bbc micro sounds interesting unfortunately being in Australia i dont think I'm likely to find one to buy, and if i did it would probably cost a pretty penny down under.

sorry if my reply is kind of short, I've come down with a bad flu but i do really appreciate all the help and ill probably do an order with mouser
 

Online brucehoult

  • Frequent Contributor
  • **
  • Posts: 714
  • Country: nz
  • Currently at SiFive, previously Samsung R&D
Re: 6502 Cpu wanted
« Reply #18 on: February 15, 2017, 08:28:59 pm »
thanks everyone for all the info and pointers to where to buy/acquire a 6502 cpu. the idea of getting a bbc micro sounds interesting unfortunately being in Australia i dont think I'm likely to find one to buy, and if i did it would probably cost a pretty penny down under.

sorry if my reply is kind of short, I've come down with a bad flu but i do really appreciate all the help and ill probably do an order with mouser

Not Aussie, but here's three C64s for sale for $50 in NZ.

http://www.trademe.co.nz/computers/vintage/auction-1261470379.htm

BBCs were never common in NZ and Aus, but there should be any number of C64, C128, Atari 400/800 around in closets, and quite a lot of Apple's too. Some of these were made rigth from the late 70s until the early 90s.
 

Offline Chopsticks

  • Regular Contributor
  • *
  • Posts: 64
  • Country: au
Re: 6502 Cpu wanted
« Reply #19 on: February 15, 2017, 08:42:19 pm »
unfortunately at least as far as i can find, any apple II's, Commodore 64/128 etc or other similar era hardware are just to expensive to buy, everything i find on eBay is $150 upwards and being a university student its the old issue of lack of funds. unless anyone knows something i dont about where to get old systems in Australia or wants to donate one then i think i'll have to buy some new chips from mouser
 

Offline Moshly

  • Regular Contributor
  • *
  • Posts: 105
  • Country: au
  • What's wrong with this thing
Re: 6502 Cpu wanted
« Reply #20 on: February 15, 2017, 08:46:30 pm »
Or download WinVICE http://vice-emu.sourceforge.net/ & emulate most commodore 8bit's (all 6502)

Get yourself a cross development IDE here http://6502.org/tools/asm/
Now you don't even need a legacy system.

There are emulators for every just about any 6502 based system, some even have monitors & cross dev stuff built in.

If you do want to get an old system, choose something that someone has made an SD or USB interface for. The main problem you will have is getting data in & out of it.

Another thing to note is that not all 6502 CPU's have the same instruction set.
The CMOS version has more instructions and fixed some bugs.
The Rockwell version has some added bit instructions. (not compatible with the CMOS version)
There are also some other variants, the 16bit 65c816 (when in 6502 8bit mode) uses the CMOS set.
 

Online brucehoult

  • Frequent Contributor
  • **
  • Posts: 714
  • Country: nz
  • Currently at SiFive, previously Samsung R&D
Re: 6502 Cpu wanted
« Reply #21 on: February 15, 2017, 08:48:32 pm »
unfortunately at least as far as i can find, any apple II's, Commodore 64/128 etc or other similar era hardware are just to expensive to buy, everything i find on eBay is $150 upwards and being a university student its the old issue of lack of funds. unless anyone knows something i dont about where to get old systems in Australia or wants to donate one then i think i'll have to buy some new chips from mouser

Go any relatives? If you ask around you can probably find one for free. If they haven't been tossed...
 

Offline Chopsticks

  • Regular Contributor
  • *
  • Posts: 64
  • Country: au
Re: 6502 Cpu wanted
« Reply #22 on: February 15, 2017, 08:51:48 pm »
mmm, not really interested in WinVICE as emulation isn't on much interest to me. i basically just want to get a 65C02 and interface it with RAM/ ROM and PIA/VIA chips and write some code to see how things where done before microchips suck as the PIC and AVR changed everything with integration

as for relatives, well none have any old 8 bit systems, I've certainly asked around :)
 

Offline Moshly

  • Regular Contributor
  • *
  • Posts: 105
  • Country: au
  • What's wrong with this thing
Re: 6502 Cpu wanted
« Reply #23 on: February 15, 2017, 10:05:48 pm »
Ok, cool, jumping straight in at the deep end  :-+

Some good books on the subject ->
http://www.bombjack.org/commodore/books-generic.htm
Scroll down to programming section and check out the Rodnay Zaks titles & the MOS hardware & software manuals. Lots of other good stuff too.
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 1950
  • Country: de
    • Frank Buss
Re: 6502 Cpu wanted
« Reply #24 on: February 15, 2017, 11:06:30 pm »
unfortunately at least as far as i can find, any apple II's, Commodore 64/128 etc or other similar era hardware are just to expensive to buy, everything i find on eBay is $150 upwards and being a university student its the old issue of lack of funds. unless anyone knows something i dont about where to get old systems in Australia or wants to donate one then i think i'll have to buy some new chips from mouser

Interesting, ebay.com.au has nearly no C64 auctions (if you search for C64). In ebay.de there are lots of them. But you could order the individual chips. I don't know the seller, but this auction is still online:

http://cgi.ebay.com/170828631732

US $2.54 for a 6502, and free shipping doesn't look to expensive. But it is in China, if I order it from Germany usually needs 4 weeks or more delivery time. But I have good experience with it, once I ordered a lot of MC6850 UART chips for my Kerberos cartridge from China and they all worked with no problems. Very useful chip, if you want to implement a serial port on your system. You can get them, too, for cheap on Australia eBay, again from China. It's crazy, cost with free shipping is less than the shipping cost alone would be if I would send you one:

http://cgi.ebay.com.au/191964446415

But I couldn't find a cheap 6522 VIA.

For the RAM and ROM, I would just use modern parts. See e.g. my Kerberos cartridges (schematic in my github project page for it). It provides 128 kB RAM extension and 2 MB flash memory, besides the MIDI ports. I used a CY62128EV30 SRAM chip. You can tie A15 and A16 to GND and then you'll have 32 kB RAM for your system for less than 2 bucks (you can get it from Mouser and Digikey). You'll might need some logic gates, too, for decoding the addresses and chip select. Note that you need some voltage level translators as well, like the 74LVC8T245, because the RAM operates with 3.3V. I guess there are cheap 5V SRAM chips out there as well.

For the second 32 kB you can use a flash, like on my catridge. But this is available with 5V supply voltage as well, e.g. SST39SF010A. So for a start, you could just use a 6502 and a flash, then program a blinking light by toggling A15, or something more fancy like an 8 bit digital output with a 74373 and related trigger logic. If you use the outputs of this chip, you could even implement bank switching. It's all too easy these days, no need to use complicated DRAM chips.

For flashing the flash, I used my C64 in combination with the CPLD (and for fun built a programmer with a Raspberry Pi), but it works with a TL866CS, too, a universal programmer that Dave tested once:. Relatively  cheap on ebay: http://cgi.ebay.com.au/191736125106 Very useful device, can read old EPROMs and ROMs, too.

If you don't have already many gates for testing on a breadboard, maybe design a circuit first (which is the most fun part anyway, at least for me), then you'll know what you need to buy.
So Long, and Thanks for All the Fish
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf