Live data from Hacker News

CS/A65: A 6502 computer with USB, Ethernet and co-processors

6502.org

31–40 of 50 posts

Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors

#31
post #6

Noob her! why use a 6502 versus another 8bit cpu like Atmel AVR? Is there any advantage? Does it consume less electricity while running at similar speed ?

I'll step in and say that the Atmel AVR is damn awesome processor, it's just that it's hooked up to on-chip peripherals and the address/data bus is completely internal. This means that if you want to connect something to an Atmel AVR, it will likely be over some serial protocol, like SPI, I2C, or UART.

This is what you want, like, 99.9% of the time.

The 6502 just puts its address and data bus on pins, and you can make the memory map for your computer however you want, as long as you are willing to wire up the logic. There's no privilege for on-chip resources... everything is off-chip and completely equal. With the AVR, the resources (RAM, flash, peripherals) are completely fixed but much, much faster. There are a ton of chips you can buy with SPI / I2C interfaces if you want the AVR to do something interesting, and you drive them with the on-chip peripherals. The on-chip peripherals get to sit in memory somewhere, but the external ICs don't. With the 6502, you put things in memory somewhere, figure out a way to decode addresses on the bus, and use a parallel interface for everything.

Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors

#32
post #6

Noob her! why use a 6502 versus another 8bit cpu like Atmel AVR? Is there any advantage? Does it consume less electricity while running at similar speed ?

6502 is about as simple a CPU as you can get without it being a complete pain in the ass to work with. So it's a great CPU to learn nuts and bolts of computer hardware. It's pretty easy to interface it to external devices, pretty easy to learn the instruction set, there's a huge community of enthusiasts for it, it's very cycle efficient and very responsive to interrupts and somehow feels fast, and the ins and outs of how it functions are super well documented and reverse engineered.

Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors

#33

Always love to see a 6502 post here on HN. It's a really unique processor compared to other 8-bit processors at the time. With only one general purpose register, and memory mapped IO, the 6502 offers a ton of "addressing modes" to solve problems that the 8080 would solve with register transfers. Ben Eater ( http://beneater.net/ ) makes a neat video series and accompanying product kit where you build a 6502 on a bread…

A while back I tried writing an Atari 2600 game and got about half way (got sprites, collisions, level, just no goal) The console uses a slightly cheaper version, the 6507 I think. Same chip, just smaller address line and no interrupts (!) Instead you ran a "wait for the cathode ray to reach the right side of the screen" in order to time everything correctly. Very fascinating stuff, I recommend anyone interested in t…

2600 has been my obsession for a few years now. I too havent set a goal but I love to follow what other people are doing for it. The community is fantastic. There's a twitch and yt channel called ZeroPage Homebrew that usually streams twice a week. They exclusivley play homebrews and the devs are usually in the chat. They were 2600 only for a long time but recently started including 7800 and 8-bit.

Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors

#34
post #15
post #5

Pros and cons of this versus Commander X16 ?

X16 is going to be more for folks who want something that just works and they can play around with in software Projects like this are more for folks who are looking to build their own computers from scratch. Typically, this is for someone who's more into hardware. Personally, I enjoy both. I have probably 6 or so kit computers at this point. FWIW, the two that I've enjoyed the most are Ben Eater's breadboard 6502 pro…

The goals of the X16 are actually at a crossroads right now https://www.commanderx16.com/forum/index.php?/topic/1657-cha...

Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors

#35

Andre Fachat also wrote a pre-emptive multitasking kernel for the 6502: http://www.6502.org/users/andre/osa/oa1.html This is basically the same CPU as in the NES.

It feels weird to me that some hackers don't know what a 6502 is! Sign of my age I guess.

Earlier this year, I wrote a 6502 emulator and discovered that none of my coworkers even know what the 6502 was. Almost every conversation resulted in me saying: "You know the NES? It used a 6502 as a CPU".

Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors

#36
post #24

Earlier quoted context omitted.

It feels weird to me that some hackers don't know what a 6502 is! Sign of my age I guess.

Days ago a user who declared to be a Google employee wrote that many of his colleagues have no idea what RSS is. (No, sign of the times.)

morns in Google Reader

Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors

#37
Back in the mid 80's when I was in collage, my primary CP professor was a huge fan of the 6502 and thought it the ideal chip for undergrads to learn the basics of computer engineering...and it was, for me at least.

Way easier to breadboard and write opcode for then, and more powerful than the Intel 4004 and 8008 (what would eventually become the 8086..the great-great-great grandfather of the i9's we now use of course), my very first working "computer" used a 6502 at its heart for my senior project...we attempted to build a voice-activated phone and actually got something that would pick up and shut off the phone with some noise, but obviously a working voice-activated phone was something that was still many years away.

Also, I remember writing an opcode instruction emulator for the chip as a extra-credit project for one my classes. I wrote a really nice emulator on my beloved Atari ST and, much to my horror, discovered a horrendous bug in he C compiler I used for the project, almost ruining both the project and my grade for the quarter.

The program had a graphical representation all all the primary subsections of a basic computer...CPU, disk memory, the various busses, and some other things that my old brain can no longer remember, and the program would step thru the processors opcodes and show, with literally the 1s and 0s on the screen, how all the parts of the computer processed the opcode instruction set into something that coordinated all the chips into doing very useful stuff.

The problem was that due to some sort of crazy hex arithmetic bug in the compiler, one of the values at one of the nodes was stuck at like x0E or something like that...and no matter what I tried to do to debug it, I could not get the damn thing to work perfectly. I thought I was going to fail the class for sure, and it wasn't even my fault!

Thankfully, I was able to show the results in pure binary form, and the rest of the program was quite impressive. Also, my professor was a HUGE fan of the Atari ST (probably because it used the 68000 and wasn't Intel), so the day of me showing him my work wasn't a total failure...in fact, his face totally lit up when I asked him if I could pop the floppy into the ST in his office, and we verified that, yes, the bug was there in all versions of the compiler.

Only one other student had chosen to do the assignment, and he had used a minicomputer from his work to do it and his results where shown in reams of printouts where mine was there graphically represented in real time updates as you stepped thru the opcode instructions. I remember its addressing modes and GP registers made writing opcode a breeze as you didn't have to waste cycles juggling data and memory addresses at all.

[edit] wow...sorry this was such a long post! I just got lost in remembering old times...

Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors

#38
post #37

Back in the mid 80's when I was in collage, my primary CP professor was a huge fan of the 6502 and thought it the ideal chip for undergrads to learn the basics of computer engineering...and it was, for me at least. Way easier to breadboard and write opcode for then, and more powerful than the Intel 4004 and 8008 (what would eventually become the 8086..the great-great-great grandfather of the i9's we now use of course…

Amazing story! All of this, I wasn't even born (just to point out how old you are xD). As a late millennial, this is the first time ever I hear about this CPU.

Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors

#39
Some folks may be also interested in his latest endeavor.

https://github.com/fachat/MicroPET

It's quite clever. At it's core, it's PET clone.

But deeper, it's not just a PET clone, but 4 other machines in the PET series.

On top of that it's based on a 65816, has B&W 640x480 VGA graphics, as well as several different text modes. As a cherry on top, it can run 4 "virtual" PETs simultaneously.

This is much closer to a machine that I'm interested in. Fundamentally, a fast 65816 with memory (at least 1MB), UART, and access to a "full speed" USB bus (12.5Mbits), which it boots off of (it could also boot off of an SD Card).

This machine is close. The SPI to the Ethernet and USB is 6MHz, and driven by the CPLD rather than bit banged off the CPU.

Post reply on HN