Monday, April 20, 2020

33209: Headwinds -- Project

Chapter 11.5: Headwinds -- Presentation

Chapter 11.6: Headwinds -- Project


"That's the kind of question I think we should all be thinking about and answering for ourselves. The 68008, specifically, isn't available yet, but it might be by the time you get ready to build at that level." I looked over at Ms. Philips and Ms. Steward. "Can you tell us anything about that?"

Ms. Steward consulted with Ms. Philips before responding. "Target dates for production are next year. At this time there are no plans to sample pre-production units to students, but that might change. I was allowed to bring a few of the preliminary datasheets. Should I pass those around?

"Sure." I waited for students to get the datasheets and get a look. "The 68008 will only need 8-bit wide RAM, and it will still be able to handle larger addresses. But it won't handle an address space as large as the 68000, and the 68000's 24-bit addressing gives an address space that is not going to be big enough in a few years. The eight-bit data bus will impact speed, and it may be as slow as the 6809 at similar memory access rates, for stuff that doesn't use a lot of multiplies and divides and doesn't require a lot of memory."

"Some of you might want to use it. Or you might want to use an 8086, or a 9900, or even the upcoming 99000." I glanced over at Dave.

"Sorry." He tilted his head apologetically. "Really can't talk about that yet. But can I pass out literature for the 9900 and 9940?"

"Oh. Definitely. Please. Right now would be a good time to look at some of the other options, which there are lots of."

Jayne helped him get spec sheets and other docs from the backpack hanging on the back of his wheelchair and several students helped pass them out.

"The only issue being programming tools," I added.

"Tools?" Mike was busy studying the 68008 spec sheet, but he didn't miss that.

"If you choose to work with one of the processors I'm working with, I can help you somewhat with the development tools -- program text editors, assemblers, etc.  Dr. Brown has tools that go with the Intel 8080-based trainers that the school already has. Otherwise, you'll have to find other ways to get access to the tools you'll need."

At this, Dave turned to Jayne. "Tools, we can help with, right?"

She nodded. "We can definitely loan a software development system to the school for the 9900 and the 9940. I'm not sure if we can match Motorola on sampling microcontrollers, but I'll see what we can do."

"Thanks," Dr. Brown responded. "Knowing we can access tools may be more important than getting parts to evaluate on the cheap."

Ms. Steward spoke up. "I think Denny mentioned that we will be providing basic tools for the 6805, but I'll check about the 68008."

I responded, "Thanks. I don't particularly want to waste time telling people what to do, and the more CPUs we have reasonable access to, the easier it'll be to avoid copying each other's work. Anyway, I want everyone to have more of a chance to look around and ahead."

While I waited for all of the students to get a good look at the data sheets, I sketched another diagram in an open space on the chalkboards.
 

"As you will recall from last week, this is roughly our first suggested target. Today, Mark and Jeff have been kind enough to prepare some hardware that will give us a good idea of what my thoughts on the first step look like."

"Should we pass our schematics around?" Jeff asked.

"If you think it's okay. There won't be any time for copying the design now, anyway, and we want everyone to make their own. I'll try to be available tomorrow after classes to help everyone who needs help. I think Dr. Brown will be here, too, and maybe Mark and Jeff will be, too."

Mark and Jeff agreed, and Dr. Brown said, "Of course I'll be here, but you all have to remember you need to do the bulk of the work."

"So just get a good look at it and pass it on."

Julia was giving me a look of malcontent.

"Are you going to be here to help, too, Julia?"

"Sure." She smirked at me.

"Ah. Do you have my schematic with you?"

"Oh. Yeah. Let me get that out so we can pass that around, too." She pulled it out of her backpack and handed it to me.

"Thanks." I looked it over, then passed it to Freddie, since she was close. "Mine hasn't been built or tested yet, so take that into account when you look at it."

I noticed Julia's eyes widen just a little.

"What?"

She looked a little embarrassed. "Uhm. Dad helped me build it last night."

I chuckled looked over at Mr. Cisneros. "Thanks, Julia's Dad."

He grinned back. "Sure."

"Stay up late?" I asked Julia

"It only took an hour, with what you had shown me already, and with Dad's help."

"Microcontroller?"

"Socket's ready."

"Should we see if it works?"

"Okay."

"Well, let's  get it ready while Jeff and Mark demonstrate theirs. Jeff, do you want to demonstrate yours first?"

"I got it."

Mark  passed one schematic one direction and the other the other, and Jeff stood up and held his prototype up where everyone could see it.

Mike stood so I could sit down at the computer, and I sat down and loaded the debug environment into the Micro Chroma 68, and thought for a quick second whether I had enough time to write a program to cycle through the numbers. I decided I didn't have time, so, instead, I started typing in a quick program to cycle the segments in the opposite direction from Mark and Jeff's trainers.

"Mark and I've got enough of our kits wired to run a test program that we came up with to scan for a keypress and light the display segments in a cycle."

"Where did you get the keypads?" Suzanne asked.

"There's a surplus store in town. They didn't have very many, though."

"If there's not enough, there's that surplus shop in Austin, too," I pointed out, as I continued typing.

Mr. Cisneros spoke up. "Uhm, Julia?"

"Uh, yeah, Dad. Dad knows the shop Mark and Jeff went to, that's where he got mine. He's arranged for them to get more parts in."

I looked over at Mr. Cisneros and dipped my head. "Thanks."

He grinned again as I turned back to the computer to save the code onto tape and start the assembler.

"No problemo."

"Should I show them what happens?" Jeff asked.

"Sure."

He plugged power into his prototype, and demonstrated pressing the key and letting the display segments light up in cycles a couple of times, and then Mark showed his doing the same.

While they demonstrated, I burned the program I'd written into a spare 68701. As I waited for the ROM programming to complete, I commented to Julia, "I'll show you how it works later. Next program, you get to do."

"Me?" she batted her eyes at me.

I grinned and wished I felt free to reward her with a kiss. Instead, I handed her the 68701. She plugged the MCU in, then connected power. One segment glowed.

"Press any key."

She did so, and the segments cycled as I stood up.

Jeff and Mark were finished demonstrating, so I let Julia demonstrate hers. Then we showed the code we used and explained it.

"How," Freddie asked, "does a microprocessor have time to do anything else, if it's sitting there forever watching the keyboard ports for a key to be pressed?"

"I guess it doesn't." Mark looked at me.

"Let's get a 'scope out and see if we can watch what the processor might be seeing when a key is pressed." We hooked an oscilloscope up to show the voltage on the key Mark had his circuit set up to trigger on.

"What's the fastest speed you've ever heard of someone typing at?"

Julia raised her hand. "Three hundred words per minute is really fast."

"Yeah. And they calculate that at five letters per word, right?"

"Right."

"So how many letters per second?"

Jerry answered quickly, "Three hundred divided by sixty is five words per second."

"That's fast!" Giselle exclaimed.

"Nearly superhuman," I agreed.

Julia was quietly smirking again, and I raised my eyebrows, but she shrugged.

"But we want to talk about boundary limits, anyway. Continue, Jerry?"

"Five times six is thirty keystrokes per second."

"Very good. Who saw what he did, there?"

Pat raised her hand, "Five plus space bar makes six?"

"Right. So, how many milliseconds per keystroke?"

Bob, yet another of the microprocessors class students, said, "Thirty-three."

"Okay, let's set the 'scope for a hundred millisecond sweep and set it to trigger and capture on a pulse."

Jeff said, "I'll get that," and adjusted the oscilloscope.

"I'll hit the key," Julia volunteered. She pressed the key gently, and the oscilloscope recorded the waveform:



"Hmm," Bob was counting rules on the grid. "Eighty milliseconds?"

"Seventy, eighty, that's the way it looks to me. But the part we want to look at is the contact bounce. How long is it bouncing?"

Everyone looked at it, and Suzanne said, "That's the wiggly part, right?"

"Right."

"About ten milliseconds on each end. That's a lot of bounce. Probably too much for 300 words per minute."

"How did you calculate whether it's too much or not?"

"Gotta be stable for longer than it bounces."

"Or," Bob corrected her, "at least as long, and that's a ten millisecond stable shelf between contact and release, which is right at the three hundred words per minute point."

Freddie suggested, "So we put an RC pair on each switch, I guess?"

"Some expensive keyboards have a diode on each keyswitch. I'd say a resistor and a capacitor too isn't completely far-fetched," Dr. Brown joked.

"Let's look at that shelf." I reset the oscilloscope. "Julia, can you do that again, as fast as when you're at cruise speed on the typewriter?"

She raised her eyebrows at me. "Sure."



"Twelve milliseconds," Suzanne reported.

"So, if you set the microprocessor up to look at those every three milliseconds, and take it for a keypress when you get at least three highs in a row followed by at least three lows in a row, would that debounce this keyboard at Julia's cruising speed?"

We spent five minutes or so working out what it meant and some ideas about how it could be done, with help from Dr. Brown, and with students drawing diagrams and doing math, both in their notes and on the chalkboard.

"So," Dr. Brown concluded, "if we have a timer in there, and it gets the CPU's attention about three hundred times a second or so, the processor can debounce the keypad and have a fair amount of time left over for other jobs, right?"

Not everyone was convinced it would work, but the concept had taken hold.

"This kind of thing is what the timer in the 6846 chip in the Micro Chroma 68 might be used for --" I added, "generating a 300 Hz interrupt. The Micro Chroma 68 also has another chip that does timing. What is it?"

Bob responded, "The video generator."

"Exactly. The 6847-based video circuitry has lots of timing circuitry to get the scan lines and frames up and legible, and it can interrupt the CPU for things like this. But the line rate of 15.7 kHz is a bit too fast, and I don't think the 60 Hz field rate interrupt would keep up with Julia. It would probably barely keep up with me at my max of 60 words per minute."

