6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Tue Nov 12, 2024 5:54 am

All times are UTC




Post new topic Reply to topic  [ 256 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7 ... 18  Next
Author Message
PostPosted: Tue Apr 26, 2022 10:32 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8539
Location: Southern California
Paganini wrote:
I don't suppose any of you might be planning to attend the upcoming VCF in Atlanta?

No. I don't travel much, and I decided in 2017 that I was done flying, because of the abuses of the TSA. I don't know if my cello has ever been on an airplane. I've heard horror stories of cello damage on planes. I would someday like to go to a VCF though, if there's one nearby.

Quote:
GARTHWILSON wrote:
I see you have a TXA, PHA above, later followed by PLA, TAX. Are you limited to the NMOS instruction set?

I have two types of 6502, at the moment. One is the modern 14Mhz WDC65C02; the other type is old, 4Mhz, made by California Micro Devices. In theory it's a clone of the Rockwell 65C02s of the same era, but I haven't been able to find a datasheet for it, and I haven't tested to see what it does if you feed it the "new" WDC instructions.

If it's CMOS (probably with the designation G65SC02P-4), it has all the CMOS instructions except the ones Rockwell added and WDC later adopted, namely BBS, BBR, SMB, and RMB, and the ones WDC added, STP and WAI. You can find the data sheets on this site. The new op codes seem to have survived the scan better in the data sheet at http://6502.org/documents/datasheets/cm ... family.pdf than in the one at http://6502.org/documents/datasheets/cm ... ar2000.pdf .

Quote:
Garth, I notice you're located in southern CA; you wouldn't happen to know Richard Levine by any chance? He's a cellist with the San Diego Symphony, and also a fan of the 6502. I believe he got his KIM-1 back when KIM-1s were a brand new market player. :)

No, I'm about 120 miles north of there (although I've ridden bike to San Diego about 20 times, and then I come back in the afternoon on the train). It's nice he's a 6502 enthusiast too. The local professional orchestra here is the Rio Hondo Symphony. People have asked my why I don't join. I can probably improvise and compose better than any of them, but as far as skill to play their literature goes, I think I'd occasionally find spots I wouldn't be able to with any amount of practice.

Quote:
Thanks everyone for all the material on delays. I like the idea of doing it with a timer, for not the least reason that I have no idea how those VIA timers work, and this seems like a good opportunity to learn. In the long term (once I get some basic I/O up and running on this thing) my plan for Blue April is to go through the XINU book and make a little multitasking OS. I will no doubt need those VIA timers to implement something resembling a RTC when I do that. I'll combine my subroutines into one of the snazzy seedable ones from up-thread first so I have a working backup.

I have an article on simple methods for multitasking without a multitasking OS, for systems that lack the resources for a multitasking OS, or where hard realtime requirements might rule one out anyway, at http://wilsonminesco.com/multitask/ . It includes code for servicing interrupts from a VIA's T1 to run an RTC including alarms; and there's more in about the middle of my 6502 interrupts primer, at http://wilsonminesco.com/6502interrupts/ .

_________________
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: Tue Apr 26, 2022 10:43 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
Paganini wrote:
Thanks everyone for all the material on delays. I like the idea of doing it with a timer, for not the least reason that I have no idea how those VIA timers work, and this seems like a good opportunity to learn. In the long term (once I get some basic I/O up and running on this thing) my plan for Blue April is to go through the XINU book and make a little multitasking OS. I will no doubt need those VIA timers to implement something resembling a RTC when I do that. I'll combine my subroutines into one of the snazzy seedable ones from up-thread first so I have a working backup.

Sounds sensible. The VIA timers are pretty easy to use when you get your head around the latching, and you can still either poll for them to complete or use interrupts. In addition to Garth's links there are a few simple examples here: http://www.6502.org/source/io/6522timr.htm (though there's a bug in the Timer 1 one-shot example, can you spot it?)


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 26, 2022 10:55 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8539
Location: Southern California
Be sure to see my Tip of the Day column too, which includes lots of tips on using the VIAs' timers.

_________________
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 Apr 27, 2022 12:22 am 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 490
Paganini wrote:
the other type is old, 4Mhz, made by California Micro Devices. In theory it's a clone of the Rockwell 65C02s of the same era, but I haven't been able to find a datasheet for it, and I haven't tested to see what it does if you feed it the "new" WDC instructions.


