6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 9:19 am

All times are UTC




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Mon Mar 02, 2009 7:49 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
It seems like it's been a few years since any new hardware interfaces have been made public to program EEPROMS from the PC. Chris Ward's approach seems the best I've seen so far, but I have zero experience controlling PC ports. What are you guys using hardware and softwarewise to develop a 6502 OS.

In the past with the C-64 expansion port, I made an interface which controlled the 6502 reset, and had tri-state latches for the address and data to access the "ROM", which was actually a 2K static RAM where the OS was. Once the OS was programmed in the RAM, the latches would switch over control to the 6502 and would reset it.

Is there something similar I can do with the PC?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Mar 02, 2009 9:48 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
My goal in this project is to go "piggyback" in an automotive setting. I need to measure/monitor 8 fuel injector pulse widths, with 16-bit resolution using 16-bit counters, also monitor camshaft, and crankshaft pulses using the on vehicle hall effect sensors. The last 2 sensors will be monitored using 2 high speed 8-bit ADC's. All will be displayed from the 6502 system on a LCD display.

I want to monitor pulse widths of the fuel injectors, to see the difference in values in different settings.

I hope you guys can help. The 6502 is THE best, and I've chosen it because I can program it in assembly, all other high level languages are greek to me. TIA


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Mar 03, 2009 9:00 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
Quote:
What are you guys using hardware and softwarewise to develop a 6502 OS?

DOS on a 12-year-old (or so) computer, with a high-res monitor (132 columns by 43 or sometimes 60 lines, instead of the old 80x24). With the Multi-Edit programmer's text editor that runs under DOS, I've had as many as 32 files open at once, windowed and tiled in different ways.

Image
Here you see parts of five files, plus the "Load new file" menu. It's all mouse-powered. There are lots of other files behind, and 16 more are minimized.


Image

(Pardon the camera photos-- I don't think I have a screenshot function on the DOS computer.)

One of the many nice features is that it lets you draw diagrams as easily as CAD, using just the DOS/ANSI [Edit: that should say IBM437] characters above 80H, as you see a little bit of in the second picture. Since it's just a text file, these cause no problems with assemblers and compilers.

For an (E)EPROM programmer, I'm using Needham's PB-10 (which, BTW, uses 65c22 VIAs). I just heard it's no longer made (which doesn't surprise me), but there are still plenty of programmer manufacturers, and there's always eBay.

My DOS-based assembler is Universal Cross-Assemblers' C32, which works for dozens of processors. You don't have to buy a different assembler for each processor. Most of my assembly however is done on the assembler that's a part of my Forth in my workbench computer. With the Forth that I developed years ago in the home-made workbench computer's ROM, most other development is done in its RAM. I use the editor on the PC in order to have the big keyboard and full screen and file storage, and "print" (or so the PC thinks) marked blocks of text over RS-232 to the workbench computer which interprets, assembles, or compiles, as appropriate, on the fly, as little as a word at a time or as much as many pages at a time, sometimes while doing something else at the same time. This is done without any special software on the PC, and without leaving or suspending the editor (since it just thinks it's printing a block to an old-fashioned RS-232 printer). Any computer that can print blocks of plain text from a text editor to RS-232 could act as the host in this way. It doesn't have to be a PC or use any particular OS. The 6502 computer just thinks you're typing at an RS-232 keyboard (one that sends out ASCII, not keycodes), and that you're a lightning-fast typist who never makes any mistakes; but actually the data is coming from the PC.

Quote:
The 6502 is THE best, and I've chosen it because I can program it in assembly, all other high level languages are greek to me.

Assembly is essential for places where you need the greatest performance and the tightest control of timing; but you can still accomplish 95% (or more) of the purpose using a high-level language (HLL) for the overall project and coding only the most critical parts in assembly. As they say, "A little assembly goes a long way." The 6502 lends itself much better to assembly-language programming than a lot of other processors do whose complex assembly languages practically put assembly off-limits to most programmers, or, going the other direction like the PIC, the assembly language is frustratingly weak and requires all kinds of jerry-rigging.

Assembly's lack of structure puts major limitations on development though. As project sizes grow, the difficulty of remaining productive and keeping control in assembly increases exponentially. You can get a little relief by using some HLL tactics, but eventually you begin to ask yourself why not just use an HLL. I do wish my DOS-based assembler supported assembler variable arrays so I could have a stack in the assembler so I could use macros to form some program structures in assembly, and be able to nest the structures, without jerry-rigging. Edit: I've done this now and documented it at http://wilsonminesco.com/StructureMacros/index.html and give the source code too. It has been a breath of fresh air to do a couple of major assembly-language projects with program structures. In most cases there's absolutely no penalty in memory or run speed-- you just get to see what you're doing much better, and become more productive and have fewer bugs.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 04, 2009 12:33 am 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
GARTHWILSON wrote:
The 6502 lends itself much better to assembly-language programming than a lot of other processors do whose complex assembly languages practically put assembly off-limits to most programmers...


I agree 100%, it was a time in the development of CPU's where things where simple enough for a kid to do it. I've been away from digital design and programming for almost 20 years. It's like riding a bike though, something you never forget. Thank God for this site. I intend to hang around for a long while.

You have a real special setup there,and I really appreciate your quick response. I will have some more questions after I do abit more research. Thanks for the leads!

Gonna do some research on EEPROM programmers for the PC. I imagine they come with a program for Windows that will burn a file of numbers onto the EEPROM... What would be perfect is an 6502 assembler for Windows that would make a file to burn through a COM or Parallel port, but worse comes to worse I will write the OS on a simulator then write the numbers down and reenter them into the file to burn. I'm sure there is something simpler, but be patient with me, I feel like I have to learn a few basics about the PC now. Something I have ignored for too long now.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 04, 2009 12:54 am 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
So you are using Multi-Edit. That program seem real impressive, says it can compile up to 51 languages?!

How does your C32 assembler interact with Multi-Edit?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 04, 2009 1:34 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
Quote:
Gonna do some research on EEPROM programmers for the PC. I imagine they come with a program for Windows that will burn a file of numbers onto the EEPROM... What would be perfect is a 6502 assembler for Windows that would make a file to burn through a COM or Parallel port

Modern ones will probably be through a USB port, and likely come with Windoze drivers.

Quote:
but worse comes to worse I will write the OS on a simulator then write the numbers down and reenter them into the file to burn.

That would be worse than worst, because it would be far too time-consuming and error-prone to do more than a few hundred bytes. (I actually started by assembling by hand in the early 80's. Progress was slow, and although the computer worked, it wasn't really useful. I had no other computer at all for development.) Once you get a 6502 computer going initially though, you can use it for all kinds of other things including running a home-made programmer. One of the many things I use mine for is programming microcontrollers. I have some project pages at http://www.6502.org/users/garth/ (although they need updating). Something you might be able to do is get a very minimal BIOS going on your home-made computer, just enough to load the rest of your OS into RAM over a link from your PC, then have it put it in a removable serial EEPROM module something like this for later loading:

Image

The 8-pin DIP is an I²C 32Kx8 EEPROM. (They come in at least 128Kx8, and many megabytes if you go with SPI instead of I²C.) The socket plugs onto a 2x2 pin header at the front edge of my workbench computer. The four pins are power, ground, clock, and bi-directional data. The jumper installed at the left corner is a write-protect. As you can see, the whole thing is about half the size of a postage stamp.

[Edit, 7/28/22: I now offer a tiny I2C-6 EEPROM module on the front page of my site. There's a link to the data sheet there.]

Quote:
How does your C32 assembler interact with Multi-Edit?

I guess MultiEdit (ME for short) is supposed to be able to interact with the assembler somehow, but I've never tried that. I just shut down ME, run the assembler, run the EPROM programmer, then go back to ME. ME keeps all the same files, windowing, positions in the files, margins, blocks, etc., so you don't have to set it up again when you re-start it, and in DOS (especially with batch files), with a 100MHz+ computer, it all just flies, unlike modern bloatware. I have not run my assembler on the PC in probably a few years though, because all the smaller jobs get assembled by the workbench computer itself. There is a multi-tasking DOS I should try, then I wouldn't have to shut anything down to go to another program.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 05, 2009 1:42 am 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
GARTHWILSON wrote:
Quote:
but worse comes to worse I will write the OS on a simulator then write the numbers down and reenter them into the file to burn.

That would be worse than worst, because it would be far too time-consuming and error-prone to do more than a few hundred bytes.


That's where I'm gonna have to start though. Found an EEPROM programmer for the parallel port for the PC at $300. It works through the parallel port and it does sound like I'll have to type in the data. Which is fine at this point. The biggest step is to wire the CPU, memory addressing logic, RAM, EEPROM, and a port/8bit adressable latch to test the wiring and function of the software. Just loop a program with a bunch of NOPs to switch a bit on a port on and off at about 1hz will be the first step.

One other major price consideration is the damn wire wrap gun. Mouser.com is selling a new one for almost $500! Got one lying around you want to sell?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 05, 2009 1:52 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
I use the blue OK Industries WSU-30M hand wire-wrap tool, the lower one in the picture below. It's about 4.5" long. It does a great job.

Image

If the programmer plugs into the PC, I have no doubt that the software it comes with will take the hex file the assembler on the PC produces, so there's no need to type the hex data by hand. I'm sure you can get down at least to $200 though. Check Jameco, Mouser, Digi-Key, JDR, etc..

Gotta run. I'll write more later

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 05, 2009 2:21 am 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
I did find a manual wire wrap gun for $100, and an unwrap tool for $20 from mcmaster.com.... Thanks for your help so far Garth. I'm at the point now where I need a good paycheck to order these parts, and I'll be at stage one of wiring. Time to start a new project thread soon on my engine monitor idea after I'm able to order the parts here in a few weeks.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 05, 2009 3:14 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
Don't spend so much!!!!

A wrap/strip/unwrap tool from digikey is only $35

http://search.digikey.com/scripts/DkSea ... me=K104-ND


Search Ebay for a "TOP2049" programmer. They are less than $150, use a USB connection, and most likely can take multiple file types (raw object, Intel Hex, S records, etc)

You can also find a local electronics hobby/parts store that might carry the basic tools cheaper. Take some time and shop around, then you can put your money into the IC's and other components,

Good luck, and be sure to ask more questions

Daryl


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 05, 2009 4:29 am 
Offline

Joined: Mon Oct 16, 2006 8:28 am
Posts: 106
MCUMall has a Canadian-made USB programmer called the GQ-4X that can burn all the programmable ICs in the SBC3. The basic package goes for just under $100 from their website, but I believe you may be able to pick up one slightly cheaper off ebay.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Mar 07, 2009 10:11 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
8BIT wrote:
Don't spend so much!!!!...Daryl


'I heard that', jeez how stupid am I?!! I've been checking out ebay this past week and found a Cooper Weller electric wire wrap gun for $10. The ad says they normally sell for $350+. So I bid on it, and when I get it this week, I'll have to see if I can order some sleeve's/bits for it, because this distributor doesn't sell add-ons. I've seen lots of sleeves and bits for OK industries tools for sale... On their respective sites, the pictures look the same for both companies' sleeves and bits. Does anyone know if they're interchangeable?

I know from past experiments I need thicker wire for the power routing, and I'm needing some F TTL for the 8-bit high speed counters which will take some current and introduce noise, which is why I'm looking for different sleeves and bits for the thicker power connections... We'll see in a week when the bidding is over.

Still doing research on EEPROM programmers/ assemblers. Thanks for the input guys. I very much appreciate it ;)

Sam


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Mar 07, 2009 11:04 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
Quote:
and I'm needing some F TTL for the 8-bit high speed counters which will take some current and introduce noise

Why not use CMOS? A 74AC161 or 74ACT161 counter is faster than a 74F161. My 10/15/03 post at viewtopic.php?p=945#p945 has links to some good ap. notes on construction for fast logic. (At the time of this writing, it's the last post on the thread.) [Edit: See also the page on construction for good AC performance in my 6502 primer, at http://wilsonminesco.com/6502primer/construction.html .]

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Mar 08, 2009 2:29 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
Yeah, on that link, I wonder if Daryl ever figured out what the random data was. I had a similar problem when my chipcount started to grow on a certain project. It took me almost a year to figure out it was noise entering the circuit due to the fact that all the wires I used for VCC and GND were of the same thickness as the rest of the circuit. Those were the days of LS TTL... I was looking at a 74F269 which max frequency was 100MHz. I think now 20MHz will provide enough resolution to measure pulse widths from 1ms to 100ms. The only other family of the 8 bit counter I need is AS. It's an 74AS869. Do you have any experience with AS or ALS? or compatibility issues I may encounter? I would like to primarily use HC or HCT for the rest of circuit.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Mar 08, 2009 3:47 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
ElEctric_EyE wrote:
Yeah, on that link, I wonder if Daryl ever figured out what the random data was. I had a similar problem when my chipcount started to grow on a certain project. It took me almost a year to figure out it was noise entering the circuit due to the fact that all the wires I used for VCC and GND were of the same thickness as the rest of the circuit.


I did not prove the problem, but I figured it was noise caused by all the wires routed over each other and purhaps switching noise as well. I did have bypass caps on every IC, but did not put larger wires on the power rails.

It worked out for the best, as the result was my ATMega8 video display, which was a lot smaller, and provided much more performance.

Good luck with your project!!

Daryl


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 32 guests


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: