Daryl's 6502 SBC help

For discussing the 65xx hardware itself or electronics projects.
beholder
Posts: 63
Joined: 02 Sep 2015

Daryl's 6502 SBC help

Post by beholder »

Hello everyone! It's been a while since I last posted here :)
I started building Daryl's SBC on a protoboard using a mix of soldering/wire wrapping.
Got clock and reset circuit working. 6502 works fine and it's reading ROM.

I wrote a simple test code to output 1s and 0s on the 1st VIA:
Code starts at $8000

LDA #FF
STA $7F52
STA $7F53
LDA #AA
STA $7F50
STA $7F51
JMP $8000

I look at the address bus and I can confirm that the code is running and looping, but instead of storing the accumulator value on to $7F50 its going to $FF50
Shouldn't the above code set the 1st VIA output to 1s and 0s?

Also, for the SBC, I only have a 10uF capacitor between +5 and GND of the power source.
Do I need more capacitors? Maybe a 100uF?

Thanks!
User avatar
GARTHWILSON
Forum Moderator
Posts: 8775
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Daryl's 6502 SBC help

Post by GARTHWILSON »

beholder wrote:
I wrote a simple test code to output 1s and 0s on the 1st VIA:
Code starts at $8000

LDA #FF
STA $7F52
STA $7F53
LDA #AA
STA $7F50
STA $7F51
JMP $8000

I look at the address bus and I can confirm that the code is running and looping, but instead of storing the accumulator value on to $7F50 it's going to $FF50
The code laid down by the assembler should be 8D 50 7F. Make sure its output is putting that in the program. I expect it is; so is there a problem in the address decoding?
Quote:
Shouldn't the above code set the 1st VIA output to 1s and 0s?
Yes, 10101010B for both port A and port B (PA and PB). (You don't need a loop to do it though. The data will stay until you explicitly change it.)
Quote:
Also, for the SBC, I only have a 10uF capacitor between +5 and GND of the power source.
Do I need more capacitors? Maybe a 100uF?
If the regulator is right there on the board, 10uF is enough. If the power source is wired some distance away from the board and its minimum output voltage is bordering on the dropout voltage of the regulator, ie, the voltage that's so low the regulator is almost unable to regulate, then put a bigger capacitor at the regulator's input. For example if you're using a 7805 and you're feeding it with 7.5V with quite a bit of ripple on it, you'll need more capacitance at the input of the regulator. OTOH, if you're feeding it with something like 12 or 13.8V, the lowest voltage in the ripple, plus sags from the loading, will be way above what the regulator needs to output its specified voltage.
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?
beholder
Posts: 63
Joined: 02 Sep 2015

Re: Daryl's 6502 SBC help

Post by beholder »

Hi Garth, thanks for the reply.

Yes, I have A9 50 7F on the rom
Probably address decoding issues.

Im using USB to power up the board. Right now im using my arduino to power the board and generate a slow clock so I can debug.
Im not using a regulator at all.... just USB +5v.
Should I add another capacitor?
Thanks!
User avatar
GARTHWILSON
Forum Moderator
Posts: 8775
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Daryl's 6502 SBC help

Post by GARTHWILSON »

beholder wrote:
Yes, I have A9 50 7F on the rom
Um... not 8D? (A9 is LDA#.)
Quote:
Im using USB to power up the board. Right now im using my arduino to power the board and generate a slow clock so I can debug.
Im not using a regulator at all.... just USB +5v.
Should I add another capacitor?
It wouldn't be a bad idea. The 10uF is ok as long as the loads don't change much so the current remains pretty constant; but especially because of the resistance of the USB cable, go ahead and go for the 100.
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?
beholder
Posts: 63
Joined: 02 Sep 2015

Re: Daryl's 6502 SBC help

Post by beholder »

Oh yeah, my bad.... its 8D 50 7F

code is A9 FF 8D 52 7F 8D 53 7F A9 AA 8D 50 7F 8D 51 7F 4C 00 80

Loop is there so I can test 6502 is reading the rom, plus I can re watch the entire thing to troubleshoot.

Im going to check both room and my address decoding.
VIA 1 is not being selected because FF50 has A15 high, thus is activating the ROM and not I/O
Maybe a bad connection is causing the 6502 to read FF instead of 7F

Thanks!
User avatar
BigDumbDinosaur
Posts: 9428
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Daryl's 6502 SBC help

Post by BigDumbDinosaur »

beholder wrote:
VIA 1 is not being selected because FF50 has A15 high, thus is activating the ROM and not I/O
Maybe a bad connection is causing the 6502 to read FF instead of 7F
Can you post your circuit so we can help you out with finding the decoding error?
x86?  We ain't got no x86.  We don't NEED no stinking x86!
beholder
Posts: 63
Joined: 02 Sep 2015

Re: Daryl's 6502 SBC help

Post by beholder »

Hi BDD.

The circuit is the same as Dary's SBC: http://sbc.rictor.org/info2.html
but I'm not using the max232, instead Im gonna use a ftdi ttl to usb.
Address decoding is exactly the same as sbc. I've been testing the connections and everything seems to be properly connected.

I can take a photo but its a mess of wire wrap + soldering and hard to see whats going on.

I also noticed the reset is being triggered, probably bec the voltage on the board is unstable.
I have an arduino as the power source and clock + a bunch of leds hooked up to the address bus.

Im gonna try replacing the capacitor to 100uF , right now i only have 10uF
User avatar
BigDumbDinosaur
Posts: 9428
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Daryl's 6502 SBC help

Post by BigDumbDinosaur »

beholder wrote:
I also noticed the reset is being triggered, probably bec the voltage on the board is unstable.
I have an arduino as the power source and clock + a bunch of leds hooked up to the address bus.
Try using a wall wart to power it and see if that helps. It could be that Arduino doesn't have enough oomph.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
cbscpe
Posts: 491
Joined: 13 Oct 2013
Location: Switzerland
Contact:

Re: Daryl's 6502 SBC help

Post by cbscpe »

I suspect that something ties A15 to Vcc or it is connected to an output. Can you disconnect A15 from the CPU and check if it goes low, measured at the CPU pin, when going through the loop? Or it could be the other way around. A15 from the CPU does not make it to the decoder and so the decoder thinks this signal is always high, especially when there is a TTL component that's the default.
Klaus2m5
Posts: 442
Joined: 28 Jul 2012
Location: Wiesbaden, Germany

Re: Daryl's 6502 SBC help

Post by Klaus2m5 »

Do you have bypass capacitors per each IC? Daryl doesn't mention any, but in a mess of wires they are required!
6502 sources on GitHub: https://github.com/Klaus2m5
beholder
Posts: 63
Joined: 02 Sep 2015

Re: Daryl's 6502 SBC help

Post by beholder »

Thanks for all the replies.

I replaced the 10uF capacitor with a 100uF and it works great now.
I do have a .1uf capacitor for each ic, including the address decoder ics.

So after a long night testing all data and address pins I found out that there was a connection between A15 and D0 :(
I couldn't trace the connection and ended up removing all my wire wrapping... bummer :(

At this stage im highly considering ordering a custom pcb, but im sure I'll ended up having a flaw in the pcb :D

I'm gonna re-wire my board this weekend and I will keep you guys posted.
Thanks!
User avatar
BigDumbDinosaur
Posts: 9428
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Daryl's 6502 SBC help

Post by BigDumbDinosaur »

beholder wrote:
At this stage im highly considering ordering a custom pcb, but im sure I'll ended up having a flaw in the pcb :D
There are ways to assure that your PCB is correct. It's been quite a while since I designed a PCB with an error that was a show-stopper.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
GARTHWILSON
Forum Moderator
Posts: 8775
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Daryl's 6502 SBC help

Post by GARTHWILSON »

The checking method I use, which has shown itself to be 100% reliable so far, on many complex boards, is described at viewtopic.php?p=17653#p17653 .
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?
User avatar
KC9UDX
Posts: 246
Joined: 07 Dec 2013
Location: The Kettle Moraine

Re: Daryl's 6502 SBC help

Post by KC9UDX »

BigDumbDinosaur wrote:
beholder wrote:
At this stage im highly considering ordering a custom pcb, but im sure I'll ended up having a flaw in the pcb :D
There are ways to assure that your PCB is correct. It's been quite a while since I designed a PCB with an error that was a show-stopper.
I agree. I seem to remember scrapping one with some egregious error, but don't recall what it was.

The worst mistake I ever made on a PCB was laying out a dozen or so ICs upside down. :oops: :evil: Even that wasn't the end of the world. Some chips I inverted the pins on, some I soldered to the other side of the board, and the ones that needed to be socketed, I wired the socket away from the board. It looked utterly terrible when it was done, but it worked. Luckily no one but me ever had to look at it.
User avatar
BigDumbDinosaur
Posts: 9428
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Daryl's 6502 SBC help

Post by BigDumbDinosaur »

KC9UDX wrote:
BigDumbDinosaur wrote:
beholder wrote:
At this stage im highly considering ordering a custom pcb, but im sure I'll ended up having a flaw in the pcb :D
There are ways to assure that your PCB is correct. It's been quite a while since I designed a PCB with an error that was a show-stopper.
I agree. I seem to remember scrapping one with some egregious error, but don't recall what it was.

The worst mistake I ever made on a PCB was laying out a dozen or so ICs upside down. :oops: :evil: Even that wasn't the end of the world. Some chips I inverted the pins on, some I soldered to the other side of the board, and the ones that needed to be socketed, I wired the socket away from the board. It looked utterly terrible when it was done, but it worked. Luckily no one but me ever had to look at it.
Anyone who uses ExpressPCB's software can download and install xCheck, which will analyze your schematic and PCB for errors. I've fooled around with xCheck quite a bit and so far, it has never failed in finding errors or questionable items. PCBs that pass xCheck tests have a high probability of working, assuming the circuit design is correct.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
Post Reply