Wednesday, April 29, 2020

33209: Headwinds -- Fixes

Chapter 11.7: Headwinds -- License

Chapter 11.8: Headwinds -- Fixes


Ms. Bight looked over at Mr. Goldwater, and Mr. Goldwater tilted his head in acknowledgement. "I think," he said, "although nothing you've covered so far is really news to IBM, we should probably have a similar discussion at some time."

"I guess I can do that."

"By the way, how is your little exercise in masochism coming?"

"Ehhh?" I had to think about that a moment. "Ah, you're referring to the floppy controller."

"Right."

"Do you want to see what I showed Ms. Bight?"

"No, going back over that won't be necessary."

"Current status is not-quite-there-yet. I have hardware to write in true MFM, and routines to tracks and sectors, so I should be able to format a disk for Giselle's Color Computer. But the Color Computer doesn't recognize the formatted disk. And my controller doesn't recognize tracks laid down by the Color Computer."

"Alignment?"

"I think I've got that taken care of."

"Let's see you prove it."

I looked around and addressed the students. "Uh, this isn't directly related to the project, and I think we've covered a lot of ground on the project today. So if anyone needs to go now, go ahead."

Suzanne said, "If Mark and Jeff are willing to walk me through how they put their designs together, I'd like to see that before I go."

"Are you guys up for that?"

Mark and Jeff looked at each other and nodded.

Mark said, "You talk about how showing stuff to others helps you learn it better yourself. I'm willing to try it."

Jeff added, "I'm game, too."

"But I also want to watch while you work on your floppy controller." Suzanne raised her eyebrows apologetically.

"So you could keep an eye on what we do with the floppies while you work on your trainer design?"

"I could probably do that."

"Okay. And anyone who wants to leave, somebody will take notes."

"Oh." Mom stood up. "That's me. Your papers should be coming soon."

Dad stood up, too. "I will help you," he said to Mom in his pseudo-mock seriousness.

"Thanks for coming, Mom, Dad."

"Wouldn't have missed it, Hon. See you at home."

"Do the good, son."

And they left, along with most of the school board members. None of the students left.

Jeff asked, "So who wants to get started working on your trainers?"

Several students said they did, so Mark and Jeff moved around to help them.

Ms. Steward asked, "Joe, are you going to design another of those trainers for yourself?"

"I'm thinking I'll design one with the 6805, as a keyboard controller, since Julia already built the design she helped me put together. But, I need to get Flex running first."

Julia was sitting near me, in front of the computer, and gave me a quiet sideways kick.

"Hey. I'm glad you built it. And it gives me an excuse to do another."

She crinkled her eyebrows in a smirk.

"Hah. Well, let's look at your floppy controller," Ms. Steward prompted me

Julia and Giselle helped me demonstrate the parts of the controller I had gotten working, showing how the controller and drive were able to address track and sector, how I had used floppies written by the Color Computer to align my drives, and how the floppies formatted with the 68701 controller on the Micro Chroma 68 were not yet compatible with those the Color Computer produced.

Mr. Wells asked, "Do you have an idea what's wrong?"

"Nothing clear, but the first thing I'm going to try is using the Micro Chroma to get a raw read of a track written by the Color Computer drive. That'll tell us a lot. Ran out of time for it last night."

Julia murmured, "Sorry."

"For what?"

"Taking your time last night."

"I'm not sorry. It was a good homework session." I wasn't sure if it was Ms. Bight or Ms Philips or Suzanne that snickered, but I ignored it, and it seemed Julia did, as well. I was pretty sure it was Mike that said, "Hmph." But both Julia and I ignored that, too.

"Let's see what that raw read looks like."

Using the programs and circuits that I had put together earlier, I used Giselle's disk drive with the Micro Chroma 68 and my controller to write full tracks at track zero, track 18, and track thirty-five, then used my drive to read the tracks back without dividing them in sectors, to make sure that what was written was exactly what was read back. I explained that it was not proof that my drives and heads were correctly aligned, but that it did raise my confidence level that the alignment was close to the Radio Shack drive's alignment.

Then I read the first track on a floppy formatted by the Color Computer and on a floppy formatted by the Micro Chroma 68. Comparing the tracks, it quickly became apparent to me that my controller might be writing the sectors too early.

"Ah." I showed the track read results to those who were watching at the time. "See that? My calculations for the timing to reach each sector is a bit quicker than the timing for the Western Digital controller."

Then I set an oscilloscope up to trigger on the end of a sector, and confirmed for myself that, to match the WD controller in the Tandy drive, my controller needed to wait about fourteen micro-seconds longer in the disk rotation before starting a sector write, and wait about that much longer before giving up on a sector read.

I showed the timing signal patterns on the scope, then showed the source code for the section that set the timing up.

To make sure, I dug back in the magazine articles I had about industry practices for floppy drives.

"I seem to have misread this. It looks like it should be safe to match the Tandy drive."

Some of the students were not seeing what was happening, so I quoted from the articles and wrote more test data and showed more measurements.

Wallace asked, "Can you fix it?"

"I guess I can."

I rewrote the sector timing code, burned it into another 68701 to avoid waiting for the EPROM eraser to finish, and also to keep the old version around for reference. I plugged the newly burned 68701 into the drive controller board, and used it to format a new disk on the Micro Chroma 68.

Then I used the newly formatted disk to save and load files on the Color Computer, and the students watching cheered when the files came back successfully.

Ms. Bight looked surprised. "You managed to construct an empty directory?"

"The Color Computer Disk BASIC just assumes that empty directory sectors are an empty directory, so simply formatting everything blank is enough."

"Oh. Simple is useful."

"Sometimes."

Everyone watched while the Micro Chroma 68, with the later timing in the read, successfully read individual sectors from the Color Computer formatted disk.

Then we checked the data patterns again with the scope. My controller still did not produce identical patterns to those produced on the Color Computer, but they were much closer.

"I'll write code to exercise the entire drive later, when I can take the time to do it right, but I should be able to install Flex pretty soon, and then I'll have a proper operating system."

"Flex is the OS?" Freddie asked.

Pat answered, "It's supposed to be similar to CPM."

"TSC makes it. It's the OS I'm going to use for now."

"Ah. And you'll have something to run that 6805 cross-assembler on." Ms. Steward dug into her folders and pulled out several disks and manuals, which she gave Dr. Brown. "These are on permanent loan to the school. You should find quite a bit in there to help the students."

 She also pulled out several rails filled with chips. "68705s. Only twenty in this batch, but we'll send more." She didn't specify which version of the CPU they were, and I didn't ask.

Dr. Brown raised his eyebrows with a grin as he accepted them. "Thank you, indeed." Then he looked at me and said, "So, let's get those floppy disk controllers working."

I nodded in agreement. "Thank you, Ms. Steward, and give my thanks to everyone at Motorola."

"You're very welcome, of course."

Bob asked, "So that floppy disk controller is basically the 68701?"

"Right. The same one that I'm going to use in a redesign of the Micro Chroma 68 is the controller for the floppies, too."

"Is the Western Digital floppy disk controller just a microprocessor?"

"With a bit of internal circuitry that's external on my controller."

"So that 6801 is a pretty good controller."

"I think so."

"If I make a controller for oil field gear using the 68701, will Motorola require royalties or something?"

"Royalties." I muttered. It occurred to me that the term "royalty" itself spoke volumes to the issues of whether current patent and copyright law were in effective contradiction to certain clauses in the Constitution, but I decided to save that discussion for later.

