6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Oct 05, 2024 10:30 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: WDC65C22 Help for a newb
PostPosted: Fri Nov 29, 2019 3:04 pm 
Offline

Joined: Fri Nov 29, 2019 2:37 pm
Posts: 4
This is my first time trying to use a 6522. I was getting unexpected output results that I couldn't nail down. So I'm testing in a very basic setup now. I have a 6502 that is counting from 0 to 255 in a never ending loop. What I've found is that the 6522 pins PB4 and PB5 always output the same signal. For instance when it counts to $10 both bins PB4 and PB5 output a high. The signal I would expect to find on PB5 is on PB6, PB6 is on PB7 and I cannot find PB7 output. I switched this counting program to Port A and get the same thing. I also swapped in another 65c22 and get the same behavior. I only have 2 chips, both from the same Mouser order. Am I doing something wrong or could I have gotten bad chips?

Here's the simple program I'm using to test (ROM at $8000, 6522 at $2000):
8000 LDX $FF
8002 STX $2000
8005 LDX $00
8007 STX $2002
800A INX
800B JMP $8007

It's being clocked at about 10Hz from a 555. I have LEDs connected to the PB0-PB7 outputs. RW connected directly to 6502 RW. PHI2 connected to PHI20 on the 6502. All data ports and RS lines connected directly to 6502.

Any ideas where to look would be most appreciated.

Nick


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 29, 2019 3:07 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
Unless you have loaded constants into memory at $0000 and $00ff your code is missing two #'s
Code:
8000 LDX #$FF
8002 STX $2000
8005 LDX #$00
8007 STX $2002
800A INX
800B JMP $8007

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Last edited by BitWise on Fri Nov 29, 2019 3:18 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 29, 2019 3:12 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10949
Location: England
Welcome Nick! Is it possible you've misconnected the databus to the 6522?


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 29, 2019 3:21 pm 
Offline

Joined: Fri Nov 29, 2019 2:37 pm
Posts: 4
BitWise wrote:
Unless you have loaded constants into memory at $0000 and $00ff your code is missing two #'s


That was just me forgetting them in the post. The code on the EEPROM is A2 FF and A2 00.

Nick


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 29, 2019 3:23 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
nickfolino wrote:
BitWise wrote:
Unless you have loaded constants into memory at $0000 and $00ff your code is missing two #'s


That was just me forgetting them in the post. The code on the EEPROM is A2 FF and A2 00.

Nick

Ok. Then check your wiring for shorts.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 29, 2019 3:32 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
nickfolino wrote:
The signal I would expect to find on PB5 is on PB6, PB6 is on PB7 and I cannot find PB7 output.
Quote:
It's being clocked at about 10Hz from a 555.
The 555 isn't really appropriate, for reasons explained in this thread (which doesn't pertain to 6502, but several of the comments do have a 6502 context).

Clocking with a signal whose rise/fall times are too slow could easily cause erratic operation. Possibly that explains the trouble you're experiencing. I suggest you either add a Schmitt trigger (as suggested in the other thread) or replace the 555 with something more suitable.

BTW, some photos of your project might be helpful. And remember, on this forum you're allowed to attach images with your post. :)

Have fun, and keep us posted,
Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Last edited by Dr Jefyll on Fri Nov 29, 2019 3:33 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 29, 2019 3:33 pm 
Offline

Joined: Fri Nov 29, 2019 2:37 pm
Posts: 4
BigEd wrote:
Welcome Nick! Is it possible you've misconnected the databus to the 6522?


Yep. It's possible. And it was the problem. Guess I need to find old guy breadboards. Do they come a large print version? :lol:

Thanks for your help!

Nick


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 29, 2019 3:51 pm 
Offline

Joined: Fri Nov 29, 2019 2:37 pm
Posts: 4
Dr Jefyll wrote:
The 555 isn't really appropriate, for reasons explained in this thread (which doesn't pertain to 6502, but several of the comments do have a 6502 context).


Thanks. The actual circuit uses a clock oscillator. I was using the 555 to slow it down for troubleshooting.


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 29, 2019 11:05 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8411
Location: Midwestern USA
nickfolino wrote:
Dr Jefyll wrote:
The 555 isn't really appropriate, for reasons explained in this thread (which doesn't pertain to 6502, but several of the comments do have a 6502 context).


Thanks. The actual circuit uses a clock oscillator. I was using the 555 to slow it down for troubleshooting.

Take a look on Garth Wilson's site for an example of a clock circuit that can be single-stepped. That's an often-useful way to track down hardware problems that are transient in nature.

_________________
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  [ 9 posts ] 

All times are UTC


Who is online

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