Programming the 6502 Chip
Programming the 6502 Chip
Hello,
I recently came across some 6502 chips for sale a Jameco. I ve been reading " Programming and Interfacing the 6502 with Experiments" and been really wanting to start experimenting with them on hands. What my question is what do I need in order to start programming to the chip. Eprom burners? Assemblers? What? Im not sure but i just want to be able to write a program and burn it to the chip to start experimenting. Any info will help.
THanks
EL
I recently came across some 6502 chips for sale a Jameco. I ve been reading " Programming and Interfacing the 6502 with Experiments" and been really wanting to start experimenting with them on hands. What my question is what do I need in order to start programming to the chip. Eprom burners? Assemblers? What? Im not sure but i just want to be able to write a program and burn it to the chip to start experimenting. Any info will help.
THanks
EL
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Make sure you get the 65c02, not the old NMOS ones. The CMOS ones have a lot of advantages.
You will generally need some sort of (E)EPROM programmer. My first one was home-made. It required no computer. It was all hand-operated and extremely slow even for small programs, but I was not dependent on any computer to get another computer going. This was 1985 and I owned no other computer. There are a couple of pictures of my first computer at http://www.6502.org/users/garth/projects.php?project=3
Make sure you download Western Design Center's excellent programming manual from their website. An assembler is nice, but not necessary if you're totally new to assembly-language programming. Actually, starting out coding by hand is good! I wish more people did that, since it gives a better understanding of the insides of software and even hardware. It makes the assembler a tool later on to help get the job done, instead of a substitute for learning and something to do the job for you.
It sounds like you plan to make your own hardware from scratch. What do you have planned, especially for I/O? If we know, we can probably guide you to a lot of applicable help that's already here on the website.
You will generally need some sort of (E)EPROM programmer. My first one was home-made. It required no computer. It was all hand-operated and extremely slow even for small programs, but I was not dependent on any computer to get another computer going. This was 1985 and I owned no other computer. There are a couple of pictures of my first computer at http://www.6502.org/users/garth/projects.php?project=3
Make sure you download Western Design Center's excellent programming manual from their website. An assembler is nice, but not necessary if you're totally new to assembly-language programming. Actually, starting out coding by hand is good! I wish more people did that, since it gives a better understanding of the insides of software and even hardware. It makes the assembler a tool later on to help get the job done, instead of a substitute for learning and something to do the job for you.
It sounds like you plan to make your own hardware from scratch. What do you have planned, especially for I/O? If we know, we can probably guide you to a lot of applicable help that's already here on the website.
Last edited by GARTHWILSON on Mon Apr 02, 2007 7:22 am, edited 2 times in total.
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Quote:
Can i use one of those Universal EErom programmers?
yeah the 6522 looks good. do you think that any universal EPROM will have the assembler to help me burn my code. can i use the 6522 with the NES. can i use the 6522 with the NES. im not sure if your familiar with it but any info will help. also what kind of SRAM can i use with it. i always see SRAM pinouts in some of the NES technical documents but never any chip numbers.
thanks for the info
el
thanks for the info
el
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
The EPROM programmer never has the assembler in it. Maybe someone else here can recommend one from http://6502.org/crossdev/asm/ . The two that I've used (2500AD and Universal Cross-Assemblers C32) are not free though, and they're not on that page. If you have not done any assembly-language programming for any processor, you might do well to start out assembling by hand. The first programs you do will be simple enough to do by hand, and you'll get a better feel for how the computer does its job and what the assembler has to do.
A couple of RAM ICs that are pretty standard to start with are the 6264 8Kx8 SRAM and the 62256 32Kx8 SRAM. The 62256LP-85 (low-power, 85ns) at Jameco is $3.09. Their catalog number is 42876.
If you use EPROMs instead of EEPROMs, you'll also need an eraser, which has a powerful UV light in it. If you just try to leave it out in the sun, it'll take something like a week to erase it instead of a few minutes. Make sure you get windowed EPROMs so you can erase them. The OTP (one-time programmable) are cheaper because the package does not have the window for the UV to reach the die, but you won't be able to program them over and over. The numbers on the EPROMs you'll start out with begin with 27, so a 2764 would be an 8Kx8 EPROM for example.
If you use EEPROMs (electrically erasable PROMs, instead of UV-erasable PROMs), be sure to get parallel ones, with the numbers starting with 28. The 24's and 93's are serial and the 6502 can't read them directly. (They wouldn't be nearly fast enough anyway, even if it could.)
A couple of RAM ICs that are pretty standard to start with are the 6264 8Kx8 SRAM and the 62256 32Kx8 SRAM. The 62256LP-85 (low-power, 85ns) at Jameco is $3.09. Their catalog number is 42876.
If you use EPROMs instead of EEPROMs, you'll also need an eraser, which has a powerful UV light in it. If you just try to leave it out in the sun, it'll take something like a week to erase it instead of a few minutes. Make sure you get windowed EPROMs so you can erase them. The OTP (one-time programmable) are cheaper because the package does not have the window for the UV to reach the die, but you won't be able to program them over and over. The numbers on the EPROMs you'll start out with begin with 27, so a 2764 would be an 8Kx8 EPROM for example.
If you use EEPROMs (electrically erasable PROMs, instead of UV-erasable PROMs), be sure to get parallel ones, with the numbers starting with 28. The 24's and 93's are serial and the 6502 can't read them directly. (They wouldn't be nearly fast enough anyway, even if it could.)
Last edited by GARTHWILSON on Tue Apr 03, 2007 5:58 am, edited 1 time in total.
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
I added some more to my post while you were responding. Make sure you see it all.
Mike Naberezny, the owner of this website, might have some. He stocks some parts for sale to forum members. The 6551 went out of production for awhile, but WDC supposedly has them again. I haven't paid attention in a couple of years, but back then, they had a pre-production run out for people to try. They had a couple of bugs they needed to work out, but they've surely had enough time to take care of that. WDC does work on new projects pretty slowly though. I was told by their president that the new 65c51's will be able to go as fast as the current-production 65c02's, which are rated for 16MHz and will usually go 24MHz at room temperature if the memory and glue logic and board construction will support it. If you're just starting out building this stuff, you probably should hold it down to a couple of MHz for now.
Mike Naberezny, the owner of this website, might have some. He stocks some parts for sale to forum members. The 6551 went out of production for awhile, but WDC supposedly has them again. I haven't paid attention in a couple of years, but back then, they had a pre-production run out for people to try. They had a couple of bugs they needed to work out, but they've surely had enough time to take care of that. WDC does work on new projects pretty slowly though. I was told by their president that the new 65c51's will be able to go as fast as the current-production 65c02's, which are rated for 16MHz and will usually go 24MHz at room temperature if the memory and glue logic and board construction will support it. If you're just starting out building this stuff, you probably should hold it down to a couple of MHz for now.
im not looking for something that fast, 1mhz is all i need. i was just interest in it because there are some articles of interest relating to MIDI and the 6551. but im aways from that right now. i just wanted to know if they are readily available like the 6522. would i be able to simulate what it dose on a programmable e prom
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
I've done a little MIDI with the 6551, using the 6522 to generate the clock, per my tips #11 & #13 at viewtopic.php?t=342 . I haven't spent the time to write the software for some serious music work as I had originally dreamed, but I did make it work. http://www.6502.org/users/garth/project ... chematic=6 shows how I made my MIDI cable to the musical keyboard, connecting only the 6551's TD and +5V, with a pair of resistors.
Your code can go in the EPROM, but it would probably be better to just get your the OS-related stuff into the EPROM and then do your development for the various projects in RAM. If sometime down the road you get the software really stable and decide you want it to be in ROM all the time, then go for it. I've used my workbench computer for scores of projects, and the only thing I keep in ROM is the Forth language kernel (which includes an assembler and of course a Forth compiler), and then all the specific applications are done in RAM. Earlier, when I started making this computer:

