PSK31 Audio Beacon     

PSK31 Beacon


Project Description


App #1: Tone Gen

Description

Source Code


PSK31 Beacon

Description

Schematic

PCB Layout

Source Code


Programming the SX

Useful SX Links

SX28 Overview

Beaconing Guide


Back to 
Digital Homebrewing Home Page


The SX Microcontroller - An Overview

A comparison of Microchip PIC to the Scenix SX microcontroller with some historical details

by Allan Owen, WA3OWT

Many people know of Microchip’s PIC16xx series of chips, but not as many are aware of the heart of this project — the Scenix SX microcontroller (MCU). Very similar in internal construction, features and software instruction set, the "SX" offer tremendous speed improvements over the PIC – the SX is about 40 times faster! Because of this speed advantage, the SX is able accomplish real time control and signal processing that begins rivaling the domain of DSP chips.

But first, since so many of us are familiar with the PIC series of MCUs, let’s approach the Scenix SX overview in the form of a comparison to the PIC.

Microchip has provided us with a variety of very useful programmable MCU that can be used to design or replace electronic logic and other kinds of control circuits. An MCU is an integrated controller plus memory and I/O peripherals. For many applications in electronic logic and controls the computational requirements are not extensive and the MCU, will do just fine — this is where the small PIC devices really excel.

In fact the "PIC" name that Microchip has given to their parts is an acronym for the words Programmable Interface Controller, a suitable title if ever there was one. These devices are small 8 bit self-contained microcomputers with CPU, program memory, data storage and Input/Output (I/O) functions built in. There were originally three levels of capability and complexity in the line of parts from Microchip, beginning at the low end with the 16 series, the intermediate 17 series and the high end 18 series. These devices had different internal control word lengths and memory array sizes, but in general, the low end 16 series had smaller memory available for both the control program ROM (read only memory) and the internal stored data RAM (random access memory).

A typical early low end device, such as the popular 16C54 had, for example, an Electrically Programmable Read Only Memory (EPROM) size limit of 512 words of 12 bits each. So the control program would be limited to 512 words. The internal RAM for storing data was limited to 25 bytes. The I/O port lines available to connect signals to the outside world, numbered 12 in total. The part was mounted in an 18 pin Dual In-line Package (DIP) or the smaller surface mount equivalent. Higher capacity parts with more resources were offered in larger packages, such as the 16C55 with 20 I/O lines in a 28 pin DIP. Also more program and data memory is available in the 16C56 and ’57, with 1K words of program space, 25 bytes of data, and 2K words of program, 72 bytes of data, respectively. Larger memory arrays became available in later series parts.

Even though memory resources are quite limited, a lot of control can be done with these small controllers using the easily mastered instruction set which has only 33 commands. These devices are so powerful and flexible that they can be used to perform logic and control functions that would be literally impractical to do with discrete components and logic arrays. At the same time, the smaller parts can be easily programmed to perform simple control logic that can cost effectively replace the same capability of a handful of TTL or CMOS logic IC’s. The parts are made with a modern CMOS semiconductor process which provides the designer with many choices of operating conditions. One being high speed operation, by using a fast clock oscillator for system timing, to obtain fast logic signal response, or conversely, very low power operation, by using a slow clock oscillator, where this option would offer a low current drain, and long battery life in portable applications.

But now we come to some of the important differences between the MCUs of Microchip and Scenix. Most notably, the 50-, 75- and even 100-MHz clock speed capability of the Scenix SX far exceeds that of the Microchip PIC, which will run at most at 20 MHz. (The original "flash" memory version of the PIC, the 16C84 and later revised into a 16F84, can only be run as high as 10 MHz.) Newer versions of PICs, having larger flash memory have become available, and they do run up to 20 MHz, but both the original ‘C84 and ‘F84 versions are still very popular.

Programming internal memory and loading program can be accomplished using a serial data loading mode supported by a few IC pins, so it is possible for both manufacturers to use a special in-circuit programming circuit design, allowing fast and easy program loading. The PIC program memory of these original parts is EPROM technology and can only be programmed once in the normal molded plastic package (called OTP, for one time programmable). Development parts use a ceramic package with quartz windows for erasing the program memory with UV light energy. As each new version of the software is written, it is assembled or compiled and the written into the program memory to test and evaluate. To change it then, you must erase the old code from memory, by flooding the chip with UV light energy for 20 to 30 minutes, and then electrically writing in the new program, referred to as "burning" the EPROM memory. This software development method has been used with small micro-controllers in embedded systems since the early days of microprocessors about 30 years ago, and it is still facetiously referenced as the "burn and learn" method.

