Analog telephone exchange
Telecommunication in various forms has always been a fascination of mine. Playing around with discarded telecom gear as a kid was always a source for fun experiments, but also frustration. It can be quite complicated, public documentation is generally scarce and often we are left with plenty of subscriber side devices that won't operate without it's central office counterpart. Even a plain old analog telephone takes a considerable effort to fully bring to life and operate without hooking it up to the central office exchange. Today, November 30 2026, marks the end of an era here in Sweden. The national copper telephone network will officially be closed down. It's sad but inevitable. But there are ways to keep using analog telephones (and modems!). I figured it would be an appropriate time to publish what I've been working as a slow going project for quite some time now. Nowadays we can get these plug-and-play VoIP adapters for hooking up analog phones to a software based PBX like Asterisk or even a Cisco router if you want to get fancy. But while these solutions are generally very good and flexible they take away some of the inherent charm of something analog. In this project I will design a small 8 line analog telephone exchange. This is often referred to as a PBX, a Private Branch Exchange.

How to interface to a telephone

There are two types of interfaces connected to an analog telephone line commonly referred to as FXS (Foreign eXchange Subscriber) and FXO (Foreign eXchange Office). They are often mixed up. FXS is the interface that connects to a subscriber and that drives the line and provides power, dial tone, ring voltage etc. FXO is the interface on for example a telephone or a modem on the subscriber side of the line.

FXS interface specifications

The standard analog telephone line is one pair of wires. The FXS has to provide a DC voltage across to power the subscriber telephone. The DC supply is often referred to as the "battery voltage" and the bidirectional audio is riding on top of this. A telephone typically goes "off hook" by creating a DC path across the lines. This has to be detected by the FXS interface. To ring the telephone, the FXS interface superimposes a high voltage AC signal on top of the DC voltage. This makes it's way to the AC coupled ringer on the telephone. Here in Sweden the telephone standard for an FXS interface looks something like this: - Battery voltage: -48 Volt (one wire of the line is at DC ground and one a -48V) - Ring voltage: 90 Volt AC 25Hz - Line impedance: 600 Ohm - Dial tone: 425 Hz The use of a negative battery voltage has historical reasons but one important reason is that it reduces corrosion compared to a positive supply. For a local PBX with relatively short indoor cable runs this is of limited importance. Many small scale PBXes and FXS VoIP interfaces work with lower positive supply voltages such as +24V. This is what I will do in my design as well. With short lines the higher voltage is still enough to power a phone. The same goes with the ringing voltage. It's often enough with around 50 Volt AC to ring a mechanical bell if the line is short ans sometimes even lower for electrical buzzers and modems. Once the line is off hook the FXS interface should provide an audio path between the line and the audio routing of the exchange. This path could be a bidirectional, a transformer basically, or a more complicated hybrid with one path in one direction an one path on the other direction.

Concept and block diagram

I wanted this exchange to be modular to accommodate different types of line interfaces. Not just for flexibility but also for experimentation. Therefore the design is based on a motherboard with slots to accommodate different configurations and line types. The motherboard contains power supplies, control logic and analog signal routing. Extension cards contains line interfaces and feature cards. I decided to to with eight line card slots (FXS type). Signal routing is handled using CD4051 analog 8:1 multiplexers. Each line slot is connected to a 8:1 multiplexer that connects the line to either a termination resistor, 425Hz tone generator, or one of the 6 available audio busses. This means that the PBX can in theory handle 6 concurrent calls which I think is plenty for a PBX with 8 extensions. The termination resistor is there to provide silence. Sending progress tones of varied cadence is just a matter of switching between the tone generator and termination resistor. It's important to keep lines terminated at all times, otherwise the line will sound funny on the subscriber end or even start to feedback. In an active call two lines are connected to the same bus and therefore terminated. For control I decided to go with a commonly available Arduino Nano. It is a bit limited in number of IO pins but for this I need so many control pins that a chain of HC595 shift registers is a reasonable approach anyway so it's enough.

FXS interface card

This card goes into one of the eight line interface slots on the motherboard. It provides an FXS interface for connecting a regular subscriber telephone or modem. Sometimes also referred to as a "SLIC", Subscriber Loop Interface Circuit. My design is a simplified version of the Motorola MC3419 concept, but based on commonly available parts. That being said, corners have been cut and this interface is not intended to support lines across town but is perfectly fine for lines within the same building. Line supply and off hook detection 24V DC is supplied to the line through Q2 and Q3 which forms two gyrator circuits with one shared decoupling capacitor that AC isolates the line from the supply and ground. This is a very important part of the interface since it keeps the line balanced and maintains line impedance. Without this there will be a significant signal loss and impedance mismatch. Line DC current is limited by R1 and R11. A phone generally needs around 20-100mA DC current to function properly. The voltage drop across these resistors is also used to detect off hook state using Q1 and Q4. There must be a current flowing through both for the line to be considered off hook. This makes detection more reliable. Audio path The line can be considered as a balanced bidirectional audio signal. Capacitor C3 removes the DC component and connects the line to one side of a 600:600 audio transformer. This transformer together with the two zener diodes D3 and D4 offers protection for the rest of the exchange. Ring signal injection This is one of the more tricky parts of a line interface. A high voltage AC signal is to be injected onto the line while maintaining the DC supply. It is also very important to be able to quickly detect off hook state during ringing and immediately remove the high AC voltage. Otherwise the connected phone may get damaged. This is often referred to as "ring trip". I have solved this using a 2-pole relay that injects an AC coupled signal onto both legs of the line. Ideally this AC voltage should come from a floating transformer winding. R8 and R10 limits the current. To isolate the rest of the circuit from the high AC voltage there are two diodes, D2 and D5. When the line is on hook there is no DC current flowing through the diodes and they are effectively blocking AC. When the line goes off hook the diodes are biased by the DC current and AC is passed. This means it's very important to sequence this correctly. Never turn the ring AC on while the line is off hook, and during ringing turn the AC off as soon as the line goes off hook. I did experiments using opto-triacs instead of a relay and while it works a relay actually offered better isolation and is more commonly available. To avoid clicks and pops on other lines while relays are operated I use a 12V relay and a 1kOhm series resistor for filtering. The ring AC voltage is a high amplitude signal and great care must be taken to isolate it from the signal path when line is not ringing. Interface The FXS card have two connectors that plugs in to one of the motherboard line interface slots. J2 is the high voltage connector carrying the +24V line voltage and the AC ring high voltage. J3 is the low voltage connector carrying control signals and audio. These two connectors are on separate grounds and isolated from each other by the opto-couplers and transformer. The line itself hooks up to J1. Two 10 Ohm resistors on each leg of the line aids balancing and acts as fuses in case of a catastrophic event.

Motherboard

In my design the motherboard have eight "line" interface slots. A line in this case is an interface for hooking up a subscriber/extension/telephone. Depending on what type of line card is installed, different kind of equipment could be hooked up. I wanted this modularity so I could experiment with different FXS designs and other types like a radio patch or computer audio I/O, without having to redesign/rebuild the entire motherboard. Control In order to make this design flexible and accessible I decided to use a common Arduino Nano as the main controller. It does not natively have enough I/O pins so a chain of five '595 shift registers are used to provide 40 outputs that are used to control the various parts of the PBX. Audio routing On the motherboard there are six audio buses. Each of the line interface slots can connect to any of the six audio buses through CD4051 multiplexers. One per line slot. Two lines connected to the same audio bus can communicate. This also means that the exchange can in theory handle up to six simultaneous calls. Besides audio buses, each line can be connected to either a termination resistor or a common progress tone. It's important to keep all active lines terminated at all times. Progress tone generation For simplicity there is only a single shared progress tone oscillator. It's a simple Wein-bridge design with a pair of diodes for level control. When adjusted to 425Hz it sounds like a real Swedish exchange, but it can be tuned to any frequency of choice. Dialing and DTMF decoding The hook status of each line interface is directly connected to the controller. This means the software can handle pulse dialing. But in order to support DTMF dialing there is also a single DTMF decoder on board that can listen on any of the eight line interfaces. Some care must be taken to release the decoder as soon as it's not needed since it's a shared resource. Compared to actual legacy telecom gear a 8:1 ratio between number of lines and number of DTMF decoders is quite reasonable. Expansion Along with the eight line slots there are also three generic expansion slots. These slots have more pins and have access to all six audio buses at the same time (no multiplexer). These slots would be suitable for features like trunk interfaces, caller ID or music on hold. The expansion slots are part of the shift register control chain so each slot can contain shift registers for control pin expansion. There is also an extra fourth expansion connector that is smaller and without access to any analog audio buses. This can be used for things like status LEDs. High voltage AC AC signal for ringing is generated using an on-board software controlled H-bridge. This can then be fed into an off-board step-up transformer and then back onto the AC ring signal supply that reaches all line interfaces. The idea with this is to make it flexible since depending on what phones are connected the ring AC signal requirements may be different. Some modern phones may be just fine with 24V AC so in that case no step-up transformer is required. Others with big mechanical ringers may be really power hungry so even an external buffer and big step-up transformer may be required. Power supply The PBX is designed to be powered with a single 24V DC supply. The onboard DC/DC converter provides +/- 5V that supplies both digital logic and bipolar supply for analog audio multiplexers and op-amps. When an external AC buffer board is used (see above) it needs to be supplied with 24V DC as well but it can come from the same source.
This article is currently being updated! Check back in a bit for the rest!
DIY HP RF power sensor
Back in the day Hewlet Packard used to make really nice test instruments. That division later became Agilent, which still makes nice instruments, but there is something special about the vintage HP stuff. The substantial part of my lab consists of vintage HP gear. I really like the look and feel of them, and they are maintainable in a way that, in my opinion, current instruments generally never will be. They also come with beautiful manuals that not only tell you how to operate the instruments but also, in great detail, how they work. Even now, several decades after production it's still possible to source or manufacture parts to maintain these instruments. In some cases HP made their own special original parts that makes service a bit difficult. One such situation is the RF power meter sensor heads. The HP RF power meters were very good performers when they came out. They consisted of the meter itself that resembled the usual HP series of instruments, but they also relied on interchangeable sensor heads. That made it possible to use the same meter with different sensor heads with different specifications and for different purposes. All well and good. The big problem here is that the sensor heads are easy to damage by running them out of specifications (like over power or input DC). What makes this even worse is that all of the HP sensor heads are made with HP special parts that are nowadays unobtainium. This has led to an abundance of cheap HP RF power meters on the market but very few matching sensor heads, and without a sensor head the meter is unusable. I have attempted to re-create a sensor head that can be used with the HP 435A, 436A and 438A series meters.

RF power sensor types

Most of the RF sensor heads HP made for these meters were thermocouple based. Simply put, they work by dissipating the incoming RF energy into a load resistor and then measure the increase in temperature of that resistor using a thermocouple and something like a Weatstone bridge to determine the RF power. They can be made to have great performance and accuracy but are generally not well suited to measure very low power levels. They are also difficult to DIY. Another very common way of measuring RF power is a diode based sensor. It also works by dissipating the RF energy into a load resistor but instead of measuring temperature it measures the voltage across the resistor. This will be an AC voltage that can be rectified into DC using a fast diode. The diode sensor is not as accurate as the thermocouple sensor but can measure very low levels. The main drawback is that it is greatly affected by the linearity and temperature coefficient of the diode. HP made one popular RF sensor head of this type called the 8484A. My first attempt will be to see if I can build a diode based RF sensor head, similar to the 8484A, that can be interfaced to an HP 435A, 436A or 438A power meter.

HP sensor theory of operation

All HP power sensors of this type consists of what HP refers to as an RF bulkhead assembly containing the input RF connector and either the thermocouple or the diode based detector. This is a very special and custom HP part that is not easily reproduced. The reset of the sensor is a fine tuned chopper-amplifier. Or rather one half of a chopper amplifier. The other half is in the meter itself. Below is the schematic for the HP 8484A diode based power sensor head. The schematic does not reveal details around the HP RF wizardry but it does show the basic electrical construction. Major parts of what makes the HP sensors perform well is in the mechanical construction and component selection, many of which are HP custom. Completely replicating this today is more or less impossible but we can make reasonable assumptions and perform component substitutions to get us well on the way. A1 in the schematic is the venerable bulkhead assembly. In this case a diode detector encased in a carefully crafted aluminium shell to optimize frequency response and SWR, all interconnected using spot welded gold wires to minimize thermoelectric effects. Here is where my design have a very tough time trying to keep up with the original. A2 is the chopper-assembly. This is the PCB in the sensor containing the first part of the hi-gain chopper amplifier. Even though it's a relatively regular thru-hole design the two chopper FETs are on a special shared HP silicon substrate. The two output gold wires from the bulkhead assembly are press-fit onto this substrate, again to minimize thermoelectric effects. The rest of the circuit is a relatively simple amplifier stage. The biggest problem here is to find suitable transistors to use for both the FET-chopper switches and the amplifier. This resulted in a lot of trial and error. Not only is the component selection critical, but the actual layout and signal routing plays a very big part in this. The chopper frequency is around 200Hz and is supplied by the meter as two 180 degrees out of phase signals. One for each chopper FET. The timing of these signals is very critical. More on this later. In order to support multiple sensor heads of various ranges the meter display can show different ranges. The range however is not user selectable but instead a resistor in the sensor head tells the meter which display range to use. HP calls this the mount resistor and has to be one of a few discreet predefined values corresponding to the available ranges. The resistor forms one part of a voltage divider that drives a set of comparators in the meter.

The sensor head connector

In order to even get started I needed a way to connect things to the meter's sensor head input. The connector here is a bit unusual but not HP proprietary. It's an C091 series connector from Amphenol. The connector I found that matched the HP original is the 12pin T3638-004 connector. Even though they are relatively expensive at 30 euro a piece, they are still available.

Detecting RF power

The second core part needed was a reasonably well performing diode RF power detector. After some digging I decided to try basing the detector around a BAT62 diode. More precisely the BAT62-02V from Infineon. It's an RF diode that I assumed would be well suited for situations like this. In the end I did not try any other diodes since this one worked quite well. The detector can be seen above. Physical design is important here in order to achieve good performance. I decided to build the detector directly onto an PCB SMA connector using SMD components. The 50 Ohm load is made up using two 100 Ohm 0805 resistors in parallel soldered directly onto the base of the SMA connector to dissipate heat into the housing. The diode is then soldered onto the tip of the center pin, away from the load resistor heat source, and held in place using the two filtering capacitors. This design needs more work but it performed reasonably well up to a few GHz and was good enough for me to continue working on the chopper amplifier part of the sensor. The first experiments with the chopper design was made using flying point-to-point assembly to reduce lead lengths and influence by board substrate. It quickly became apparent that the HP design was very sensitive to the physical layout. At first I tried to reproduce the circuit using modern transistors but it was difficult to make it stable. Without knowing the exact specifications of the original proprietary HP transistors I had to guess here. In the end I opted for older/slower transistors that was less temperamental and performed much better and probably also more closely matched the originals in the HP design. Using a precision DC source as a substitute for the diode detector I was able to get the HP 436A to display any value within the selected range and hooking the diode detector up to the chopper amplifier did indeed produce reasonable results. To generate the very small DC levels needed I actually did not use a DC source per se, but an HP 6181C current source and a very small shunt. It's an easy trick to generate low-noise DC. Below is a few images of the first substrate-less prototype on the bench. It could detect signal levels from around 0dBm down to -30dBm but below that it was too noisy. It really needed to be shielded. After shielding it reached down to -40dBm and the entire range was a lot more stable. The thermal mass of the enclosure also helped stabilize the readings. No wonder the HP 8484A sensor is encased in a big chunk of machined aluminium. I found a nice aluminum enclosure that could fit an N-connector directly at one end but the C091 connector at the other end was a tight fit. I ended up using my CNC mill to get the mounting hole placed exactly where I wanted it. Drilling a big hole in a small piece of thin sheet metal can be tricky. Now on to cleaning up the inside.

My first proper version of the sensor

Below is a schematic of the latest iteration and it took quite a while to get here. Keep in mind that the schematic alone is not enough to build a working sensor. The assembly itself is very critical. For the chopper transistors, Q1 and Q2, I used a pair of BF256B FETs that has to be reasonably well matched (it may take a few tries), and in order to improve temperature stability I also glued them together. This is probably the most sensitive part of the circuit. Putting Q1 and Q2 onto a PCB is difficult. The inputs to Q1 ad Q2 should not be routed on a PCB and must consist of as few materials as possible to avoid thermoelectrical affects (resistors R1 and R3 helps limit this to some extent). In my design the output of the diode detector is directly soldered onto the inputs legs of the chopper FETs. The 200Hz chopper gate drive signals that controls these switches is very sensitive. The input capacitance of the FETs affect the switch timing and has to be adjusted very carefully. In the schematic there are two capacitors, C2 and C3, between gate and ground on each FET. In reality only one of them need to be fitted. The capacitor(s) need to be selected experimentally for best zero reading on the meter. In the original design HP used two flying wires for these signals that went directly from the connector to the FET inputs. The timing could then be even more fine tuned by wiggling the two cables around for the best reading. I found that I could route both signals together in a screened cable from the connector all the way to the FETs with good results with the screen connected on one end to the guard ground, and then carefully select capacitors C2 and C3. The amplifier transistor Q3 is less critical. Here I found that a BC337 of similar age and generation worked well. The gain of the amplifier can be tweaked by varying R7. Here the gain has to be selected to match the measurement range of the sensor. In my case I selected a mount resistor value of 22k which set the range to -40dBm to 0dBm to match my diode detector.

Conclusion

It is really difficult to construct a high performing RF sensor. I understand that now more than ever. The fact that HP managed produce these high performing sensors in great numbers with strict specifications is impressive. No wonder they were expensive and still is. I'm very pleased that I managed to cobble together something similar and compatible that is actually usable, and made using only current off-the-shelve parts. My sensor head is definitely not in the same class as the originals, but for most stuff that I do it's enough. And more importantly, I can use this cheap and easily reparable sensor head to verify unknown signals before risking any of the fine HP sensors and their unobtainium parts. Image above showing my sensor to the right together with two common HP sensor heads. The 8484A diode based sensor and the 8482A thermocouple based sensor. This new sensor has quickly become my go-to sensor in the lab. I really like that it is small and light. That means less risk of breaking whatever it's hooked up to. I'm tempted to make an SMA version. That N-connector is good and robust but many modern devices use smaller connectors. The lightness has it's downsides too. The original sensors are heavy because they are very well shielded and has a bigger thermal mass. My small sensor has more input filtering to mitigate the extra noise, but that also makes it slower. It is also more susceptive to sudden temperature changes. Like hand holding, which is always sensitive with these sensors but it becomes more apparent with a small thermal mass.

Next step

I'm curios to explore other diode detector constructions. The detector I put together here can be made to perform better in may ways. With other detectors other ranges would also be possible. I find the -40dBm to 0dBm range to be quite useful for what I do, but sometimes a little more sensitivity would be useful. The linearity of most diodes are better a lower levels. Maybe even combine a diode detector with a built in fixed attenuator would be an option. That could also improve SWR. There are also many new integrated RF detectors. Maybe some of them could be used as a front end detector. They do however need a DC supply which does not exist in the cable. Maybe the relatively powerful chopper signals can be used to extract power. Many options to consider. To be continued...
Expanding the TRS-80 MC-10 internal RAM
Even though the MC-10 was marketed as a low-end machine, shipping it with only 4k of RAM is extremely limiting even back when it was released. It soon became very clear to me that more RAM was going to be needed in order to do anything useful. There was an official 16k RAM expansion unit that plugged in to the expansion port. I think that was the only official expansion ever released and it was quite common among MC-10 owners. The expansion port of the MC-10 is a little different to, say the Commodore 64, where the expansion port had a dedicated place in the memory address space. In the MC-10 the expansion port has access to every address in the machine and with a single input pin an external device can disable the internal address decoding entirely and place itself anywhere in the address space. Quite flexible actually but it does require relatively complex expansion cartridges. You can not simply create a game/progam cartridge with a single ROM for example. The expansion port comes with a drawback though. Even if it can insert devices and memory anywhere in the address space, it can not be used to expand the memory accessible by the 6847 VDP since the VDP and internal RAM is hooked up to an internal bus that is isolated from the expansion port. Since the 6847 VDP can address up to 8k of video memory it would be nice to expand the internal 4k RAM on that internal bus to 8k so that the full potential of the 6847 could be utilized. There was actually an article published in 1987 that explained such a modification. It involved piggybacking two more 2k SRAM chips on top of the existing ones and add some additional decoding. Today I would not recommend following that article. Not only does the article contain a few critical errors but it's just an unnecessarily complicated mod that adds four more chips, and piggybacking the RAM chips makes the RF shield not fit any more. I have another approach that involves just swapping the two onboard 2k RAM chips with a single 8k RAM chip. Actually the end result is reducing the total chip count by one.

Theory

The MC-10 address decoding is a bit odd but relatively simple. The address space is divided into four 16k areas, each with it's own select lines for read, and write where applicable. These select lines are generated from address lines A14 ad A15 by U4 74LS155. The second set of select lines ($4000-$7FFF) are used for the two internal RAM chips. Since they are smaller than the 16k area they are assigned, the memory will show up repeated four times within this area. This confuses MS BASIC so that it detects all 16k as available memory. In order to fix this RadioShack bodged on an extra 74LS32 that gates the write signal to the RAM with address line A12 which effectively block writes to the first and last mirror of the 4k RAM in the 16k area. This makes MS BASIC happy and correctly detects the first 4k as available memory. To make the 6847 VDP able to access all the 8k of new RAM we have to make use of its unconnected DA12 pin. The original design uses two buffers to isolate the CPU A0-A11 from the VDP DA0-DA11 address lines. The two 74LS367 buffers have no available gates to accommodate A12/DA12 and I did not want to add another big chip just for that so took a shortcut. The same way I did when designing my MC3 video card, I used a single resistor to multiplex the two address lines together. This works since the access to RAM is multiplexed, the CPU and VDP never tries to access the RAM at the same time, and the VDP is nice and tri-states the DA0-DA12 lines when not accessing the bus. Hooking the VDP DA12 pin up to the RAM directly and the CPU A12 pin via a resistor makes up a crude multiplexer where the VDP always "wins" when it has access to the bus and backs off (tri-states) when the "weak" CPU has access to the bus.

Putting it all together

My idea is to remove the two internal 2k 4016 RAM chips and replace them with a single 8k 6264 RAM chip. Luck have it that the bigger 6264 is in large part pin compatible with the smaller 4016, even though the 4016 is a DIP24 and the 6264 is a DIP28. Only a few pins need to be bent out and re-arranged to make this work. This is the schematic of the modification. The 6264 will be soldered in place of one of the two 4016 chips (I used U10) . The legs 1, 2, 20, 23, 26, 27, and 28 of the 6264 bent out to the side, parallel to the board and away from the 4016 footprint. With the legs bent out the 6264 will fit into the board instead of the 4016. Then it's a matter of running a few wires around to hook up the remaining pins. Use the schematic and photos below for reference. Note that pin 1 of the 6264 is not used and should be left unconnected. The top 74LS32 gate in the schematic illustrates the bodge wire from U12 that needs to be moved from address line A12 to A13. The signals are easiest to reach using the vias as in the picture. There is no need to cut the existing A12 wire, just move it to the other via, so this mod is 100% reversible. For reference this is what the board looks like before the modification. The two 4016 RAM chips down to the right. Both will have to be removed. As always some care must be taken while desoldering and don't rush it. (As usual if you are not confident removing components like these please please please stop here.) This is the completed modification. The 6264 soldered onto the board without socket. This is a personal preference. It's not possible to use a socket and still be able reattach the RF shield. With this modification MS BASIC now has 7238 Bytes free and the VDP can access the whole 8k address space!
Getting to know the TRS-80 MC-10
Shortly after I started my MC3 computer project I became aware of another computer from back in the day that was eerily similar in name and CPU choice. The TRS-80 MC-10 by RadioShack. From what I understand it was marketed as a low cost alternative to the bigger TRS-80 Color Computer but it did not sell very well. Here in Sweden it is very rare.