I envisioned having a bunch of different EPROMs for different applications (as you can see by the EPROM space in the top left corner with the slot to move the lever for removal without opening the case). I never quite finished that computer before starting over with something which, although it didn't have the nice plastic case that could handle being thrown in the attaché case, was nevertheless a lot more practical in every other way for my workbench work.
Daryl got a bunch of boards made that has sold, with 6502, 32KB of ROM, nearly 32KB of RAM, two 6522's, a 6551, reset circuit, oscillator can, RS-232 line drivers and receivers, and probably something else I'm forgetting. See if he has any left. If he does not, I have a couple I bought from him thinking our older son would use one for a school science project. We ended up making a steam engine instead, and I never quite finished building the boards up. The board looks like:

I'd be willing to sell mine if he doesn't have any more.
Your code can go in the EPROM, but it would probably be better to just get your the OS-related stuff into the EPROM and then do your development for the various projects in RAM. If sometime down the road you get the software really stable and decide you want it to be in ROM all the time, then go for it. I've used my workbench computer for scores of projects, and the only thing I keep in ROM is the Forth language kernel (which includes an assembler and of course a Forth compiler), and then all the specific applications are done in RAM. Earlier, when I started making this computer:

I envisioned having a bunch of different EPROMs for different applications (as you can see by the EPROM space in the top left corner with the slot to move the lever for removal without opening the case). I never quite finished that computer before starting over with something which, although it didn't have the nice plastic case that could handle being thrown in the attaché case, was nevertheless a lot more practical in every other way for my workbench work.
Daryl got a bunch of boards made that has sold, with 6502, 32KB of ROM, nearly 32KB of RAM, two 6522's, a 6551, reset circuit, oscillator can, RS-232 line drivers and receivers, and probably something else I'm forgetting. See if he has any left. If he does not, I have a couple I bought from him thinking our older son would use one for a school science project. We ended up making a steam engine instead, and I never quite finished building the boards up. The board looks like:

I'd be willing to sell mine if he doesn't have any more.
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
nineTENdo, does it look like you'll be getting the board from Daryl? (I don't know what you've talked about in the private messages.) It won't be a development system (unless he's offering you something I don't know about), but it will help you get going with far less work than designing and building your own little 6502 computer.
Daryl, Mike, and others: We really ought to have available here on the forum this board or a similar one, with an LCD, minimal keypad, and piezoelectric beeper (like some greeting cards have), with some kind of easy-to-use monitor ROM for the board including routines to drive the LCD, read the keypad, and beep at various frequencies and durations, bundled with a free assembler and anything else needed on the PC, so newcomers can have a turnkey get-started-fast solution. In fact, we could fill an 8K ROM with utilities that would be useful to lots of people, like division, multiplication, even trig, log, and square-root functions, and other stuff in the source code repository. A lot of things we might not think are so complicated can be quite a hurdle for a beginner. Actually we probably should start another topic to discuss how to put together such a package.
Daryl, Mike, and others: We really ought to have available here on the forum this board or a similar one, with an LCD, minimal keypad, and piezoelectric beeper (like some greeting cards have), with some kind of easy-to-use monitor ROM for the board including routines to drive the LCD, read the keypad, and beep at various frequencies and durations, bundled with a free assembler and anything else needed on the PC, so newcomers can have a turnkey get-started-fast solution. In fact, we could fill an 8K ROM with utilities that would be useful to lots of people, like division, multiplication, even trig, log, and square-root functions, and other stuff in the source code repository. A lot of things we might not think are so complicated can be quite a hurdle for a beginner. Actually we probably should start another topic to discuss how to put together such a package.
i dont know he never pmed me. but i do want the whole enchillada. i want to able to program my 6502 chip with a DEV board and burn it, to inface it with a NES cartridge w/ respect to NES ports and such. but i dont want to be limited to what the NES offers i want the opportunity to able to surpase the NES info and excel in 6502. to create new avenues in NES devoplment. but to do that i want to learn everything the 6502 has to offer.