6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Wed Jun 26, 2024 1:31 pm

All times are UTC




Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Mon Apr 11, 2016 12:46 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1212
Location: Soddy-Daisy, TN USA
I've been struggling off and on for the last few days.

I'm not near my board at the moment so I can't post a pic or schematics...but I can if they are needed.

Anyway, I'm having three different issues. The example I'm following is here:

http://www.grappendorf.net/projects/6502-home-computer/acia-serial-interface-hello-world.html

I've built that circuit for the most part. The differences are:

1) I'm using a 65C02 instead of the NMOS version.
2) I only have 8K EEPROMS and not 32K
3) I have a 3k3 pull-up for RESET with a push-button to GND.
4) I have a 3.579545 MHz clock running through a 74'4040 counter to get a 1.79...MHz clock.

Here are the issues I'm having:

1) Power. The entire breadboard is only using 11 mA. I have the 65C02, a ripple counter, a hex inverter, ROM and ACIA and I'm only pulling 11mA? Sometimes it drops to 9mA. Something is wrong. I am using a bench power supply at 5v and 1A max. Each IC has a .1uF cap on VCC that is as close as I can get it. Since this is a large breadboard, I have large 1000uF electrolytic caps all over the board in hopes of providing enough power. But nothing seems to be using it. I have an LED on the opposite end of the board that lights up just fine and he's pulling an additional 12 mA. When the LED is plugged in, I pull 23 mA. No LED = 11 mA. Oh, each IC will read 4.9V on the high end and 4.2V on the low end.

2) ACIA clock. I have the 1.8xxx MHz crystal tied to pins 6/7 of the 65C51. I put a 22pF cap from pin 7 to GND. Sometimes it works, most of the time it doesn't. I then put another 22pF cap on pin 6 to GND and then it will work for a little while. Scope shows what I expect 1.8xxx MHz. If I wiggle the crystal around for a while, it will sometimes start clocking correctly. But 80% of the time, the scope just shows 5V straight line (well, a little ripple but mostly straight...especially with averaging turned on).

3) Serial data. The little program on the webpage I listed just performs a simple "hello world" over the serial port. Sometimes, and I mean just sometimes, I will get random garbage come over the terminal. But it's never "hello world". For serial communication, I am using this device: https://www.parallax.com/product/32201. I am connecting the 65C51's TX pin to the RX of the PropPlug and the RX to the TX of the PropPlug. GND to GND. The PropPlug also has a "RESET" pin for rebooting the mCU but I'm not using that.


Here is what I've done to try and solve my issues (not a complete list!):

1) Large capacitors all over the board to help distribute power. I've seen the board pull as high as 63 mA but it usually drops to 11 quickly. I've put large caps near each IC in hopes that each would have their own power reserve (in addition to the decoupling caps mentioned above).

2) Plugged my frequency generator into pin 7 of the 65C51 with the exact frequency dialed in.

3) Made sure each wire was the same length for any bus. As best as I could. Checked, re-checked and re-checked 5 more times on my wiring. Since I am only using 8K ROM, I left A14 and A13 floating. (I've also grounded them at one point).

4) Lowered the system clock down to 3.579545 / 4 = < 1 MHz clock.


The schematics are almost exactly the same as the URL above. I can post some pictures later this evening. But I thought I would ask for guidance while it was still fresh in my mind.

Thanks for any help!

** EDIT **

BTW, I ordered a couple 32K EEPROM's (28C256) and 3 DS1813's.

Also, I just realized the "SBC-2 v2.5" http://sbc.rictor.org/info2.html is pretty much exactly the computer I want to build. Stupid me! The only difference is that I want to integrate some AY audio chips and a TMS9918 eventually. I will look over that design too. Regardless, I'd like to know what I did wrong in my existing setup too. :-)

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 11, 2016 3:06 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8230
Location: Midwestern USA
cbmeeks wrote:
I've been struggling off and on for the last few days.

I'm not near my board at the moment so I can't post a pic or schematics...but I can if they are needed.

Please post the schematics. It will make it a lot easier to help you out with this.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 11, 2016 3:11 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1212
Location: Soddy-Daisy, TN USA
Unfortunately, I haven't drawn up any yet. ;-/

But this is 99% of what I have built.

http://www.grappendorf.net/images/projects/6502-home-computer/homecomputer-6502-v5-acia-schematic.png

The difference is that I don't have an AT28C256. What I have instead is an 8K version (AT28C64B) that doesn't have A14 or A15.

Everything else is identical (that I can tell).

Thanks.

** EDIT **

Also, I took this code and typed it by hand in my EEPROM programmer:

Code:
00000000  4c 05 80 40 40 a9 0b 85  02 a9 1f 85 03 a2 00 a5  |L..@@...........|
00000010  01 29 10 f0 fa bd 2b 80  f0 06 85 00 e8 4c 0f 80  |.)....+......L..|
00000020  a5 01 29 08 f0 fa a5 00  4c 0d 80 48 65 6c 6c 6f  |..).....L..Hello|
00000030  20 57 6f 72 6c 64 21 0d  0a 00 00 00 00 00 00 00  | World!.........|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00001FF0  00 00 00 00 00 00 00 00  00 00 03 80 00 80 04 80  |................|
00002000

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 11, 2016 4:18 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8460
Location: Southern California
cbmeeks wrote:
I've built that circuit for the most part. The differences are:

1) I'm using a 65C02 instead of the NMOS version.
2) I only have 8K EEPROMS and not 32K
3) I have a 3k3 pull-up for RESET with a push-button to GND.

Pushbuttons (or any mechanical switches) have a lot of bounce, and I'm wondering if you're not getting a clean enough rising edge.  This is discussed briefly in the 6502 primer's reset page.  You might need one of the circuits there.

Quote:
Here are the issues I'm having:

1) Power. The entire breadboard is only using 11 mA. I have the 65C02, a ripple counter, a hex inverter, ROM and ACIA and I'm only pulling 11mA? Sometimes it drops to 9mA. Something is wrong.

The CMOS processor takes a maximum of 4mA per MHz, so you're fine there with the other stuff.

Quote:
Oh, each IC will read 4.9V on the high end and 4.2V on the low end.

Each IC's power pin is as low as 4.2V above its ground pin?  Or the ground pin is at 4.2V (meaning it did not get a ground connection)?  If the connections are good, it will probably work fine on 4.2V.  WDC's work to under 2V.

Quote:
2) ACIA clock. I have the 1.8xxx MHz crystal tied to pins 6/7 of the 65C51. I put a 22pF cap from pin 7 to GND. Sometimes it works, most of the time it doesn't. I then put another 22pF cap on pin 6 to GND and then it will work for a little while. Scope shows what I expect 1.8xxx MHz. If I wiggle the crystal around for a while, it will sometimes start clocking correctly. But 80% of the time, the scope just shows 5V straight line (well, a little ripple but mostly straight...especially with averaging turned on).

Keep the 22pF from 6 to ground.  Some brands of '51 may need a 1M resistor from 6 to 7.

Quote:
Here is what I've done to try and solve my issues (not a complete list!):

1) Large capacitors all over the board to help distribute power. I've seen the board pull as high as 63 mA but it usually drops to 11 quickly. I've put large caps near each IC in hopes that each would have their own power reserve (in addition to the decoupling caps mentioned above).

A single 100µF for the whole board is normally enough, then the .1's across each IC.  The bigger ones all over won't hurt any, but they won't help either.  The higher current you saw briefly was probably just to charge the big capacitors.

Quote:
3) Made sure each wire was the same length for any bus. As best as I could. Checked, re-checked and re-checked 5 more times on my wiring. Since I am only using 8K ROM, I left A14 and A13 floating. (I've also grounded them at one point).

The equal lengths won't matter at this frequency.  I don't have the info in front of me, but you might need to double-check the pin differences between the 32KB and 8KB EEPROMs.  In UV EPROM, one of those is Vpp\, so grounding it is not the thing to do.

_________________
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  
PostPosted: Mon Apr 11, 2016 5:23 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1212
Location: Soddy-Daisy, TN USA
GARTHWILSON wrote:
Pushbuttons (or any mechanical switches) have a lot of bounce, and I'm wondering if you're not getting a clean enough rising edge. This is discussed briefly in the 6502 primer's reset page. You might need one of the circuits there.


Good point. I originally had a 555 timer reset circuit but I thought it might be overkill for a breadboard. Especially when I knew I would be ordering a DS1813 soon. I may solder up a little 555 timer on some perf board just for this purpose. I was also following the L-Star SBC that I have which seems to do OK with a simple pull-up and mechanical switch. However, it does sometimes need to be reset twice to boot.


GARTHWILSON wrote:
Each IC's power pin is as low as 4.2V above its ground pin? Or the ground pin is at 4.2V (meaning it did not get a ground connection)? If the connections are good, it will probably work fine on 4.2V. WDC's work to under 2V.


Each IC's VCC pin reads between 4.2v and 4.9v with 4.6v or so being the norm. GND reads a few mV (basically 0).


GARTHWILSON wrote:
Keep the 22pF from 6 to ground. Some brands of '51 may need a 1M resistor from 6 to 7.


So, you're saying put the 22pF cap from 6 to GND (instead of pin 7) and tie a 1M resistor between the two? What would the resistor be for? The brand of 65c51 I have is WDC. Do they normally need that?


GARTHWILSON wrote:
A single 100µF for the whole board is normally enough, then the .1's across each IC. The bigger ones all over won't hurt any, but they won't help either. The higher current you saw briefly was probably just to charge the big capacitors.


Ah. I will try that too. The large breadboard I have is 3x3 boards on a cookie sheet. That's why I was thinking power distribution would be bad. At the very least, I will put a large cap at the top/middle/bottom.

GARTHWILSON wrote:
The equal lengths won't matter at this frequency.


My target frequency is going to be 1.79 MHz for the CPU. All driven from a 3.579545 MHz crystal. That's mainly because the AY chips I want to use seem to like 1.79 MHz or even 3.579545 MHz. So I hope to provide a jumper to let me choose. But I was wondering if even 1.79 MHz was a little too fast for a breadboard. Even with short traces.

GARTHWILSON wrote:
I don't have the info in front of me, but you might need to double-check the pin differences between the 32KB and 8KB EEPROMs. In UV EPROM, one of those is Vpp\, so grounding it is not the thing to do.


I'm pretty sure the 8K EEPROM programmed correctly. I pulled it out and loaded the data back in my computer and the numbers matched.

I will, however, triple check the wiring to make sure I didn't make any false assumptions.

Thanks!

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 11, 2016 5:43 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10834
Location: England
Do you have any confidence that a program is running? Can you measure activity on Sync, on RnW, on CS lines, on address lines?


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 11, 2016 5:46 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1212
Location: Soddy-Daisy, TN USA
BigEd wrote:
Do you have any confidence that a program is running? Can you measure activity on Sync, on RnW, on CS lines, on address lines?


Complete confidence, no. Unfortunately, I don't have a logic analyzer.

However, when I put my scope on certain address pins, I see square waves of different frequencies. In fact, it's like I'm seeing two different waves on the same pin. My assumption is because the I/O and ROM are getting switched on/off.

What I can try doing is recording the frequencies of all address pins on each IC. Maybe that might help clue me in.

Any suggestions on confirming if the code is running?

I wonder if I should remove the ACIA and replace it with a VIA to see if I can blink some LED's. But the ACIA seemed simple enough to get going...in theory at least. :-)

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 11, 2016 5:52 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10834
Location: England
I'd recommend putting something trivial into the ROM so you can get more evidence from the address pins. For example, a loop containing 256 NOPs or 128 LDA #$A9 instructions. Or a tight loop containing just a JSR, so you can monitor page one addresses and the read-write lines doing interesting things.


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 11, 2016 5:59 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1212
Location: Soddy-Daisy, TN USA
That's a good idea.

I actually did that before I wired up the ROM and ACIA. I hard-wired the CPU's databus to NOP and watched the address pins. That worked.

However, I need to do the same thing from ROM memory.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 11, 2016 8:37 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8460
Location: Southern California
cbmeeks wrote:
GARTHWILSON wrote:
Keep the 22pF from 6 to ground.  Some brands of '51 may need a 1M resistor from 6 to 7.

So, you're saying put the 22pF cap from 6 to GND (instead of pin 7) and tie a 1M resistor between the two? What would the resistor be for? The brand of 65c51 I have is WDC. Do they normally need that?

Do keep it on pin 6.  Adding another to pin 7 can't hurt, but I'm not sure it does much good either.  The resistor is to keep the oscillator's input pin biased midrange between ground and Vcc.  I just found, in WDC's 10/24/15 data sheet, page 28, that they recommend the 1M resistor, and 30pF on pin 6.  22 is probably close enough, or you could try 33. 30 is not a common value.

Quote:
But I was wondering if even 1.79 MHz was a little too fast for a breadboard. Even with short traces.

Plug-in breadboards are the worst of all worlds for this kind of work, but we have seen designs work with them, particularly with the slower parts.  My first one with a CMOS 6502 (1986) was on this kind of breadboard, but with only a 2MHz processor.  I kept all the wires as short as possible without having them cover the ICs, and it worked on first try.  The equal-lengths thing is for when there's a concern about what happens when one signal arrives before another when the difference in time is a significant fraction of the clock period, or risks violating a set-up time or something like that.  At 1.79MHz, even the latter won't really come into play.  Wire does have inductance though (30AWG wire-wrap wire has 27nH per inch, and going up to 24AWG only cuts it to 23nH, so not much difference), and an antenna effect, so it is desirable to keep them as short as practical.  This is discussed in the 6502 primer in the chapter on avoiding AC performance problems in your construction, and especially in the ap. notes linked at the end.

Quote:
GARTHWILSON wrote:
I don't have the info in front of me, but you might need to double-check the pin differences between the 32KB and 8KB EEPROMs.  In UV EPROM, one of those is Vpp\, so grounding it is not the thing to do.

I'm pretty sure the 8K EEPROM programmed correctly. I pulled it out and loaded the data back in my computer and the numbers matched.

I don't mean about the programming, but about the way your circuit interfaces to it, if it will read from it correctly.

_________________
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  
PostPosted: Mon Apr 11, 2016 8:47 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1212
Location: Soddy-Daisy, TN USA
Thanks again for the reply. Hopefully, I will get to work on it some more tonight.

Regarding the breadboard...

I know PCB's are cheap these days...but I can't justify spending $20-$40/pop for each mistake. I've seriously thought about getting some wire-wrap equipment. But that also seems a little expensive. So I mostly have to go with what I already have in stock. :-)

That being said, I have tons of these little proto-boards and sockets. I'm thinking about soldering a small board with my breadboard wire for each IC and make them "stackable". I have tons of the 8 pin "Arduino" style female headers. Doing that, I can make the wires really short and they are soldered. So each module could have the data bus and address bus in the same spot for RAM/ROM/whatever. And I could then put control buses in a different place. So the amount of arc'd wires should be drastically reduced.

I'm just not looking forward to soldering hundreds of wires. lol

Ugh...the pain of prototyping.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 11, 2016 9:13 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8460
Location: Southern California
cbmeeks wrote:
I've seriously thought about getting some wire-wrap equipment. But that also seems a little expensive. So I mostly have to go with what I already have in stock. :-)

Admittedly, it is a bit expensive.  I suppose it's losing the economy of scale, meaning that with people gradually using less and less, manufacturers have to charge more per socket, hundred feet of wire, etc. to justify continuing production.  Last week I bought a refill on one of my WW wire colors, and couldn't believe the price.  Jameco was best, at $12 per 100 feet.  Mouser's price was several times as much.  WW does allow maximum thru-hole density though, and the thing that probably keeps me doing it most is that you can modify it or add to it after you get it done, unlike a custom PC board.  Errors can be corrected in minutes rather than weeks, and without starting over on the assembly.  Performance can be much better than other prototyping methods, if you do it right.

_________________
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  
PostPosted: Mon Apr 11, 2016 9:20 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
A circuit diagram made by you looking at your circuit as it is now is definitely needed as others have said - even if hand drawn and scanned in.
Also, it may be worth single cycling the circuit. I.e. instead of the entire circuit running at full speed, replace the PHI2 crystal with the following circuit:
Image
The above is from Garth's website and is the fifth image down on this page: http://wilsonminesco.com/6502primer/ClkGen.html
What it does is generate a single 1uS pulse (a clock cycle) per click of a button. You can then use your oscilloscope to measure the buses/signal lines as needed to see if you are getting what is supposed to be there. I.e., the reset vector after reset, etc..


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 11, 2016 9:29 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8230
Location: Midwestern USA
BigEd wrote:
I'd recommend putting something trivial into the ROM so you can get more evidence from the address pins. For example, a loop containing 256 NOPs or 128 LDA #$A9 instructions. Or a tight loop containing just a JSR, so you can monitor page one addresses and the read-write lines doing interesting things.

The other possibility is to build a NOP generator, a design for which is posted somewhere around here. That will cycle through all the addresses and prove that the 65C02 is working.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 11, 2016 9:38 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10834
Location: England
(I believe cbmeeks already did exactly that - see the message after the one you quoted)


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 11 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: