Page 1 of 1
65C22 primer, anyone?
Posted: Fri Dec 10, 2021 4:34 pm
by 8bitPogle
Can anyone point me to a good 65(c)22 overview?
I’ve read the data sheet a few times, but it’s not really sinking in.
I can input/output on the peripheral ports without any issues, but I’m not clear on how the timers/interrupts/shift registers etc. All work. What does ‘one shot’ even mean?
Do I have to have an interrupt as the result of a time finishing, or can I just have a ‘wait’ function etc.etc.
A few examples would help, but there doesn’t seem to be much out there that has this sort of info.
Any (pointers) much appreciated
(Geddit?

)
Re: 65C22 primer, anyone?
Posted: Fri Dec 10, 2021 5:22 pm
by BigEd
It's not a primer, but Rodnay Zaks' Advanced 6502 Programming has some 6522 content.
https://archive.org/details/Advanced_6502_Programming
Also perhaps see Chapter 22 of the Advanced User Guide for the BBC Micro:
https://stardot.org.uk/forums/viewtopic.php?t=17242
My feeling is that all the information is in the datasheet, but you might need to see the same thing explained in various ways.
Re: 65C22 primer, anyone?
Posted: Fri Dec 10, 2021 5:30 pm
by BigEd
(And yes, you can choose not to enable interrupts, and just check the appropriate status bit to see if a timer has passed zero.)
One-shot means the timer runs once and then sticks at zero, as opposed to reloading the start count and going around endlessly. (I'm assuming a count-down timer.)
Re: 65C22 primer, anyone?
Posted: Fri Dec 10, 2021 6:00 pm
by Dr Jefyll
Any (pointers) much appreciated
I suggest you acquaint yourself with 65(c)22 datasheets from several different manufacturers. If there's any specific question on your mind, you may find that one manufacturer explains it more clearly than the others. (One of my own favorites is the Rockwell datasheet.)
-- Jeff
Re: 65C22 primer, anyone?
Posted: Fri Dec 10, 2021 7:19 pm
by GARTHWILSON
Shameless plug here. I don't have a primer specifically on the '22, but a lot of the tips in my "Tip of the Day" topic at viewtopic.php?f=7&t=342 are about the '22, not getting into much detail on each but giving ideas of what you can do with it, in some cases with things to look out for, including subtle differences between brands, and subtle things that may be necessary to get a timer running for example. Some of this is repeated in the 6502 primer, where especially the circuit potpourri page shows a lot of things you can do with the '22, with source code linked. Note that with creative sharing of pins, you can interface lots of things at the same time to a single 65c22, something I don't see other people taking advantage of like you'll find in these pages. You may get more ideas from my workbench computers page. There's a little more in my 6502 interrupts primer, in the portions telling how to set up timers for generating interrupts for a realtime clock or arbitrary waveform generator.
WDC's W65C22S is the only '22 version that has truly CMOS inputs on the ports. Even Rockwell's R65C22 presents a substantial load on the pins in input mode, LSTTL IIRC, which I found out the hard way has caused me problems in some of the things I've done with them. WDC's W65C22S (not N) also has super strong output pin drivers, able to even pull up with 19ma at 4.2V, according to my tests!
After all that, if you have more questions, we'll be happy to answer them, and it might lead to expanding or clarifying the material in the above-linked pages.
Re: 65C22 primer, anyone?
Posted: Sun Dec 12, 2021 4:28 pm
by 8bitPogle
Ben Eater’s latest video focuses on using the timer in the 6522, so that’s helped explain some more of the data sheet.
I can have a play with the timers now I have a better idea of how all the registers interact for timer useage.
Re: 65C22 primer, anyone?
Posted: Mon Dec 13, 2021 1:26 pm
by BigEd
For future reference, I'm guessing that's
How do hardware timers work? which, oddly, isn't currently in his "
Build a 65c02-based computer from scratch" playlist (although at time of writing, the most recent two videos are about interrupts.)