Scattered chuckles.

(These calculations are a bit pessimistic, as is the technique. An interrupt-driven keyboard decoder running at 60 Hz on the Color Computer can easily keep pace with 150 word-per-minute typing, which is good for non-professional typists.)

"Okay, as Ms. Steward has indicated, Motorola is offering to sample us 68705 parts that are similar to these 68701s, but they have a smaller register set and use a slightly different instruction set, which will be especially useful for those who want to ultimately turn their trainers into a dedicated keyboard and keypad controller."

"Do these 68705s have timers built in like the 6801s?"

"I believe so." She dug into spec sheets she hadn't handed out. "Yes, they do. By the way, we've cleared sampling 68701s, as well.  Let me pass out spec sheets for those, too. And I still need to give you the disk with the cross-assembler for the 6805."

"Great. Thanks."

Again, students close to her helped her pass the spec sheets out.

"Your brother will be testing parts that are pulled out of production by quality control, and he'll pass on parts that meet the published specs. They may not overclock very well, but they should be fine for your trainers. We do ask that no one resell these."

"No overclocking? I'm offended!" Bob laughed. "Just kidding. That's way cool."

"What's overclock?" Pat asked.

Jennifer sighed. "It's running a part at frequencies higher than it's rated, just to prove your -- just to prove you're a man or something." She shook her head in amusement and disgust.

"Hey!" Suzanne complained. "It's not just guys. I like to push my parts to see how fast they go."

There were scattered snickers, which I ignored, while I offered a quick prayer for guidance.

"Take it how you want." Suzanne grumbled.

Julia's eyes narrowed as Mike smothered his reaction, and she turned to watch for my response. I noticed Jennifer was also watching me.

"8085 at twelve megahertz?"

"Sixteen. It got a little warm, but it ran. I only tested it for a couple of minutes, though."

Now there was more normal laughter.

I grinned. "I'll take your word for it. Fortunately, decoding a keyboard doesn't require that."

Several students joined her amusement. "Fortunately."

"Before I forget, Dave, is there a timer on the 9940?"

"Of course."

"Great. That'll help us. Well, I think we've covered enough that everyone should be able to make informed choices about which path to pursue from here, whether you want to build a trainer that you turn into a keyboard controller or want to target expanding your trainer into a full computer, letting the main CPU handle the keyboard. And you probably now have some better ideas about what kind of CPU you want for the main CPU."

Larry, also of the microprocessors class, asked. "Can we mix brands? I mean, use a Motorola processor for the keyboard and an Intel processor for the main processor?"

"I'd say that's up to you. Dr. Brown?"

"If you want to do that, I see no reason why not, as long as you or we can get the tools. We don't have tools for the 8086 yet, but that might change if I do a little work. You won't mind helping me with that, will you Joe?"

"I can try. What have you got in mind?"

"We can talk about it later."

"Okay. All right. So, we have a couple of options already, for those who want to go with the Motorola CPUs." I added to the workstation diagram on the chalkboard, showing the two options, one where the keyboard decoding and debounce were off-loaded to a micro-controller, and one where the main CPU controlled the keyboard directly.


George asked, "What's the difference between a keyboard and a keypad?"

Bob joked, "The number of keys."

"That's actually pretty much correct," I confirmed. "With a bit of planning and wiring, the same decode circuit could decode both a full keyboard matrix and a ten-key keypad."

Larry spoke up again and asked, "Does the 6802 in the Micro Chroma 68 decode the keyboard?"

"Nope. That keyboard is decoded with LSI parts, a counter, demultiplexor and several latches. And it has problems with key bounce."

"Yeah, it does." Mark agreed.

I laughed before continuing. "I could still wire a hex keypad into the same switch matrix as the keyboard. The cursor keys, by the way, are outside the keyboard matrix proper, tied directly to individual input bits on a parallel port. Lots of ways to do things."

Julia added, "Giselle's computer's keyboard bounces, too. Is it the same?"

"The Color Computer's main processor, a 6809, directly decodes the keyboard, and, let me just say that I am unimpressed with the code for it. It spends a lot of time just watching the keyboard."

"Who wrote it?" Freddie asked.

I looked at Giselle's screen, and everyone turned to look at it with me. Giselle reached around to the back of the computer and hit the reset button. A number of people stood up to get a better view of the boot-up copyright notices, including members of the three corporate contingents.

There was a kind of collective, "Hmm?"

Freddie asked, "Yeah, but which one wrote it?"


[Backed up at https://joel-rees-economics.blogspot.com/2020/04/bk-33209-headwinds-project.html.]


No comments:

Post a Comment

33209: Discovering the 6800 -- Parents and Polygamy

A Look at the 8080/TOC "Whoa, Merry, look who's here!" Jim said, sotto voce. He, Roderick, and I were at our lab table ...