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
WDC65C22 Help for a newb
- BitWise
- In Memoriam
- Posts: 996
- Joined: 02 Mar 2004
- Location: Berkshire, UK
- Contact:
Re: WDC65C22 Help for a newb
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
Last edited by BitWise on Fri Nov 29, 2019 3:18 pm, edited 1 time in total.
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
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
Re: WDC65C22 Help for a newb
Welcome Nick! Is it possible you've misconnected the databus to the 6522?
-
nickfolino
- Posts: 4
- Joined: 29 Nov 2019
Re: WDC65C22 Help for a newb
BitWise wrote:
Unless you have loaded constants into memory at $0000 and $00ff your code is missing two #'s
Nick
- BitWise
- In Memoriam
- Posts: 996
- Joined: 02 Mar 2004
- Location: Berkshire, UK
- Contact:
Re: WDC65C22 Help for a newb
nickfolino wrote:
BitWise wrote:
Unless you have loaded constants into memory at $0000 and $00ff your code is missing two #'s
Nick
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
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
Re: WDC65C22 Help for a newb
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.
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
Last edited by Dr Jefyll on Fri Nov 29, 2019 3:33 pm, edited 1 time in total.
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
-
nickfolino
- Posts: 4
- Joined: 29 Nov 2019
Re: WDC65C22 Help for a newb
BigEd wrote:
Welcome Nick! Is it possible you've misconnected the databus to the 6522?
Thanks for your help!
Nick
-
nickfolino
- Posts: 4
- Joined: 29 Nov 2019
Re: WDC65C22 Help for a newb
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).
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: WDC65C22 Help for a newb
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).
x86? We ain't got no x86. We don't NEED no stinking x86!