Flash memory of today’s MCU’s has become very useful in rapid development projects where frequent software changes require lots of reprogramming. The flash parts allow very quick reprogramming, actually writing over the old program using electrical signals, and then electrically reprogramming the data into EPROM memory. All of the Scenix parts are made with easily reprogrammed flash memory, which is electrically erasable or rewriteable, for the program space as well as turning on or off many other chip features such as the oscillator speed, code protection, brown out detection and other items. This is the same EEPROM or flash memory technology available in the Microchip ’84 and most later parts.

The Parallax company in Rocklin, California, developed an amazing product called the Basic Stamp using these early PIC MCUs as the control device. In fact they made a small single in-line (SIL) pc board with voltage regulator, micro-controller with clock oscillator, memory and I/O lines. This self-contained board had everything built and ready to use and at a very attractive price of around $30. It operated from a 9 volt transistor radio battery for hours. You could communicate directly with it by using a special cable connected to your PC and it was programmed to respond to a specialized and limited version of Basic. This popular and easy to use, high level language was stored in a separate non-volatile memory IC, outside the micro-controller on the Basic Stamp. The very successful Stamp product is still in production and has seen many improvements including a big brother version providing more functions, and features such as more I/O lines and memory for the stored program. During the development of these products, Parallax apparently got technical information and architectural details from Microchip about the internal features of the MCU, a factor which undoubtedly helped them develop better products, but also came back to haunt them in the future.

Computer Science teaches that there are two fundamental architectures used in early computers and likewise in many our microprocessors and MCUs today. The first type is the Harvard architecture which uses at least two separate memory arrays for storing the control program information and the internal data that is being processed. This has a potential speed advantage when the memory can be made from fast RAM and ROM, and also if the instruction set that must be decoded from the program memory by the processor can be reduced in complexity. This is called a RISC processor for reduced instruction set computer, and most DSP chips being used today owe their performance to factors such as those described here. The second type of popular computer architecture is Von Neuman which has one combined memory that freely mixes the program commands with the data. In fact everything looks like one big memory array. This computer architecture may appear to be simpler than Harvard type, because the CPU treats everything including I/O in the same way, just like memory, and in fact most mainframes and minicomputers are structured this way, with claims that cost reduction is afforded by this approach. The penalty of course, is that the CPU needs to unscramble the code from the data. So it must do some de-multiplexing while performing those sequential op code fetches. For this reason, the computer probably cannot run as fast in this form and commands are not often simplified, since the system must be able to do many kinds of data manipulation directly into and out of memory and so you now have the complex instruction set computer (CISC type).

The microchip PIC controllers are RISC type and all of have Harvard type architecture, with separate internal program and data memory. These are in fact of different bit lengths or widths, as the data memory is 8 bits wide and the program memory is 12 bits wide in the 16C series of parts. As far as the performance of the PIC micro-controllers is concerned, the early parts could operate with up to 20 MHz clock oscillator, by using either an external crystal or ceramic resonators. The processor internal hardware uses a four phase clocking scheme, and the result is that using the maximum external clock speed of 20 MHz, for example, the internal processor clock is running at one fourth this rate, or 5 MHz. The micro-controller would execute most of the program command instructions in one or two instruction cycles, so the parts had fairly high performance rating of several MIPS, or machine instructions per second.

Then a few years ago, we hear from Scenix in Santa Clara California. They announce availability of a new MCU that is compatible with the Microchip PIC but operates faster, at up to a 50 MHz clock, and even for a time, they advertised a 100 MHz clock speed version of the part. This grabs the interest of circuit and embedded system designers and some pc board designers quit and run off to Mexico. But Parallax likes it and uses it to increase the performance of the Basic Stamp products. The Scenix parts are so much faster and care relatively compatible with the Microchip PIC that Scenix and Parallax are sued by Microchip for collusion and theft of intellectual property. The suit has been settled and Scenix was bought by Ubicom, a company focusing on IC development for internet connectivity of computer equipment and embedded systems. Today the Scenix parts are doing well in production, have had some upgrades, and are well supported in terms tools needed to develop products. Parallax actually makes the "eval", programming and demo boards for most Scenix customers. These are very inexpensive and include good technical documentation for the new user.

Similarities and Differences

The new Scenix micro-controllers are signal-for-signal compatible with the original Microchip PIC MCUs. In some cases, the package is mechanically different, as shown on the data sheets. One package difference to watch out for is the use of the narrow "skinny dip" with 28 pins arranged as a dual row of 14 pins spaced only 0.300 inch apart instead of the more standard 0.600 inch spacing. The use of this package type saves board space, material and cost, and has very little down side. Scenix also makes the MCUs in the standard molded surface mount packages. Other than package type and dimensions, there are almost no differences of significance between the two manufacturers’ parts.

The software code is compatible too, as the new Scenix parts will run the same op codes and commands as the corresponding Microchip PIC. The same instruction execution speed is available up to 20 MHz clock, in "compatibility mode". The SX parts will run at the much faster clock oscillator speeds too, or down to the low speed clock, in power saving mode. In addition to the fast clock, the SX can run in Turbo mode, where most op codes execute in one instruction time cycle, speeding up program execution considerably from the same code running in a PIC at the same clock speed, where most instructions take 3 clock cycles. The internal memory space is the same for both parts, with the same size program and data memory arrays being used. There are some differences however, mostly to the good. The program memory is all electrically eraseable or flash type, and can be reprogrammed with software changes or updates, up to thousands of times. Software design, testing and revision efforts are improved in the Scenix parts, due to some built-in debugging hardware placed inside the IC, and this works well with simple and inexpensive external hardware and software debugging tools provided for custom development by the designer.

The in-circuit programming (ISP) feature is accomplished more simply with the Scenix parts than with the PIC, and the two programming methods are not compatible. They are both highly effective in being able to make ISP changes after the micro-controller IC is mounted onto the pc board. With most PIC processors, you can add a 5 pin header to bring signals out directly from the board to the programming device. These include ground, 5Vdc, MCLR* (master reset line) and two I/O port lines, RB6 and RB7. A 5 wire cable can connect your board to an external programming device. With the Scenix part, adding ISP is also easy to do. Similar to the PIC, you can add a 4 pin header to bring out the signal lines needed to program the parts. These include ground, 5Vdc, and both oscillator pins (Osc1 and Osc2). The external programming device operates through these lines, and again by using a special cable to an external program device, you can change your control program easily after the equipment is built.

Some specific differences between the PIC MCUs and the Scenix SX28 include several new programmable features in the SX28. For example, the clock oscillator has a programmable gain to help use the device with a wide range of external resonators and crystals. Also, internal circuits to provide the I/O port lines with certain electrical attributes, such as triggering interrupts on change of state, pull up resistors and Schmitt inputs to give clean logical signal response to analog inputs are offered. Other hardware differences include the option to use a deeper 8 level stack instead of the two level stack available in the PIC. In software, significant differences exist with the Scenix parts that allow certain software changes to give high performance capabilities in the program that cannot be done easily with a PIC. Ten additional instructions are available in the Scenix parts, allowing easy bank and memory page switching, and interrupts with context save/restore, making possible faster data table look-ups with less code, and direct control code access which has advantages in fail safe software checking and a few other applications.

Today the Scenix family of micro-controllers includes several replacements for the smaller 18/20 and 28 pin Microchip parts. These offer much faster execution times and they are not much more in cost. Both Microchip and Scenix have new higher capacity MCUs with larger memory, more internal features and external I/O pins. These of course, require larger packages offering 40, and 48/52 pins. These new parts and the tools needed to use them are available from Microchip and their authorized electronic distributors. Scenix also provides support tools, development boards and kits, from distributors and the Parallax Company. For example, a complete development including a sample MCU from Scenix is only around $149. A programming and de-bugging tool is $99 and just a programming tool is available for $79 or less.

Both companies a free and highly integrated development software for PIC designers. The Microchip version, called MPLAB, includes an integrated assembler, linker and loader for the programming device. Scenix takes the same approach to helping the designer to use these parts. Scenix provides development software that includes an assembler, loader and programming tools that work well with inexpensive external hardware for programming and debugging all of the micro-controllers in the family.

Visit www.scenix.com, or www.ubicon.com for engineering application notes, data sheets and code listings for popular functions of the Scenix MCUs used by other developers. And make sure to check out the tools, development kits, educational boards and devices at www.parallaxinc.com. Other technical support and information can be found at www.sxtech.com and www.SX-forum.com .

 


Page last modified: November 28, 2001

Copyright 2001 G. Heron, N2APB

n2apb@amsat.org