Hey! I found the datasheet for my G65SC02 in the 6502.org documents archive while I was poking around looking for delay and timer stuff. (I wonder how come Google doesn't know it's in there?) Looks like it does support the "new" instructions. Hooray!

Edit: LOL, I see Garth already posted a link to the very PDF I'm looking at.

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 27, 2022 1:31 am 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 490
gfoot wrote:
In addition to Garth's links there are a few simple examples here: http://www.6502.org/source/io/6522timr.htm (though there's a bug in the Timer 1 one-shot example, can you spot it?)


Is the bug that the text seems to suggest the two routines are different, when they're exactly the same except for the last instruction? (Which the text seems to suggest should be the same when it says "The rest of the program is identical.")

Edit: (I'm guessing, more specifically, that that last instruction should be a read from the low order counter, just like for Timer 2, in order to clear the interrupt flag.)

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 27, 2022 5:42 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8482
Location: Midwestern USA
Paganini wrote:
GARTHWILSON wrote:
Paganini, I play cello, and Dr Jefyll and BigDumbDinosaur here play bass.

Great! I don't suppose any of you might be planning to attend the upcoming VCF in Atlanta?

I am so far out of the loop on those acronyms. :D What is VCF?

Quote:
GARTHWILSON wrote:
I see you have a TXA, PHA above, later followed by PLA, TAX. Are you limited to the NMOS instruction set?

I have two types of 6502, at the moment. One is the modern 14Mhz WDC65C02; the other type is old, 4Mhz, made by California Micro Devices. In theory it's a clone of the Rockwell 65C02s of the same era, but I haven't been able to find a datasheet for it, and I haven't tested to see what it does if you feed it the "new" WDC instructions.

All 65C02s, regardless of manufacturer, have the PHX/PLX and PHY/PLY instructions. WDC 65C02s have two unique instructions, STP and WAI. STP is something that is very rarely used (it stops the internal clock) and WAI is rarely used in a general purpose operating environment. The main advantages of using the WDC 65C02 are it’s in current production, it can be run at very high speeds—beyond 20 MHz if the rest of the system can support it, and is fully static, which means it can tolerate a very wide range of clock speeds, all the way down to 0 Hz. :D

Quote:
The 6502 Assembly Language Programming book by Levinthal *is* limited to the NMOS instruction set, which is what I've been using as my reference. Kind of a period practice for retrocomputing. :)

Sounds as though you have the first edition, which Dr. Leventhal wrote in the late 1970s. He subsequently updated the book in the early 1980s after WDC had released the 65C02 design for production. That second edition covers the new 65C02 instructions.

Quote:
BigDumbDinosaur wrote:
There aren't any videos of me floating down a river, but there is one of my jazz trio making like a garage band during COVID lockdown. It was our first try at playing “Laura,” the “first try” aspect being painfully audible at times.

You guys sound great!

Thanks! It needed some work at the time, but we slugged away at it and got it sounding right.

Quote:
I did a little jazz back in my student days, but I was never any good at it. I find the lack of immediate structure very intimidating.

Funny you mention that.

Every so often, we (the Trio) have musicians sit in with us. One of them is a violinist, Emily, who graduated from the Wheaton School of Music a few years ago. At the time, Frank (the guitarist on the left in the video) and I were recruited to be her “backing band” for one of the numbers she did at her recital, which was “Minor Swing” by Django Reinhardt. She had never had an occasion to play jazz, especially “gypsy jazz,” let alone improvise in the jazz idiom.

Improvisation is part of what makes jazz jazz, so Frank, Emily’s professor and I set up an informal jam session so she could get some experience in pulling music out of her hat. Once she got comfortable with it we turned to fleshing out “Minor Swing,” of which only about 50 percent is written out. The rest of it is all improvisation.

The night of her recital after she had played her three classical selections (notably, Tchaikovsky's “Spring” was one of them, a difficult piece to do well), we got on stage and played “Minor Swing.” While Frank and I were doing our solos, Emily put in some very good riffs and fills, and did a great improv on the melody at the end. She got enthusiastic applause for her classical selections—and a standing ovation for “Minor Swing.” :D

Now, when Emily sits in with us she blends right in. She’s really gotten into the jazz idiom and the apparent lack of structure.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 27, 2022 5:48 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8539
Location: Southern California
BigDumbDinosaur wrote:
I am so far out of the loop on those acronyms. :D What is VCF?

Vintage Computer Festival.

_________________
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 Apr 27, 2022 6:34 am 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
Paganini wrote:
gfoot wrote:
In addition to Garth's links there are a few simple examples here: http://www.6502.org/source/io/6522timr.htm (though there's a bug in the Timer 1 one-shot example, can you spot it?)


Is the bug that the text seems to suggest the two routines are different, when they're exactly the same except for the last instruction? (Which the text seems to suggest should be the same when it says "The rest of the program is identical.")

Edit: (I'm guessing, more specifically, that that last instruction should be a read from the low order counter, just like for Timer 2, in order to clear the interrupt flag.)

The bug I saw was that it's still testing bit 5 of the IFR, which is Timer 2's bit - it should be testing bit 6, i.e. "LDA $40" or by using BVS.

As you spotted though, it's also reading the wrong register to clear the interrupt flag. It can be confusing which registers and operations do or don't clear the flag, and it may be simpler to just write to the IFR to clear it, given that the right data ($40) would already be in the accumulator in this case.


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 27, 2022 7:28 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Thanks Garth for posting Bruce's delay code. That really is very slick: the effect of nested loops without any nesting.


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 27, 2022 1:57 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 490
BigDumbDinosaur wrote:
Now, when Emily sits in with us she blends right in. She’s really gotten into the jazz idiom and the apparent lack of structure.


Cool story! That pretty much nails the difference, I think. Jazz musicians find that lack of structure freeing and even exhilarating. There used to more improvisation in classical music, but nowadays mostly only baroque keyboard players learn to do it. It's a shame we've let those skills fade!

BigEd wrote:
Thanks Garth for posting Bruce's delay code. That really is very slick: the effect of nested loops without any nesting.


Yeah. I stared at those 4 instructions for a LONG time yesterday.

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Thu May 05, 2022 5:35 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 490
The module with the integrated breadboard in the photo upthread is called an "RC6502 Project Platform." Since my LCD is now working properly, I wanted to get it off the breadboard, giving it a more permanent home, and freeing up breadboard space for the next project (keyboard interface).

At some point (I think because PCBWAY gave me a coupon), I ordered a whole stack of RC6502 prototyping boards. These are just plated through hole perf board with the RC6502 bus along the bottom edge, a VCC rail up the left side, a GND rail across the top, and a "custom bus" down the right side. I figured this would be a good place to build an LCD board for Blue April. This did not go well. Turns out I had the wrong kind of wire, the wrong kind of solder, and the wrong kind of IC sockets. After several false starts, ruining several of the prototyping boards (no big deal, I have 10 of them!) and melting some IC sockets (no big deal, they're cheap) yesterday I plugged in the third try, and saw "OK" flash up on the LCD. I have to say, in spite of all that frustration (or maybe because of it), the sense of triumph for completing this relatively standard and straightforward project was very satisfying. :)

Attachment:
20220505_131011.jpg
20220505_131011.jpg [ 3.65 MiB | Viewed 1161 times ]


Attachment:
20220505_131034.jpg
20220505_131034.jpg [ 3.68 MiB | Viewed 1161 times ]

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Thu May 05, 2022 5:57 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 718
Location: Texas
Looks great! That's how I started soldering too: the hard way. You learn more from mistakes, so that will pay off in the future for sure. It looks good, and functions well!

For the keyboard interface, have you watched the Ben Eater series on PS/2 keyboard interfacing? I really liked his videos, and I used them to model my own keyboard interface.

What's next after keyboard? VGA display? :)

Chad


Top
 Profile  
Reply with quote  
PostPosted: Thu May 05, 2022 6:24 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 490
sburrow wrote:
Looks great! That's how I started soldering too: the hard way. You learn more from mistakes, so that will pay off in the future for sure. It looks good, and functions well!


I find that soldering wires to things (IC socket pins, for example) is much trickier than soldering things onto PCBs. Wire wrap is much to be preferred; unfortunately I didn't have the right IC sockets for wire wrap, so I had to do a kind of hybrid (wire wrap on one end, solder on the other). Someone in a different thread recently posted a link to Phoenix Enterprises; they seem to have a nice selection of wire wrap sockets at affordable prices. Dunno why they didn't come up in my google searching. Anyway, I'll stock up on them for the next thing.

Quote:
For the keyboard interface, have you watched the Ben Eater series on PS/2 keyboard interfacing? I really liked his videos, and I used them to model my own keyboard interface.


I have, and as you say, I plan to use them as the starting point for my own interface.

Quote:
What's next after keyboard? VGA display? :)


Definitely video, but I think not VGA. Real VGA seems like pie-in-the-sky to me; the VGA implementations I know of either use modern microcontrollers (which I want to avoid) or use acres of breadboards / logic chips. I also don't want to do a kind of crippled VGA like Ben Eater's "worst video card in the world."

I have some interesting old CRT controller chips (Hitachi "6845s", Intel 8275) and Gerry Kane's "CRT Controller Handbook." What I'd like to do is make a true retro-style composite video out using one of those. I like the idea of making, basically, a terminal emulation board with powerful text capability (the 8275 should be particularly good for this) without worrying about graphics / sprites / colors and so on. There is a VDU board for the RC6502, but it's based on the 6847, which I don't have a spare of, and which I dislike a bit, from using it in my CoCo2.

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Thu May 05, 2022 7:49 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 718
Location: Texas
Paganini wrote:
Definitely video, but I think not VGA. Real VGA seems like pie-in-the-sky to me; the VGA implementations I know of either use modern microcontrollers (which I want to avoid) or use acres of breadboards / logic chips. I also don't want to do a kind of crippled VGA like Ben Eater's "worst video card in the world."

I have some interesting old CRT controller chips (Hitachi "6845s", Intel 8275) and Gerry Kane's "CRT Controller Handbook." What I'd like to do is make a true retro-style composite video out using one of those. I like the idea of making, basically, a terminal emulation board with powerful text capability (the 8275 should be particularly good for this) without worrying about graphics / sprites / colors and so on. There is a VDU board for the RC6502, but it's based on the 6847, which I don't have a spare of, and which I dislike a bit, from using it in my CoCo2.


If you are ok using those kinds of chips, all the better. Everyone has a particular flavor they are comfortable with. I'm sure you have heard from George (gfoot), he is kind of like my 'video expert', and he has Youtube videos on different variations/chips he has used to generate video signal.

But like you are saying, if you are going to "do it right" you shouldn't settle for a crippled version. Maybe as a stepping stone though? My first TTL VGA used only 4 colors, now I'm playing with 16. That isn't the biggest upgrade, but getting something onto the monitor is step 1. Making it functional is step 2.

Thanks!

Chad


Top
 Profile  
Reply with quote  
 Post subject: Hardware Interrupts
PostPosted: Wed May 25, 2022 9:08 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 490
I'm getting some unexpected interrupt behavior - specifically, constantly spamming of interrupts.

Currently, I have things wired up like this:

Attachment:
20220525_164358.jpg
20220525_164358.jpg [ 3.02 MiB | Viewed 1080 times ]


VIA1 is on the LCD board; it isn't generating any interrupts, but I did wire up it's IRQ pin to the bus (don't know why I did that).

VIA0 is on my prototyping board; I want it to generate an interrupt when CA1 transitions. In the long run I want to use it to generate keyboard interrupts, but for now a momentary push-button will be fine. :) Before I start blaming my software, I want to make sure I understand how the hardware works.

I read in the Primer that you can't wire-or multiple 'S' version VIAs together to have multiple interrupt source, which appears to be what I've done. However, only VIA0 needs to actually generate interrupts, so, in a pinch, I can just cut the IRQ line on the LCD board if that's what's causing the problem.

However, it seems like what's described in the primer is that when two 'S' VIAs are wire-ored together, VIA0 will try to pull IRQ low, but VIA1 will keep it high, preventing the interrupt form being issued. IOW, I'd expect to see *NO* interrupts; instead I have the opposite problem - constant interrupts! This happens even if CA1 isn't hooked up to anything.

I want to double-check my understanding before I start cutting wires.

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


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

All times are UTC


Who is online

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