"Depends on what the design looks like," Ms. Philips filled in for me. "It's quite possible to build many things with the 68701 that don't infringe things Motorola's patent portfolio, but we have a legal department that can help vet the design. Let me get your name and address and we'll send you some information about that."

"And the school board says the school can help while you're a student here," Dr. Brown added. "Come talk to me about it."

"Sounds good." Bob seemed happy with this information as he wrote his contact information down for Ms. Philips.

"How is everyone coming on designing their trainers?" I asked.

Mark looked up from where he was helping Wallace. "Pretty good. Anyone else going to work on theirs today?"

I looked around at the students. "Looks like everybody who isn't working on their design now thinks they are already finished?"

"We think." Jennifer laughed. "That's probably accurate. We'll see how complete our designs are as we get them put together, I guess."

There were scattered chuckles.

"It'll be a good thing to do next week?" Dr. Brown suggested, to general agreement.

"What about Julia?" Suzanne asked, looking up from the schematic that Jeff was helping her with. "Is she going to build her own design? Why does she get to use your design?"

I chuckled as I turned to Julia, and I noticed Mike had looked up from his work and was watching her, too. I had the impression she was deliberately ignoring him.

"What do you think, Julia? Do you want to try your own design?"

She smirked. "I suppose I'd have to spend even more time at your house, so you could teach me all the electronics I don't know yet."

In the corner of my eye, I could see Mike's face fall.

I turned back to Suzanne. "Julia's in a different field. She's here because she's my friend. And she's helping make this project possible. And if she wants to get credit for this as a project class, yeah, I'm pretty sure she'll have to do her own. If it's possible to get credit without taking the prerequisites."

"Credit. I wonder if it would be useful in my field." Julia tilted her head and pulled her mouth to one side.

"Helping, huh?" Suzanne looked over at President Flyer, and pulled her lips into a grimace that was a little sharper than faint.

"I can be incredibly bad about writing things down. Perhaps I shouldn't let her help me with that, but, if she weren't helping me keep track of what I'm doing, we would not be here today." I looked around the room. "Does anyone else take exception to these arrangements?"

"No way!" Jennifer was quick to speak, and others echoed her sentiment. Mike remained silent.

Rather than escalating things further, I waited for Suzanne to respond, trying to read her intent from her expression, but there was too much mixed in to read clearly.

After maybe half a minute, she said, quietly,"Sorry, Julia. I'm not really a bitch all the time."

"No offense taken. It's probably good to clarify things, anyway."

"Yeah. My fault for not explaining why she's here," I added.

Suzanne turned back to her design, and several of the students gathered around to back-seat drive as Jeff continued helping her work out something she was having trouble with. I went over to check, too, but Jeff had already figured out what she was stuck on and was quickly getting her untangled without my help.

"Just so Dr. Brown and I have some idea where things are headed, how many of us are building 6805 trainers?" I asked.

All of the students raised their hands.

"Oh. Then nobody's building 6801 trainers?"

More than half raised their hands.

"Ah, okay, how about 9940s?"

Four students.

And three were targeting 6502, two were targeting Z-80, two were targeting 8085, one was targeting 1802, and one was targeting Z-8.

"Great. A lot of you are already planning your second and third steps. Any others?"

Bob raised his hand. "8088."

"Very good."

Jeff and Mark raised their hands and said, practically in unison, "6809."

"Great."

Mike raised his hand, as well. "68008."

"Okay." I looked around, and it appeared no one else wanted to announce more plans.

"So, I think we're done with this week's installment, and I think I need to give my attention to some non-students for a bit. Will next Thursday be okay for everyone to get together and compare progress, as Dr. Brown suggests?"

"Wait!" Winston called out. "What about the Micro Chroma 68 boards?"

Lots of faces turned.

I looked over at Ms. Steward. "What is the official word on that? Can they be made available?"

"I've brought six, with 6803s instead of 6802s in the included chipset, if anyone is really anxious to have one now. One is for you, Joe, to work on the daughterboard to convert CPU pinouts with, since I assume you want to keep the one you've got running for the tools it has."

"True, it's probably safer to do that on a different board."

"6803s?" Terry asked.

"A 6803 is a 6801 that doesn't have ROM," Jeff explained. "The 6846's monitor ROM should work, shouldn't it?" he asked Ms. Steward.

"Yes, the engineers say it should. It just needs the daughterboard, to convert between the pinout of the 6803 and the 6802 pinout laid out on the board."

Dr. Brown asked, "Could I buy a couple of those for the school?"

Ms. Steward looked perplexed. "I think I can get you a couple, but I'll have to check with my boss. These are only cleared for students, and non-students should be paying a non-student price. On the other hand, we might be able to just donate a couple to the school. Can I borrow your phone to check with the office later? They didn't send one of our portable phones out with us."

"Sure. That would be really great."

Julia said, quietly, "Could I get one, even though I'm not really in the project?"

I exchanged glances with her. "It's not compatible with the Color Computer."

"I know."

"What do you think?" Ms. Steward asked Ms. Philips.

"At present, there's nothing in our plan that says the students have to be in a technology or engineering major, so, yes, you could, Julia."

Mark asked, "Say, Joe, you're pretty busy, you think Jeff and I could work out the daughterboard design?"

I didn't even have to think about it. "Mostly a matter of hard-wiring the boot mode, setting up some latches to de-multiplex the buses, and then routing the demultiplexed buses. I think there's a control signal or two to be synthesized. Sure."

I thought for a moment more. "Well, I might add wiring for a DMA controller .... Nah, not relevant. Most of you guys could do it. I'll check what you come up with before we break up, and I'll bet somebody could get a board booting to the monitor over the weekend."

"But it looks like there's more interest than we have boards with us," Ms. Steward pointed out. "We'll dig up more when we get back to Austin, and have them shipped, but I don't want to suggest how we should distribute these that I've brought."

"Dr. Brown, what do you think?"

"Who's ready to buy one now?"

Mark and Jeff raised their hands, as did Winston and Suzanne. I had the impression most of the rest of the students were holding back.

Mr. Cisneros said, "Julia?"

"I'm willing to wait, Dad."

Jennifer spoke up. "I think Julia should get one."

"I think she'll get the one we use to develop the daughterboard, if it's okay with Motorola. She's likely to be helping us with it anyway."

Jennifer looked like she wanted to try to convince Suzanne to wait, but was deciding to back off.

"If everyone else is willing to wait, there's also the redesign I'll be working on once I get the disk drive controller working and once we get the daughterboard ready. That'll be a lot more work, since it'll be all point-to-point wiring, unless you're willing to wait until Motorola gets it ready to make a PC board."

Greg said, "I'd rather have something that's known to work."

"Okay, how many of us want one, if they can find that many?"

All the students raised their hands.

Ms. Steward nodded and said, "I'll see what we can do."

With that, the meeting broke up. Many of the students and the rest of the school board and staff other than Dr. Brown left. Julia's parents said goodbye, too.

Mark, Jeff, Winston, and Suzanne stayed to buy their boards and discuss building the computer, and several others stayed as well -- Bob, Jennifer, Pat, Mike, and George among them, wanting information, or to talk with the corporate contingent.

While Ms. Steward was getting the Micro Chroma 68s taken care of, I went over to talk with Dave and Jayne. Mr. Wells and Ms. Philips were deep in discussion nearby.

"Sorry I never dropped by."

"I must say, I don't blame you. TI's 9900 has not been well received."

"I never was very confident of my productivity while I was working for you guys."

Dave looked at me straight-on. "You're one of those slow but steady types.  Management was disappointed when you decided to leave."

I ducked my head. "Well, what can I do from here?"

"Do you think you could you work up an analysis of the 9900 like you've done with the 6800 and present it to our board of directors? There is a group working on a separate advanced design for controllers, but it would be something of a coup if we could directly recover our investment in the 9900. Or, if the 9900 is just not going to work, it would be good to have some better reasons why."

"Better?"

Jayne shook her head. "More negativity in the company towards it at this point than concrete reason."

I nodded. "It'll take me a bit of time. And I'll have to work with the four who want to work with the 9940. Can you sample me a couple of parts?"

"I'm pretty sure we can sample parts for both you and the four who have expressed interest, but we can't promise anything without checking upstairs first."

"Specs?"

"We held a set back for you," Jayne grinned as she handed me the datasheets and application notes.

"Okay." I accepted what she gave me and examined it. "I'll take a closer look at these over the next few days and call you with some initial plans."

I turned to Ms. Bight.

She didn't make me ask. "There's a lot of interest in how this project is coming together. We're not really ready to make an offer on your summertime until we know where things are heading. We do want you to join us for an internship, but we don't want to make specific plans too far ahead of time.

"And we also may be interested in accepting internship applications from one or two other students from this group, if you want to recommend someone."

"Okay."

Mr. Goldwater grinned. "I still have doubts about some of this, but I think you're doing a great job, really."

Mr. Wells nodded. "And I'm talking with Ms. Steward about sharing your summer with Motorola, as one possibility."

"We're definitely looking forward to having you do something for us this summer," Ms. Philips said.

Ms. Steward came back at this point, and added, "So, what would you think of writing an article on the Micro Chroma 68 and the Micro Chroma 6801 over spring break? -- as an internship project."

I had to think about it for a moment. "Yeah, I guess I could do that. But I don't want to lose my whole spring break."

I looked over at the group where Julia was sitting. "Would there be a problem with me enlisting help?"

Ms. Philips answered. "Shouldn't be, if you can work it out the details with, uhm, the people you ask, I suppose." She grinned, knowingly. "Just be fair with them and make it clear in your reports to us who did what."

I agreed, and we talked a bit more about technology and microprocessors while Ms. Steward and Ms. Turner put their cameras and recorders away. I tried a couple of times to bring up the 6809, but both Ms. Steward and Ms. Philips seemed to be avoiding the topic.

The three corporate contingents and Dr. Brown went to his office to discuss things, and I joined the discussion about the Micro Chroma 68 daughterboard and checked the schematics they had drawn. Mark's and Jeff's were essentially the same, and looked workable. Bob's attempt looked too complicated, and the others had given up.

"You know, I'd kinda like to try to put mine together tonight," Winston said.

Suzanne gave me a look that I suppose she thought was meaningful. "Yeah, me, too. I suppose you're busy tonight?"

"Yeah, I've got a bit to do. A lot to do, really."

"I'm definitely not in a rush to get mine built," Julia said.

"Parts." I pointed out, "You all need parts. Do you know what parts you need?"

Jeff dug through the manuals that had come with the board, and started through the parts lists. "Got one of these. Need this. ..."

Jeff watched for a moment, then started working through the parts list himself, checking what he had, and then Winston and Suzanne did the same.

Julia and Giselle and I exchanged glances, and Julia and I both shrugged.  I sat down and drew up a parts list for the daughterboard before checking my own parts bins. "Are you guys going to all converge on the Radio Shack on Andrews Highway?"

"There's also the one in the mall," Mike pointed out.

"Dad does business with the supply shop next to the surplus store out on West County Road." (That highway has long since been renamed.)

"Let's get what parts we can tonight and tomorrow after lunch, then get together again here for about an hour in the afternoon," I suggested.

The rest left, and Julia and Giselle and I packed up the computers and loaded them in the Colt after ducking in to Dr. Browns office to say good night.

Giselle rode with Julia in her car.

*****

"So are there any papers left for me to deliver?" I asked my parents as we brought stuff in from the Colt.

"Nope. Sorry. We done it all by ourselves." Mom grinned at me.

"Sorry. And thanks."

"How did it go?"

"I guess I'll know soon enough. I did fix a bug in the controller code. And it looks like we've started a club."

"Oh. You've got a couple of packages." Mom pointed at the coffee table, where there were two thick legal-sized envelopes, one with the TSC logo and the other with the Mountain View Press logo.

Julia looked at them curiously.

"Ordered Flex and some compilers from TSC, and something called Forth, from a place in California."

She looked at me, puzzled. "Why aren't you excited?"

"Trying to decide which to look at first. After dinner and homework."


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


Sunday, April 26, 2020

33209: Headwinds -- License

Chapter 11.6: Headwinds -- Project

Chapter 11.7: Headwinds -- License


"Well, I don't guess it really matters who wrote it. It's easy enough to find fault with other people's work. Even with non-optimal keyboard decoding you can still do a lot with one of these computers. But I'm going to use timers and interrupts, and I'm going to recommend that approach."

Wallace asked, "So do you think we should use a separate keyboard controller or let the main CPU read the keyboard?"

"I think that's  something we each need to figure out for ourselves. For me, I'm wanting to try keyboard decoding using several different CPUs, but I don't think I have enough time. So I haven't decided yet. But I am planning on keeping the seven-segment displays for status readout, either way."

Mike asked, "But if we don't use the best design now, it'll cost more money and more time to do it over again later, right?"

"Time is money," Dr. Brown deadpanned. Then he grinned. "But there will be lots of time later to build something better. And/or money to buy it."

I nodded my agreement. "Definitely. A lot of people don't want to accept it, but, within maybe ten years, pretty much every desk in every office will have at least one computer, and there'll be a lot of hardware turnover, too."

(What seems obvious now was far from obvious then. And the real me was not this prescient. Or maybe just not as eloquent. No, I really did not get this. I was always reaching for perfection in the first step -- I wanted a 32/64 bit 6809 running at 4 GHz to write my perfect operating system for.)

Mr. Wells cleared his throat. "I've overheard our sales engineers talk about such things at lunch, but isn't that just a little bit of exaggeration? I mean, word processors are a hard enough sell, why would so many people want plain-old microcomputers?"

"Giselle, what do you and Dad use that Color Computer for?"

"Besides learning BASIC?"

"Yeah, besides learning BASIC. "

"Well, Julia and I are typing up a lot of Dad's handouts and tests. We've got records of grades, and a BASIC program that averages them."

"So, typewriter and calculator. Do you remember when Denny bought his first programmable HP calculator?"

"The one that cost him almost a month's wages?"

 "Yeah, that one."

"He used it to study engineering. He said it replaced several big, thick, heavy, expensive books full of constants and formulas."

"Yep. And you are aware that your microcomputer can do a lot of what that calculator did, and can be programmed to do a lot more?"

"Yeah, but I haven't learned how to use it all, yet."

I turned back to Mr. Wells. "So microcomputers will quickly replace calculators and typewriters, and quite a lot more. They aren't able to do all that your word processing minicomputers do, yet, but they're cheaper, and next year's model will be more powerful. In ten years, they'll be cheap enough ordinary people will be buying new microcomputers every two to three years."

Giselle said, "That's insane!"

"I think so, too, but it will be common sense for many people. And word processing software for them will beat what our current word processors can do, hands down."

(More things that could have been, had a certain very large software company not been fixated on social engineering via virtual monopoly, but I guess that's water under the bridge now, as well.)

Ms. Philips shook her head. "Buying a new computer every other year? But if they're built well, they should last much longer."

"You know, we really don't know how to build a computer well. We focus on what we understand, but computers can do so much more than we presently understand that we focus on the wrong things when we design them. And the hardware improves. It's not so much that they wear out as it is that the new models can do so much more so much better, and, since people will often be using them to compete in the marketplace, they'll have to keep buying the latest models just to keep competitive."

"That is just insane." Giselle repeated herself. "Why would computers have to change so much?"

"Look at design of the 6800 and the 6801. I think the team that designed it did a good job, but look at all the opportunities they missed."

Both Ms. Philips and Ms. Steward just gave me blank looks.

"Let's look at the 6800 op-code map in the datasheet," I borrowed one for a minute and held it up, "the binary operators follow a pattern." I turned to the chalkboard. "The high bit is 1 for binary ops. The next bit, bit 6, is 0 for accumulator A, and 1 for accumulator B. BIts 5 and 4 encode the target like this,
UAMMXXXX, where U==1 for binary, A=1 for accumulator B, XXXX is the operator, and MM is the mode:
  1. 1A00: Immediate
  2. 1A01: Direct page (page 0) address ($00nn)
  3. 1A10: Index mode address (nn,X)
  4. 1A11: Extended (absolute) address ($nnnn)
(Refer to "A Little about the 6800" for the maps.)

"Well, except for the call instructions, JSR. And the instructions that target the stack and index registers. They don't have the accumulators as operands."

I stopped to think, then commented, partly to myself, "Stack register, index register, program counter. PC is the instruction pointer. Jump subroutine is the call. Essentially, pointer registers."

Nodding to myself, I continued: "I think the design engineers were worried they would need more op-codes, so they didn't follow the same pattern on the unary instructions. Or they were looking at the accumulator targets instead of the operands in memory for their patterns, and saw what I think is a less important pattern.

"Anyway, for unary operators, the high bit is 0 and bit 6 is 1, and bit 5 is 0 for accumulators, bit 4 selecting A or B, and bit 5 is 1 for the memory operands, bit 4 selecting indexed or extended mode,
U1MMXXXX, where U==0 for unary, XXXX is the operator, and MM is the mode:
  1. 0100: Accumulator A
  2. 0101: Accumulator B
  3. 0110: Index mode address (nn,X)
  4. 0111: Extended (absolute) address ($nnnn)
"Note the '01' at the left. That 0 on the top partially selects unary over binary, and the 1 fcompletes the selection, so to speak."

Everyone but Mark and Jeff, Dr. Brown, Dave, Jayne, and the contingent from IBM were giving my blank looks. Dr. Brown was giving me an eye-roll.

"Uhm, let's look at the negate and subtract operators, as examples. This is what we have:

OP mode(operation):6800 op-code($80)J3800 op-code
SUBA immediate(A-#$xx=>A):10000000 ($80)same
SUBA direct(A-@($xx)=>A):10010000 ($90)same
SUBA indexed(A-@($xx,X)=>A):10000000 ($A0)same
SUBA extended(A-@($xxxx)=>A):10010000 ($B0)same
SUBB immediate(B-#$xx=>B):11000000 ($C0)same
SUBB direct(B-@($xx)=>B):11010000 ($D0)same
SUBB indexed(B-@($xx,X)=>B):10000000 ($E0)same
SUBB extended(B-@($xxxx)=>B):10010000 ($F0)same
NEGA($100-A=>A):01000000 ($40)00000000 ($00)
NEGB($100-B=>B):01010000 ($50)01000000 ($40)
NEG direct($100-@($xx)=>@($xx)):--------01010000 ($50)
NEG indexed($100-@($xx,X)=>@($xx,X)):10000000 ($60)same
NEG extended($100-@($xxxx)=>@($xxxx)):10010000 ($70)same

This took me a little bit of time to write on the chalkboard, but, when I turned around, I thought I was getting glimmers of recognition.

"They fit the direct mode unary instructions into the 6809, but they made a number of other changes when they did so. I think, by moving the ranks around, it would have been possible to fit op-codes for direct-mode unary operators into the op-code map of the 6800. I don't have the experience, so I can't say so for sure, but I think it should have made the instruction decode circuits simpler, which might have at least partially made up for the circuitry for the extra op-codes."

Mr. Wells stopped me. "What's the J3800?"

"I've given my theoretical revisions to the 6800 a couple of names. This one, that is object code incompatible, I call the J3800. Heh. 'J' because Rockwell is putting R on the heads of some of their part numbers."

He blinked. "It seems to me," he paused here for emphasis, "like you're going to a lot of trouble to work out  something that might, theoretically, have saved a little bit of circuitry on the wafer, but is now water under the bridge. Why?"

"Bear with me for a minute, please. If Motorola had encoded the instructions this other way, the first pattern would have partially decoded most of the instruction set, where now it only decodes about half:
UAMMXXXX, where
  • U==1: binary
  • U==0: unary
  • A==1: B accumulator
  • A==0: A accumulator
  • MM==00: immediate
  • MM==01: direct
  • MM==10: indexed
  • MM==11: extended
Terry  stood up. "But in the unary, there's no immediate mode."

"Uhm, what I'm seeing is that the unary operators mostly imply an implicit immediate, well, buried-in-the-instruction value of one. Negate implies an immediate hexadecimal $100, complement implies an immediate hex $FF, and clear and test imply an immediate zero. So maybe not immediate in the sense of an explicit value immediately following the first byte of the op-code, but immediate in the sense that it is part of the instruction that gets decoded."

Terry tilted his head and squinted, frowning.

"So, ...," Mr. Wells prompted.

"So, it's not just that the instructions would have been more uniform. I've been looking at the internal RAM on the 6801 SOCs, and thinking things like 'Lack of direct mode addressing on the unaries costs precious time in tight loops.' And it demotivates putting certain globals there. What's more, if the unary instructions included direct mode, for a lot of programs the direct page could be selected as a separate memory space, if the processor version supported it."

Terry looked back at Mr. Wells and shrugged. Mr. Goldwater was suppressing a smirk. Ms. Bight was looking embarrassed. Dave and Jayne looked up from the notes they were taking. Ms. Steward and Ms. Philips were still quietly discussing something and writing down notes.

"One of the less impressive aspects of the 6800 is that it often feels tight to be facing the 64K address limit and trying to stuff code, data, and I/O into it. Splitting the code out from the data is a fairly straightforward concept, and could be done with a status bit that gets set to 1 on instruction fetches and cleared to zero on data fetches.

"Splitting the stack out is a great idea for optimizing calls and returns and making them closer to plain jumps in cycle count cost. It's also a possible route for protecting the return pointer from coding errors and deliberate attacks, but ordinary stack frame handling creates issues with that.

"Splitting the direct page out would allow the creation of a bunch of pseudo-registers-- faster to access, less traffic on the external buses, global in scope. You could fill the data space with RAM without reserving port space in many hardware application designs. Bank switching could be achieved without the ports for the bank switching being in the space being switched in and out."

(I'll admit that the real me sensed these things early on, but he sure couldn't put them into words this way until much later.)

Terry looked back again. Mr. Wells raised his eyebrows, and Terry nodded and sat down.

Ms. Steward looked up. "So you're talking about an incompatible revision."

"Uhm, ..."

"Do you think you could do something similar and keep it compatible?"

"I think so. It would require a bit of complexity in the decode circuitry, but there is room in rank 1 for most of the missing op-codes. Give me a minute, here." I turned back to the chalkboard, found an empty space, and put up another table. While I was working on this table, Ms. Steward went to her camera and took close-ups of my work on the chalkboard.

*(Reserved, undefined; **6801; *+2801 extensions)
J2801
Inherent
Operators
Ranks 0-3

Status, XAccumulator,
 Direct Unary
BranchStack, et. al.
$0X$1X$2X$3X
0000XXXX0001XXXX0010XXXX0011XXXX
$X000XX:
0000
*(HCF=$00)SBA=$10BRA=$20TSX=$30
$X100XX:
0001
NOP=$01CBA=$11**BRN=$21INS=$31
$X200XX:
0010
*+NEGd=($02)*+RORd=$12BHI=$22PULA=$32
$X300XX:
0011
*+ASRd=($03)*+COMd=$13BLS=$23PULB=$33
$X400XX:
0100
**LSRD=$04*+LSRd=$14BCC=$24DES=$34
$X500XX:
0101
**ASLD=$05*+ROLd=$15BCS=$25TXS=$35
$X600XX:
0110
TAP=$06TAB=$16BNE=$26PSHA=$36
$X700XX:
0111
TPA=$07TBA=$17BEQ=$27PSHB=$37
$X800XX:
1000
INX=$08*+ASLd=$18BVC=$28**PULX=$38
$X900XX:
1001
DEX=$09DAA=$19BVS=$29RTS=$39
$XA00XX:
1010
CLV=$0A*+DECd=$1ABPL=$2A **ABX=$3A
$XB00XX:
1011
SEV=$0BABA=$1BBMI=$2BRTI=$3B
$XC00XX:
1100
CLC=$0C*+INCd=$1CBGE=$2C**PSHX=$3C
$XD00XX:
1101
SEC=$0D*+TSTd=$1DBLT=$2D**MUL=$3D
$XE00XX:
1110
CLI=$0E*+JMPd=$1EBGT=$2EWAI=$3E
$XF00XX:
1111
SEI=$0F*+CLRd=$1FBLE=$2FSWI=$3F

Ms Bight was no longer looking embarrassed.

Mr. Goldwater leaned forward. "So, I/O instructions, a-la the 8080, and you're also implying segments, a-la the 8086."

"Heaven help us." I looked down and scratched my head. "This is basically for SOCs, so I'm thinking it would be possible to separate the segmentation from the CPU itself in the design tools, as God intended -- I mean, according to good design practices."

I grinned and waited for the snickering to die down. "Well, a good God would intend good design practices more than bad, I think. Sorry. That wasn't called for. Every step that leads forward is not to be regretted too much. Uhm, yeah. I'd rather not clutter the instruction map with segment register instructions that would tempt the programmer to make evil things like non-linear pointers.

The IBM contingent chuckled again, and Mr. Goldwater rolled his eyes.

"Evil." I cleared my throat and grinned an embarrassed grin again. "Anyway, evil or not, with the direct page separable, all the bits to control the address space could potentially be addressed as port I/O bits in the direct page, and there would be no need for special I/O instructions. Provide enough signals to separate the segments in the architecture, and the rest of memory management could be done in I/O -- several options, including nothing but address space separation, or simple bank switching, or a full MMU like the 6829."

Ms. Bight was nodding in agreement. "Helping expand the address space. So, say, what happens if the stack overflows?"

I took a deep breath. "I'm thinking that could be part of the SOC, too, at least for this kind of processor. If you have a signal that says 'this is STACK space', you can have a set of registers in I/O space that set current process limits, including limits on the stack.

"When the stack pointer pushes or pops past the limit, an interrupt occurs, and either the processor goes to superviser state, so the memory map switches to supervisor mode before trying to save on a no-longer completely valid stack, or the limit is set a little in from the actual end, so that there is always room to save the registers on a stack overflow.

"Or something like that.

"Another option might be a small-ish stack cache that automatically spills into and fills from main memory when the top gets within range of the ends of the cache, but that might be overkill on a small 8-bit processor like this.

"Anyway ... the point is that we still have a lot of room for progress before we can or should start thinking that we can build microcomputers well. So we have to be expecting that what we build now will be superseded.

"Once we know more about what works well with the most common applications for a processor, we might start baking the MMU details into the architecture at the CPU instruction level, but, especially with a controller CPU intended for a wide range of SOCs, port I/O can do the job, especially if there is support like this in the instruction set."

Mr. Goldwater was nodding in some level of satisfaction. "Separate I/O instructions like the 8080, but not like the 8080, because it's an actual address segment. Although the Z-80 heads this direction, too, in its own way."

"Something like that."

Jennifer raised her hand. "I'm not complaining, but it seems hard to believe that computers will change as fast as you're saying. How can we even be sure our computers are working if they keep that kind of pace of innovation?"

"That's an important question, and it's actually a good reason for us to be building our own. Simply stated, a if you build a simple computer yourself, it's easier to make sure it's running right than a more powerful computer. Then the simpler computer gives you something to build on -- including tools to make sure a more powerful computer is working right. Other people will throw their computers away, but I'm going to keep mine around, as steppingstones to get me safely back to the next level when the next level doesn't work right the first time."

George said, "If that's true, I guess starting small makes sense.

Now Dr. Brown spoke up. "So, Joe, you're running a bit far down that road. Are you suggesting that you'll be able to use an old computer to make sure there are no bugs in a new computer?"

"No, not by myself. Shoot, the Micro Chroma 68 over there is more complicated than I'd be able to test by myself in a year of working full-time at it.

"We'll have to help each other, but we'll definitely need to use the older computers to check the new ones, or we'll be unable to prevent friends, enemies, corporate spies, organized crime, sales-crews, and government agents from having access to the computers we put on the communications networks.

"Helping each other is part of the reason we are here now."

Mike was leaning back with arms tightly folded. "Well, that's all well and good, but, since you bring up helping each other, what I really want to know is who owns all the intellectual property?"

"Intellectual property?" I mugged ignorance.

"Yeah. Intellectual property. Patents. Copyrights. Trademarks. Intellectual property."

I shrugged. "Motorola owns their batwing M. All trademarks are property of the company that owns them. Likewise copyrights and patents. We aren't going to engage in printing and distributing datasheets for profit, are we?"

"That's not what I mean."

"Uhm, we aren't planning on using our computers to record and share music illegally, are we?"

"Definitely not what I'm talking about."

"Patents? I suppose we'll need to check with the companies that supply us, if we decide to put something we make here into commercial production. But I'm pretty sure we won't be stepping on any toes just to build one-offs for our own education."

"Now you're getting warm."

"What do you think, Ms. Philips? Do you think we can operate within the bounds of common sense and keep from infringing patents?"

"That will be somewhat up to you guys."

"Should we all stand and raise our right hands and promise to try to act within the bounds of law and common sense relative to patents? Serious question."

President Flyer spoke up. "The boards of both colleges have been discussing this, but haven't come to proper conclusions yet about what kinds of commitments we should ask for. We probably will, relative to the project class this may turn into, decide on something. In the meantime, we should probably just ask all of you students who are participating to be careful, and ask questions if you think something you do might get close to infringing."

"But what about stuff we make?" Mike insisted

"Don't share what you want to claim patents on," I said. "If you share, let the person you share with know where you got it, and how far you feel comfortable letting them share. And don't claim to own things you don't own. Common sense."

Ms. Philips sighed. "Regretfully, such common sense is a rarity in the industry. We'll contact your school board and see if we can help. Maybe TI and IBM can also."

Mr. Wells said, "My boss is arranging for that."

Jayne concurred. "We'll be in contact, as well. In the meantime, Joe, can you write down what you just said about sharing, copy it, and get all the students who participate to at least acknowledge the intent?"

"Sure."

"I've got it written down," Julia lifted her notes. "You want to check it?"

"Thanks." I moved over to the desk and read her notes out loud. "That's what I said."
  
Mike had another complaint. "It seems to me like you just shared something without saying how much others in this room can share it."

"J2800? J3800? Half-baked ideas that might have limited use to Motorola and maybe one of their second-sources, none of whom are here today?"

Ms. Philips tilted her head and raised an eyebrow. "Joe, Mike has a point. Give us some time to talk with you about that later, okay?"

Jayne added, "Dave and I'll want to have a similar discussion with you on that."

"Sure. But ... Oh ... well, yeah. Sure."


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


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.]


Saturday, April 18, 2020

33209: Headwinds -- Presentation

Chapter 11.4: Headwinds -- Buggy Floppy Controller

Chapter 11.5: Headwinds -- Presentation

[JMR202010051800: Apologies for the change in format. Google's new editor seems to want it.]

"Hey guys."

"Yo." Jeff raised his fist and I grinned and gave him a back-of-the-fist bump before setting my books on the lab table.

Mark raised his fist in solidarity. "Ya ready?"

I responded with a raised fist and a grin, but then lowered it and shook my head. "No idea. Thanks for helping me here."

"No idea." Jeff snickered. "What a sense of humor."

We all chuckled nervously.

"Let's get my stuff set up. You guys bring your trainers for show-n-tell?"

"Yep."

"Got 'em. How do you plan on starting?"

"I'm thinking we should show everyone what you guys built, then I want to lay out a road map so everyone can make their own plans."

"Road maps?" Jeff faked disgust. "Who wants to see where we're going?"

Mark chuckled. "Don't listen to this guy."

We continued to joke around while we set my computer up.

"Not using your sister's CoCo?"

"They were using it in my dad's office. She and Julia will be bringing it over pretty soon."

After we got the Micro Chroma 68 set up and connected to the big TV through the splitter, I started sketching a diagram on the chalkboard while other students filtered in.

Shortly, Julia, Giselle, and Dad came in with Giselle's computer, disk drive, and TV. Dad set the TV down. "I'll be back. Don't wait for me." He mugged a grin and left.

Julia took a look at my sketch and set the disk drive down. "I guess I already have work to do." She got her notebook out of her backpack, and started copying from the blackboard.

"Well, thanks, but I really want the other students to draw their own copies." I returned to the table to help Giselle set her computer up.

Julia didn't look up. "This is in case someone can't make it. And it's also for you."

I laughed and shook my head. "You already know some of my bad habits."

At that, she looked up and gave me an innocent smile, and I grinned back.

Jeff cleared his throat.

"And it's for me, too," she continued.

Jeff and Mark both said, "Uh, huh."

I raised my eyebrows in question, and she nodded. "Dad says he'll help me make one. If you can't spare a CPU for me, he can find one."

"Sure, I can get you one."

"He's going to try to come today, too."

"Enough butterflies in my stomach to fly me away yet?"

She laughed. "You'll do fine."

"This is in front of the board, you know."

She nodded. "Yep. And I know you'll do fine."

Mark gave me a shoulder bump and Mark gave me a knowing nod. I tilted my head and scratched my neck.

Just as I turned back to the chalkboard to finish the diagram, the students from the microprocessors class came in as a group.

One whose name I learned later was Terry asked, "Can we join this party?"

I looked over at Dr. Brown. He nodded. "Them's them."

"It's up to you," I replied with a shake and nod of the head.

"Great!" They found seats and joined in the chatter among the students.

Pat and George came in, slightly out of breath, and Julia looked up. "Is Mike coming?"

Pat shook her head. "He said he, uhm, changed his mind."

Julia's expression clouded and she bit her lip, and I thought I might be seeing part of the reason I had not felt like I should press my advantage with her.

"Well," I said, "if you don't see him before I do, tell him, if he changes his mind back, Julia's got notes for him."

Julia turned to me and give me an inquiring look. I couldn't do anything but shrug.

A group of school board members came in with President Flyer, and Dr. Brown showed them to some desks near the back of the room, staying there to talk with them. I went back to greet them, then returned to the chalkboard.

I still wasn't finished with the diagram when Dr. Brown said, "Hey, Joe," and I looked up to see Ms. Bight coming in with a group of people I hadn't met. Two of the women in the group were carrying rather large briefcases.

Dr. Brown moved to the door, and I put the chalk down and went to meet them, too.

"Joe, nice to see you again. This looks to be fun."

"Glad you could make it, Ms. Bight. I hope it'll be interesting."

"I'm sure it will, and welcome to our school." Dr. Brown was keeping his usual jocularity in check.

"Let me introduce James Goldwater, my boss, and Karel Wells, another of my bosses."

Mr. Goldwater continued, "Karel is my boss. And this is one of our school liaison agents, Robin Turner." He indicated one of the women with the briefcases. "We're looking forward to seeing what you're up to, here. Oh, and I'll let Steph introduce herself, even though Steph and I go back a ways." He indicated the other woman with a briefcase.

"Thank you James. I'm Stephanie Steward, a liaison agent at Motorola, and this is Carrie Philips, one of our legal staff with our intellectual capital management group. We're hoping you'll have some time to talk with us after your presentation."

I gave them a nod, or maybe it was full o-jigi, and shook their hands. "I'll try to keep the demonstration and stuff short. I have newspapers I need to deliver tonight."

"Oh. Joe," Giselle interrupted, "Mom said to tell you she'd walk your route today so you can take your time."

"Okay. Then, by all means, I'd love to talk with everyone!" I may have been a little dramatic, waving my hands in the air. "Erm, ...," I stiffened.

Both the group from IBM and the group from Motorola chuckled comfortably, and I relaxed a bit.

"And, by the way," Ms. Steward continued. "I'm hoping you'll let us videotape this for the people back in Austin."

I looked over at Dr. Brown.

"Well, I've cleared it with the school board, so it's up to you and the rest of the students."

"Well if it isn't Joe Reeves."

I looked over at the door. "Dave. Uhm, hi."

One of my former managers at TI wheeled himself in, followed by another manager, whose name I had forgotten.

Dave laughed. "We've been waiting for you to come talk to us, since you got back from Japan, but, when I heard about your project demonstration, I thought you wouldn't mind if I dropped by. Jayne agreed with me, so we got permission with upper-level management and came over to crash your party."

"Jayne." Jayne Burdock. I nodded and mentally thanked him for mentioning her name.

She raised a hand. "Hi. Long time no see. Tell us about Japan some time."

Dr. Brown explained, "I thought the folks at your old range might want to see what you're up to."

"By all means. Thanks for coming." I nodded again a little absently.

Several students moved quickly to make way and they came in, and I followed as Dr. Brown led the whole group to the back of the room.

"I'm glad Dr. Brown called you guys, Dave. Sorry I haven't been very newsy."

"No problem. But do come by and talk with us, okay?"

"Sure." I looked around the room. It looked like all the students I expected were there. "Okay, everybody, we have some guests I'd like to introduce."

The chattering quieted down.

"We'd like to welcome members of the school board and President Flyer."

President Flyer nodded, several members of the board raised their hands, and there were words of greeting from various students.

Then President Flyer added, "And I might mention that several members of the OC board are also members of the UTPB board, including UTPB school president, Steven Dwyer."

I did a mental double-take on that.

Just at this point, Professors Crane and Bright came in, with two others I didn't recognize.

Dr. Brown exclaimed, with a bit of dramatic warmth, "Well, if it isn't our friends from the EDP department, Doctors Crane and Bright. And Dr. Harry Botch, head of electronics, electrical, and instrumentation at UTPB, and Dr. Donna Blandwood, head of UTPB's information systems program."

I offered a "Welcome, Professors." And they raised hands in greeting, and quickly moved to join the group in the back.

Then I continued, "And, we have a contingent from IBM, Megan Bight, James Goldwater, and Karel Wells from their management group, and Robin Turner, school liaison. From Motorola, we have Carrie Philips from their legal group and Stephanie Steward, school liaison. And my former managers at TI, Dave Whetton and Jayne Burdock. I hope they'll have some time for some of you to get to know them."

I waited for the nods, and cheerful greetings to subside.

(The version of me in this novel is a lot better with names than I am in the real world. Have I mentioned that?)

"And Ms. Steward and Ms. Turner would like to know if it's okay to take a video of our meeting. Apparently there are managers back in their home offices who are interested in what we've been doing. Is that going to be okay?"

Nobody seemed to mind.

Ms. Steward explained. "As Joe has surmised, management wants an idea of what you've got going on here, to consider what level of relationship we want to set up with OC, and maybe UTPB.

Ms. Turner added, "Likewise, IBM."

Ms. Philips further explained, "We only plan to be showing these to the relevant managers, for internal oversight of our student programs, before we erase them. If we decide we want to use some of the video for any other purposes, we will get in contact with Dr. Brown, and he will get in contact with you first, to ask permission."

"I think, if anyone has any objections at all, we can excuse ourselves from being recorded today. Right?" I checked with Ms. Steward and Ms. Turner.

"Right." Ms. Steward nodded.

"Very much so." Ms. Turner agreed.

"Whaddaya-all think?"

"Yah, no prob."

"I say go for it."

And other such comments. No one seemed to mind.

"I guess we'll need to get you a list of names and contact information for everyone here, then?" I asked.

"Yes," Ms Philips responded. "That will be helpful."

"Anyone with objections to putting their names on the list?"

There were no objections.

While Ms. Steward and Ms. Turner set up the video cameras in the corners at the back of the room, Julia and Giselle started a list going around the room.

I suggested to all the students, "You might want to start copying the diagram on the board while the list goes around and while they set up the cameras."

I noticed that my parents and Julia's parents had slipped in during all of this, and some of the students had made room for them to sit down, so I went over to say hello.

Ms. Steward and Ms. Philips got their video gear set up quickly, and I returned to the chalkboard and began again.

"Most of you are familiar with the basic elements of a workstation, I think. I want to point out a few things. One is that there are many CPUs that can take the central role in such a system. Even with the slightly underpowered original 6800 --" There were scattered chuckles. "-- there's a lot you can done with such a system, at school, around the home, and even in business."

"Modems, keyboards, disk drives, displays, all of the peripheral devices here can benefit from dedicated microcontrollers. But the central CPU for a workstation will be waiting for the user a lot of the time, so it is also possible to trade money for hardware for money for software, and directly control at least some of the peripherals using the main processor. "

"Where's the printer?" Winston interrupted

I looked at my diagram. "Okay, I forgot the printer. Draw it in your notes anywhere it fits. The connection will be similar to the connection to the modem, anyway, unless you intend to pump out reams of paper all day long."

There was scattered laughter.

"Oh, and I've forgotten to include the general purpose bus, too. And an interface to control appliances around the house. Add them in your diagrams someplace, or just remember, the general purpose expansion bus is high-bandwidth, and the interface to control your light dimmers and other appliances will be low-bandwidth, probably serial, like the modem.

(You may wonder at the irony in my saying the modem bandwidth would be low. Now, in the age of the Internet, the equivalent to the modem interface is the highest-bandwidth interface next to the hard disks, and sometimes higher, but the idea of a high-bandwidth network interface becoming common in every household seemed a bit bizarre back then. Shoot, the concept of network interfaces with the bandwidth we now use without thinking would have been mind-boggling back then.)

"Uhm, Joe?" Julia raised her hand.

I turned to look at her and her expression told me what she wanted to say. "Oh, Yeah. I guess I could fit those in here, here, and here." I took the time to draw them, erasing some things and moving them over.

"So, in the other way of looking at things, we don't have to have the CPU directly controlling everything. We can make up for an under-powered CPU, somewhat, by adding adding microcontrollers to the peripherals, to off-load the work the CPU does."

Jennifer raised a hand. "I've heard some people say that 64K of RAM should be enough for anything. What do you think?"

I looked around for help, but Dr. Brown was giving me a don't-look-at-me expression. I laughed, and he broke into a grin.

"Well," I answered, "lemme tell you my impressions of several of Motorola's CPUs. If I say the 6800 feels like a Volkswagen Bug and the 6809 feels like a Mustang, or even a Porsche, maybe I could say the 68000 feels a bit like a pickup truck. Ford F series, maybe."

No laughter, no comments. Everyone nodded.

I shook my head. "I guess you had to be there. Let's get technical. As I understand it, there are three limiting factors on speed. One is the speed of the memory system. If you have two microcomputers, and they both access memory at the same rate, they'll show similar speed in a wide range of applications. That means a 1 MHz 6800 and a 4 MHz 8080 are likely to be rather similar in speed, because the 4 Mhz 8080 will likely have a memory access rate of about 1 MHz.

"Note also that the clock for the 6800 is usually produced by dividing a crystal oscillator by four."

I paused while Julia wrote.

"Another limiting factor is instruction bottlenecks. There are certain common instructions that take considerable time. Different CPUs have different bottlenecks. One common bottleneck would be multiply and divide instructions. The 6800, the 8080, the 6502, and the Z-80 all do multiplies and divides in software, one bit at a time, and that takes about a millisecond for the multiplies and two milliseconds for the divide. The 6809 has a built-in 8-bit multiply that can cut that down to about a fifth of a millisecond.

"So it has significant advantages when you have to do a lot of multiplies. But it doesn't have a built-in divide, which many 16-bit processors have. Instruction improvements can cut the time for the divide to about half of the 6800's times and to about two-thirds the 6801's times. The 68000 and the 8086 have both multiplies and divides built in. I don't remember about the 9900. Dave?"

"Yes, the 9900 has multiply and divide instructions."

Again, I paused for note-takers.

"Another instruction bottleneck is index handling. The 6800 has only one index, which you must constantly save and restore, although the direct page addressing eases that bottleneck slightly. The 6801 has some more instructions to help with that, but still only has one index register.

"Index registers specifically help a lot when moving large blocks of data around memory.

"The 6809 has four index registers, so it does not need to save and restore nearly as much, and block moves proceed much faster. The 8080 has one true index and another register that helps the index register, and has a small advantage over the 6800 there, but is similarly limited to effectively one index register. The Z-80 and 8086 have dedicated multiple index registers that help a lot, but can be awkward to work with. The 68000 has eight general purpose index registers. The 9900 has, as I recall, 16 general purpose registers that can be used as indexes."

I checked with Dave again.

"Right."

"The third big factor is what Jennifer just asked about, the size of memory. 64K feels big. It works well for many things. But when you start trying to keep all sorts of commonly used functions in that, it is not as big as it feels. It's no fun to have lots of pre-defined functionality, but no room for your program. And it's also no fun to have enough room for your program, but to have to write everything from scratch so it will all fit."

I paused for breath and thought. There were still some students who weren't writing.

"Among other problems where address space becomes a bottleneck, sixteen bits of address is moderately large when working with text in English and similar languages with less than a hundred characters. But if you want to work with Japanese, like I do, Japanese has about 2000 characters for daily use, compared to our fifty some-odd in standard English. And Chinese uses, on the average, about 9000 characters, just for ordinary living.

"Historic Japanese characters number in the tens of thousands, and the unabridged Chinese dictionary has somewhere in the range of a hundred thousand. When trying to display those languages on a terminal screen, sixteen bits of address won't cut through that chili."

All the students were scribbling now. There were murmurs of understanding, but no response to my attempts at jokes.

"Wait." Wallace was one of the students in the digital electronics class.

"Yeah, Wallace."

"What exactly are characters?"

"Well, the twenty-six letters, ten numeric digits, and various punctuation."

"How does the CPU work with those?"

I looked back at Dr. Brown, and he just kept grinning as he tossed the metaphorical ball back to me.

"We use numeric codes as proxies -- substitutes -- for the characters in text files, and we have some mapping from those codes to the glyphs -- character shapes -- for printing or displaying on screens --"

I moved to the TV showing the Micro Chroma 68 output.

"Which helps explain when I talk about working with displays, like the TV screen here. We'll talk about how the mapping works later on, but the 6847 video controller in the Micro Chroma only gives me 32 characters across the screen and sixteen down, and that's a tight window to type in."

(When I said "window" here, I was using a broader, more metaphorical sense than the "windows" of a graphical user interface. The interface widgit we now call a "window" without thinking about it was simply an instance of the broader metaphor.)

"But it only uses about 512 bytes of display space in memory, which is nice when you have less than 64K of RAM. In character mode, 64K of addressing still only takes about six kilobytes of RAM, so it's still workable, but 512 bytes is much less of a resource hog.

"Graphical display is a different problem.

"The Micro Chroma 68's graphics display can do 256 dots across and 192 down, but only in one color. That's about fifty thousand pixels, or exactly 6,144 bytes of memory in this monochrome display. Jeff, can you load the cassette labeled 'laser game', so we can get a look at what that looks like?"

He found the cassette, and we took a look at a game I had written in BASIC to experiment with graphics, and the students cheered when the beam of light shot upward across the screen, erasing the objects there. Several students wanted to play with it, so I let them do so for a few minutes.

While they were playing, Giselle loaded up some programs to show fancy math curves on her Color Computer. Even the students playing stopped to look at that.

"Now that's still monochrome, green and black, even though Giselle's TV does color. And I personally think those pixels are fat."

"But it's graphics," Winston enthused. "It's cool!"

"Be more cool to put your face on the screen and shoot at it," Jennifer joked.

"Hey!" Winston was also laughing.

"But it would take more dots to make it clear whether you were shooting at Winston or someone else."

"Yeah!" Winston exclaimed, and there was more laughter.

"Dots half this size would be a screen density of 512 by 384, and just monochrome would take up 25 kilobytes of display memory. We'll look at how that's calculated later, but that's almost half of the address space of the 6800 that it would take to make it fairly easy to see the difference between Winston's face and Jennifer's."

More laughter.

"Necessary function." Jennifer stifled a giggle. "Can the Micro Chroma 68 do that?"

"Not without major surgery and a lot more parts. And that's not even talking about color and shading. Three colors and black, without shades or hues, takes two bits per pixel, so that would be 50 K of RAM at that pixel resolution."

Chuck, also from the microprocessors class, understood. "Dang. On an 8080 that's not going to leave much room for the program."

"On the 6801, too. We can use something called bank switching to make more RAM available, but bank switching is clumsy and takes time and other resources away from the work you want to do. I guess that's my point. We're starting with 8-bit CPUs, but there's going to come a time when you're going to want more than the address spaces they provide.

"The idea that 64K should be enough does not take into account a lot of the applications that will become interesting in the near future, for instance, mixing text from two languages with images, for an on-screen dictionary or encyclopaedia.

"Now I'm pretty sure I personally don't want to start with the 68000. Jumping ahead to the 6809, yeah, I've kind of thought about that, but the 68000 is a complicated beast. There's more going on in it than I understand what or why, and I want to know more about it before I dig in.

"But we do want to be looking ahead."

Suzanne, yet another of the students from the microprocessors class, asked, "So does the 6809 have a bigger address space?"

"Not without help. There is a separate chip that does something like improved bank switching, but it's still rather awkward to work with."

"Then how complicated is the 68000?"

"I have spec sheets." I dug into my backpack, but Ms. Steward interrupted.

"I've brought a pile of those."

"Let's pass them around," Dr. Brown suggested.

I got mine out and put them on the table for those who were close, and Julia and Giselle looked at them curiously over Mark and Jeff's shoulders. Dr. Brown and Ms. Steward passed out what she had brought for the 68701 and 68000.

"Is there enough for everyone?"

"I was only expecting twenty."

"Then please share. And, since she's got spec sheets for the 68701, we can compare. Note that the data bus on the 68000 is twice as wide, which likely means you'll end up having to have twice the memory for a minimal design. There's not even an A0 line on the 68000.

"Yeah, the more memory the better, but it's a bigger piece of your pocket change up front. It's also twice the number of data lines to hook up. And then there are the memory space function code pins and bus grant acknowledge pins and such that I don't know what to do with yet. And you want to run the CPU clock at least twice the 6801's crystal, unless you want a big truck that only goes half the speed of the 8-bit CPUs."

There were some chuckles.

"If 68000s were cheap, we could ignore most of the extra functionality for what we want to do now, but then we would be wanting to plan ahead, if we don't want to end up re-wiring huge pieces of things when we got ready to add all the memory we need. There'll be plenty of re-wiring as we go anyway, so we want to avoid what we can avoid.

"And the 8-bit computers we build will be nice tools to help build the bigger ones."

Mike spoke from the doorway. "So that's why the 6801?"

"Yeah, pretty much and I'm glad you could join us. You haven't really missed much yet."

"I saw the cheap laser game, anyway."

"Note the video cameras over there." I nodded toward Ms. Steward and Ms. Philips.

"Noted." He came in and moved around to sit in the only chair left, which was my chair. I noticed, as he sat down, that many eyes were following him with varying degrees and kinds of interest.

I noted that Julia shifted her chair away, and was not looking very comfortable.

"So what about the 68008?" he asked.


[Second backup at https://joel-rees-economics.blogspot.com/2020/04/bk01-33209-headwinds-presentation.html.
Originally backed up at https://joel-rees-economics.blogspot.com/2020/04/bk-33209-headwinds-presentation.html.]

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 ...