Basic specs

- Processor: MC6803 0.89 MHz (derived from the 3.579545 MHz NTSC color crystal) - Video generator: MC6847 (only RF output) - Sound output: Single bit software flip-flop - RAM: 4kB - ROM: 8kB - Storage: Cassette I/O - Expansion: Bit banged RS232 and an expansion port with access to system bus - Keyboard: 48-keys "Chiclet" that is actually not that bad My MC-10 is originally from Canada so it's an NTSC version. I've heard rumors of a PAL version but never seen one. First I tried hooking it up to my modern LCD TV but it did not work very well. The MC-10 can be set to either CH3 och CH4. Not only was the image practically unusable but CH3 did not work at all and setting it to CH4 made it sort of work if I the TV was set to CH3. The RF-modulator was clearly out of tune. This is the best image I managed to get out of my Samsung TV. Not good enough. Let's pop the hood and see what can be done! Armed with the service manual and schematic I went in. RadioShack sure tried to meet regulations with the MC-10. That shield is thick and needed a lot of heat to desolder. There is a shield on the back of the PCB as well held on by small clamps. That bodgy looking 74LS32 is actually part of the official schematic. It even has a label. It’s a fix for making the code in ROM detect the correct amount of RAM (more on this later). Let’s get that RF modulator out of there and have a closer look. No surprises on the PCB under the RF-modulator. The machine gets its main clock from the RF-modulator though so it will not work without it and the chip inside (MC1372) is actually the NTSC color encoder so the RF-modulator is an important part of the machine. A quick look on the spectrum analyzer made it clear why I could not get my TV to lock on the MC-10 signal. Here the modulator is set to CH3 (61.25MHz) but the actual carrier at 67.60Mhz is closer to CH4 (67.65MHz). The audio sub carrier side bands are clearly visible though. The MC-10 RF modulator 4.5MHz audio sub carrier is there and looks to be reasonably within specs. The HP 5316A and the HP 5342A are both on the same frequency reference and displays a little differently. Most likely due to the different load they put on the oscillator. The color crystal oscillator should be 3.579545MHz and is easier to measure reliably. Needs a little tweaking but is not the reason the MC-10 RF modulator carrier is off frequency. I decided not to dive deeper into this and instead focus on how to get a composite video signal out of this machine. Even though the MC1372 is designed to generate an RF signal, there is a paragraph in the datasheet about striping the RF oscillator from the circuit and having it generate composite video. I pulled the crystal and the MC1372 from the original modulator and put them on a breadboard roughly the size of the original modulator. Followed the examples straight from the MC6847 and MC1372 datasheets and got something that sure looks like a composite video signal! Moved on by adding the final two transistor output stage as described in the datasheet as well as two trimmers to set the working point of the amplifier. After some quick adjustment I was greeted with a very nice and colorful image. The output is a 3.5mm stereo jack placed in the same spot as the original RCA RF output on the modulator. This way I have both video and audio output without any modification to the case. Added an attenuator and low-pass filter for the single flippy bit audio and routed it to the jack as well. Now I could finally use the TRS-80 MC-10!

Poking around

Now when I could actually look at the video output without imminent headache I started looking around using the built-in basic and the original manual. Turns out that the keyboard is actually not that bad for something like this. The thing that takes some getting used to is that there is no backspace key. To correct your typing errors you either have to press CTRL+A which will act at backspace, or CTRL+Q which will delete the entire line. There is also only one SHIFT key, to the right, and only one CONTROL key, to the left. This takes some getting used to but after a while the typing experience is actually quite good. On power on you are greeted with the basic startup screen. MICROCOLOR BASIC 1.0 COPYRIGHT 1982 MICROSOFT That is very similar as the original 6803 Microsoft basic.MICROSOFT BASIC VER. 1.0 COPYRIGHT 1982 MICROSOFT Comparing the disassembled MC-10 ROM with the Microsoft 6803 basic source reveals that, indeed, it is the Microsoft basic with a few added custom tokens like SOUND for making noise and SET, RESET and POINT for modifying video memory etc. In general the basic is a very run of the mill Microsoft basic which is a good thing.

Memory map

Digging further into the address decoding reveals some of the, lets call them cost saving, choices made by RadioShack. The 4k of RAM is located at all the way up at $4000-$4FFF and the incomplete address decoding makes the RAM also appear at $6000-$6FFF. The schematic explains a bit of this. The 64k address space is divided into four 16k chunks by the U4 74LS155 decoder. The first 16k chunk is unconnected making the only thing existing there is the internal CPU registers and devices. The second 16k chunk is the RAM of which only 4k is used. That's the reason for the RAM showing up at two locations, and also the reason for the bodged in U20 74LS32 which is used to disable write to RAM in the second 4k area just beyond end of real RAM. I suspect this is to make the Basic detect the correct amount of RAM on startup. The Basic memory size detection routine is quite crude and will continue counting mirrored RAM as new RAM as long as it is writable. Here RadioShack simply opted for a hardware patch instead of altering the ROM. The third 16k chunk is decoded into two single byte devices, one latch on write (U8) which controls the five bit VDP config register and one bit sound output, and one buffer on read (U14) which scans the keyboard. The last 16k area is used for the ROM. Here RadioShack made it possible to use both 8k and 16k ROMs but only 8k was ever used as far as I know. This means, just like the RAM, the ROM is mirrored on this area. One thing to watch out for here is that the ROM is referenced to using the lower half of the 16k area but the CPU vectors are at the top of the 16k area which relies on the ROM being mirrored. To sum it up the memory map looks like this: $0000-$001F --- 6803 internal registers $0020-$007F --- UNUSED $0080-$00FF --- 6803 internal RAM $0100-$3FFF --- UNUSED $4000-$4FFF --- 4kB RAM $5000-$5FFF --- mirror of 4kB RAM (read only) $6000-$6FFF --- mirror of 4kB RAM (writable) $7000-$7FFF --- mirror of 4kB RAM (read only) $8000-$BFFF --- Minimally decoded single byte I/O slot for keyboard, VDG control and sound out $C000-$FFFF --- 16kB ROM but only 8kB used and mirrored twice I will continue exploring the MC-10. One of the first things I will start working on is some form of memory expansion. 4k is simply too little to make use of all the things this machine is capable of.
MCFS 2.0.3
This is a quick update to my MCFS file system to version 2.0.3 that contains stability updates to the compact flash driver as well as changes to the 'ls' and 'dir' command to now show file sizes in decimal form instead of hexadecimal. Thank you Steve for the debugging and feedback!

Source code for MCFS 2.0.3

The source code structure is the same as for 2.0.2 and divided into four files. mcfs2.asm - main code mcfs2_rtc.asm - driver for the real-time clock mcfs2_storage.asm - driver for flash card storage mcfs2_ram.asm - variables in RAM format.asm - flash card format routine (use with caution) Make sure you read the documentation in the original article --> HERE

Compiling

The source files need to be combined in order to compile MCFS2. Either the assembler have the ability to read all files sequentially or they can simply be concatenated before compiling. Example 1 - all files at once # as1h mcfs2.asm mcfs2_rtc.asm mcfs2_storage.asm mcfs2_ram.asm # as1h format.asm mcfs2_storage.asm Example 2 - concatenation # cat mcfs2.asm mcfs2_rtc.asm mcfs2_storage.asm mcfs2_ram.asm > combined_mcfs2.asm # as1h combined_mcfs2.asm # cat format.asm mcfs2_storage.asm > combined_format.asm # as1h combined_format.asm Care must be taken to read the files in the right order. As a reference I have included my resulting S19-files. mcfs2.s19 format.s19
[show older articles]