Page 1 of 1
WDC65C22 Help for a newb
Posted: Fri Nov 29, 2019 3:04 pm
by nickfolino
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
Re: WDC65C22 Help for a newb
Posted: Fri Nov 29, 2019 3:07 pm
by BitWise
Unless you have loaded constants into memory at $0000 and $00ff your code is missing two #'s
Code: Select all
8000 LDX #$FF
8002 STX $2000
8005 LDX #$00
8007 STX $2002
800A INX
800B JMP $8007
Re: WDC65C22 Help for a newb
Posted: Fri Nov 29, 2019 3:12 pm
by BigEd
Welcome Nick! Is it possible you've misconnected the databus to the 6522?
Re: WDC65C22 Help for a newb
Posted: Fri Nov 29, 2019 3:21 pm
by nickfolino
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
Re: WDC65C22 Help for a newb
Posted: Fri Nov 29, 2019 3:23 pm
by BitWise
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.
Re: WDC65C22 Help for a newb
Posted: Fri Nov 29, 2019 3:32 pm
by Dr Jefyll
The signal I would expect to find on PB5 is on PB6, PB6 is on PB7 and I cannot find PB7 output.
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
Re: WDC65C22 Help for a newb
Posted: Fri Nov 29, 2019 3:33 pm
by nickfolino
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?
Thanks for your help!
Nick
Re: WDC65C22 Help for a newb
Posted: Fri Nov 29, 2019 3:51 pm
by nickfolino
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.
Re: WDC65C22 Help for a newb
Posted: Fri Nov 29, 2019 11:05 pm
by BigDumbDinosaur
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.