6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 11:46 pm

All times are UTC




Post new topic Reply to topic  [ 80 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Daryl's 6502 SBC help
PostPosted: Tue Aug 23, 2016 10:04 pm 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
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!


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 23, 2016 11:02 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8544
Location: Southern California
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?


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 24, 2016 12:25 am 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
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!


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 24, 2016 12:33 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8544
Location: Southern California
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?


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 24, 2016 12:45 am 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
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!


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 24, 2016 1:52 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
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!


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 24, 2016 9:38 pm 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
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


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 25, 2016 4:19 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
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!


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 25, 2016 4:25 am 
Offline
User avatar

Joined: Sun Oct 13, 2013 2:58 pm
Posts: 491
Location: Switzerland
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.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 25, 2016 8:50 am 
Offline

Joined: Sat Jul 28, 2012 11:41 am
Posts: 442
Location: Wiesbaden, Germany
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


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 25, 2016 6:52 pm 
Offline

Joined: Wed Sep 02, 2015 7:28 pm
Posts: 63
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!


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 25, 2016 9:56 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
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!


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 25, 2016 10:54 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8544
Location: Southern California
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?


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 26, 2016 4:00 am 
Offline
User avatar

Joined: Sat Dec 07, 2013 4:32 pm
Posts: 246
Location: The Kettle Moraine
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.


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 26, 2016 6:21 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
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!


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 35 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: