Link here

Overview of Hardware and Software
A complete hardware/software development platform for real-time embedded systems


Congratulations on your choice of the PDQ Board™, a compact single board computer (SBC). This page introduces the software and hardware features of the PDQ Board: the RTOS (real time operating system), choice of programming languages, Freescale 9S12 microcontroller, memory, serial communications, real-time clock, and I/O (input/output). These features and capabilities make it a snap to design your instrument control projects.

In this chapter you’ll learn:

  • All about the operating system and software features of the PDQ Board;
  • All of the hardware features of your controller; and,
  • How to configure various options on your controller.
 

The PDQ Board: a compact development board for embedded design

To serve the needs of real-time control, modern embedded computers must have a set of complementary features including operating system software, device drivers, user interface, and expandable IO (input/output). You’ll find the PDQ Board has a set of hardware and software that work together to simplify your product development cycle while bringing new capability to your products.

 

Fast I/O-rich computer

The PDQ Board is a fast I/O-rich computer that dramatically cuts the cost of data acquisition and control. It packs 1 megabyte of memory, communications, dozens of analog and digital I/O lines, and dual expansion IO buses onto a compact low-cost board. This 2.5" x 4" single board computer is ideal for instrumentation, industrial control, automation, and data acquisition.

 

A powerful microcontroller with plenty of memory

The PDQ Board hosts a fast Freescale HCS12 microprocessor. This controller has a 16-bit data bus and uses a Phase Locked Loop to synthesize a 40MHz internal clock and 20MHz bus clock, resulting in execution speeds 8 times faster than the 8-bit 68HC11 processor. more

 

Dozens of analog, digital and timer I/O Lines

The PDQ Board packs dozens of analog and digital I/O lines plus versatile serial communications links onto a compact board. more

 

Easily programmed in C or Forth

The PDQ Board is easily programmable in C, Forth or Assembly using any PC. Built-in programming tools include a multitasking executive and comprehensive device-driver libraries. All functions can be called interactively from the terminal to speed the debugging process. more

 

Need even more I/O?

The PDQ Board can directly host up to 8 I/O expansion modules called Wildcards™ that you can mix and match depending on your application. The easy to use Wildcards stack onto the dual 24 pin Wildcard connectors on the PDQ Board. A convenient Docking Panel™ module includes an efficient switching power regulator, dual DB-9 serial connectors, a power jack and an on/off switch.

Wildcards implement a wide variety of user interface, communications, data acquisition and control capabilities. You can select the Wildcards that meet your needs to configure a cost-effective customized controller for your application. Available Wildcards

The following subsections discuss the interdependent hardware and software aspects of your controller.

 

Real-time operating system and built-in function library

You wouldn’t want to have to load an operating system into your desktop computer each time you turn it on, and the same holds true for embedded computers. Importantly, all of Mosaic’s controllers incorporate a full-time, on-board operating system called QED-Forth. QED-Forth is an interactive programmable macro language encompassing a real-time operating system (RTOS), object oriented graphical user interface (GUI) toolkit, debugging environment, an assembler and math library for use within the Forth programming language, and a comprehensive set of pre-coded device drivers.

These built-in functions make it easy for you to get the most out of your board's computational and I/O capabilities. You can fully program the PDQ Board using only the QED-Forth programming language, or you can program it using only the C language – the operating system’s functions are accessible using either language.

This user guide describes how to program your PDQ Board using the GNU C programming language, and how to use the built-in QED-Forth functions which are accessible from both Forth and C. C and Forth function glossaries provide an in-depth description of every routine. The PDQ Board’s extensive embedded firmware reduces your time time-to-market – we’ve precoded hundreds of useful routines so you won’t have to.

The RTOS in onboard Flash memory also manages all required hardware initializations and automatically starts your application code. It provides the run-time security feature of a watchdog (COP -- computer operating properly) timer.

Programming is a snap using the interactive debugger and multitasking executive. The multitasker allows conceptually different functions of your application to run independently in different tasks while accomplishing their duties in a timely fashion.

 

Your choice of programming languages

You can program the PDQ Board using either the ANSI-standard C language or Mosaic’s QED-Forth language. In either language, you can supplement your high-level code with assembly code. Using either language, you have full access to the firmware functions.

The GNU C Programming Environment

QED-Forth High Level Language

HCS12 Assembly Code

 

Embedded hardware for real-time control

The following block diagram provides a cogent summary of the hardware capabilities of the PDQ Board. Each of the hardware modules shown is described in the following sections. In addition to the hardware shown, The PDQ Board directly hosts up to eight Wildcard I/O modules.

Hardware block diagram of the 9S12 HCS12 single board computer, 9S12 HCS12 HC9S12 development board, showing on-board RAM Flash EEPROM memory, RS232 and RS485 serial ports, I2C, analog I-O, digital I-O and the 68HCS12 microcontroller
Fig. 1  Hardware block diagram of the PDQ Board, a 9S12 HCS12 HC9S12 development board showing the microcontroller specifications, EEPROM, Flash, RAM and I/O ports.
 

Power requirements

The PDQ Board requires a regulated +5 V supply and draws a maximum of 250 ma. It directly hosts up to eight Wildcards, each requiring a maximum of 100 ma. Some Wildcards require an additional +8-26 V supply. The PDQ Board optionally mounts on a Docking Panels which provides a 1 amp 5 volt switching power supply, dual DB-9 serial connectors, dual DB-25 IO connectors, a power jack, and a master power switch. The IO connectors, serial connectors, jack and switch are designed for easy mounting to an instrument panel.

 

The Freescale 9S12 microcontroller

The central block in Figure 1-1 represents the HCS12 microcontroller that provides the core capabilities of the PDQ Board. This chip integrates a central processing unit (CPU), communications, analog and digital I/O, PWM and timing capabilities, and memory. All of these capabilities are controlled by pre-coded device drivers built into the operating system on the PDQ Board. In this document we will refer to the microcontroller chip as the HCS12.

The processor includes:

  • An 8 bit timer-controlled digital I/O port called PORTT. more
  • An 8 bit Pulse-Width-Modulated (PWM) digital I/O port called PORTP. more
  • An 8 bit general purpose digital I/O port called PORTM. Each bit of the port can be config-ured as either a digital input or output.
  • Two 8 channel input ports (called PORTAD0 and PORTAD1) on the processor that can be configured to read either analog or digital inputs. Analog inputs are converted to 8-bit or 10-bit digital numbers by a built-in analog to digital (ATD) converter.
  • Two built-in serial communications interface (SCI) ports that implement the RS232 or RS485 protocols. more
  • One additional available logic-level SCI port on two pins of PORTT. more
  • Three serial peripheral interface (SPI) channels capable of data transfer rates up to 5 megabits per second. more
  • An inter-IC (IIC or I2C) serial port capable of data transfer rates up to 100 kilobits per second. more
  • A watchdog timer that can be configured to reset the processor if the application program fails to execute properly.
  • A clock monitor available to reset the processor if the clock fails.
  • External interrupt request pins and a variety of interrupt functions for quick response to real-time events.
  • 1024 bytes of nonvolatile, Electrically Erasable PROM (EEPROM). more
  • A multiplexed 16-bit address/data bus. more
 

Learning more about the HCS12

The PDQ Board uses a new version of the HCS12 microcontroller, called the MC9S12A512. Freescale’s HCS12 Core User Guide describes the programming registers, addressing modes, and assembly instructions of the HCS12, and illustrates the memory map of the processor. Freescale’s HCS12 Device Guide describes the processor’s hardware, including pin-outs and electrical characteristics. The Block User Guides describe the architecture and control registers for each of the processor’s I/O subsystems (A/D, PWM, ECT, I2C, SPI, etc.). All of these Freescale (formerly Motorola) documents are included as Adobe Acrobat Portable Document Format (*.pdf) files located here.

 

Memory and mass memory

The PDQ Board includes a variety of convenient memory and storage for various applications, including sector-programmable Flash on the processor chip (“onchip Flash”), byte-programmable nonvolatile EEPROM, paged RAM backed up by an onboard Flash chip (“shadowed RAM”), and common RAM that is available regardless of the current page for variable storage, buffers and stacks. Part of the common RAM is on the processor chip (onchip RAM), and the rest is implemented by an external RAM chip on the board. You can also add up to one gigabyte of removable mass storage by adding a Compact Flash Wildcard module.

Flash memory is nonvolatile, so it retains its contents even when power is removed. Flash memory is also re-programmable, and the Flash programming functions are present in the PDQ Board’s onboard software library.

Code can also be compiled into paged RAM and saved to a “shadow” Flash device.

The PDQ Board includes 512K onchip Flash memory, 14K onchip RAM, 1K onchip EEPROM, and 496K off-chip RAM with Flash backup. Code can be located in the write-protectable Flash-backed RAM or the onchip Flash. Some memory is reserved for use by the Kernel (operating system), and the remaining memory is available for use by your application program.

Memory map/allocation for a 9S12 HCS12 microcontroller embedded system
Fig. 2  The memory architecture of the PDQ Board with 1MB of paged memory and 48KB of common memory, showing memory allocation to RTOS (kernel) functions and your application code. 480KB of the RAM is shadowed by Flash for nonvolatile backup.

See "Making Effective Use of Memory" for more details.

 

I/O for measurement and control

The PDQ Board provides a total of 44 I/O channels, distributed among counter/timer, PWM, digital I/O, analog input, and serial communications functions as shown in the following table. As shown in the table, many of the I/O lines can be software-configured to perform an alternate function. The “#” column shows the number of channels available for each function; a serial port is counted as a single channel even though it is implemented by multiple lines. The “Port Name” is the name of the primary hardware register associated with the I/O, and the “Header Labels” designate the pins on the PDQ Board’s I/O headers that bring out the specified I/O lines.

For each of these I/O lines, pre-coded I/O drivers make it easy to perform data acquisition, pulse width modulation, motor control, frequency measurement, data analysis, control, and communications. You may add lots of additional I/O using Wildcards.


PDQ Board I/O summary
Primary Use Alternate Use # Lines Port Name Header Labels Description
Counter/TimerDigital I/O

5V UART
8

(1)
PORTT

(Serial3)
PT0-7 “Enhanced Capture Timer” (ECT) signals, each of which can be an input capture or output compare. 8 or 16 bit pulse accumulators are available. Logic-level Serial3 port on PT4/PT5 using the Software UART library. Also configurable as digital I/O.
PWM Digital I/O 8 PORTP PP0-7 Pulse Width Modulated outputs, or bitwise programmable digital I/O.
Digital I/O 8 PORTM PM0-7 Bitwise programmable digital I/O.
Analog Input Digital Input 8 PORTAD0 AN0-7 8- or 10-bit resolution analog inputs, or digital inputs.
Analog Input Digital Input 8 PORTAD1 AN8-15 8- or 10-bit resolution analog inputs, or digital inputs.
RS232 RS485 1 Serial1 TxD1,RxD1 Xcv1+,Xcv1- Serial1 port, configurable as RS232 or RS485.
RS232 RS485 1 Serial2 TxD2,RxD2 Xcv2+,Xcv2- Serial2 port, configurable as RS232 or RS485.
Wildcard control Wildcard applications 1 SPI0 SCK, MISO, MOSIFast synchronous Serial Peripheral Interface (SPI) port, brought out to Wildcard bus.
Inter-processor interface External SPI Devices 2 SPI1, SPI2 SCK, MISO, MOSI,/SSSerial Peripheral Interface (SPI) channels 1 and 2 brought out to SPI header; may be reserved for interprocessor communications.
I2C Digital I/O 1(2) PORTJ SCL, SDA Inter-IC serial port, or 2 digital I/O lines.
46 Total I/O Channels
 

RS232, RS485 and SPI serial communications

Two RS232, RS485 serial ports, three fast synchronous serial peripheral interface (SPI) channels, an inter-IC (I2C) serial bus, and an additional logic-level serial port provide plenty of communications capability. The HCS12 processor includes dual hardware UARTs, each with a single character buffer. Each of these UARTs drives RS232 or RS485 protocols at a default baud rate of 115.2 Kbaud. Standard baud rates from 300 baud to 115.2 Kbaud are attainable with good timing accuracy. Onboard serial interface chips generate the logic levels necessary to implement either the RS232 or RS485 protocols. Two serial ports allow you to program through one while your instrument can still communicate with a third party through the other.

The RS485 communications ports may be optionally terminated with resistor or RC networks. Pads are also included on the board for insertion of RS485 network bias resistors.

In addition, pins PT4 and PT5 on the Digital I/O Connector may be used as an additional logic-level serial port with speeds up to 19.2 Kbaud by including the Software UART library in your application. If you need more asynchronous serial ports, UART Wildcards plug directly into the PDQ Board’s Wildcard module bus, each Wildcard providing two more full-duplex RS232/422/485 buffered serial communication ports at up to 57.6 Kbaud.

The SPI0 (Serial Peripheral Interface channel 0) is a fast synchronous bi-directional serial link. When configured as an SPI bus master, the HCS12’s SPI links can clock data at up to 10 Megabaud; when configured as a slave, they can run at up to 5 Megabaud. The default speed of the SPI0 link after a restart is 2 Mbaud, and the three wires that comprise this link (MISO, MOSI, and SCK) are brought out on the Wildcard bus to facilitate communications with off-board I/O. The SPI0 channel also interfaces to the optional battery-backed Real-Time Clock on the controller board. Each device that is interfaced to the SPI0 link requires a unique chip select signal so that only one device at a time communicates with the processor. There are two additional SPI channels named SPI1 and SPI2 on the PDQ Board that are brought out to a dedicated 10-pin SPI header. On multi-processor systems they are reserved for inter-processor communications; otherwise, they may be used to communicate with peripheral devices.

The I2C (Inter-IC) bus is a clocked 2-wire bi-directional serial channel. Each device on the bus must have a unique 7-bit address that is included in the message packet to direct the communications to the correct device. If the I2C bus is not needed, the associated pins (PortJ pins 6 and 7) can be configured as general purpose digital I/O (but note that the signals are conditioned with pull-up and series resistors).

The hardware configuration and software control of the serial ports is discussed in detail in the Serial Communications chapter of this document.

 

Real-time clock

A battery-backed real time clock (RTC) is also included on the controller board. Built-in software drivers make it easy to set and read the date and time of day. The onboard battery powers the RTC but does not battery-back the controller’s RAM.

 

Extensible I/O including a direct interface to a keypad and display

Need even more I/O? The PDQ Board hosts Mosaic’s Wildcards™, small I/O modules for sophisticated and dedicated I/O. Up to 8 Wildcards can be stacked directly on the controller. Available Wildcards include:

  • Wired Ethernet, or wireless 802.11b/g modules;
  • Global positioning system GPS module;
  • 16- or 24-bit resolution programmable gain A/D;
  • 12-bit D/A;
  • Compact Flash mass memory;
  • Optically isolated AC or DC solid state relays;
  • Configurable general-purpose digital I/O;
  • Fast, buffered RS232, RS422 or RS485 communications interfaces; or,
  • High-voltage, high-current DC inputs and outputs.
  • Keypad and Display module with a 4 line by 20 character LCD display and a 20 button keypad;

See also → Getting to Know Your Hardware

 
This page is about: HCS12 / 9S12 Hardware and Software Interfacing, HCS12 Embedded Single Board Computer, Easily Programmable in Forth or C, Real Time Operating System, Hosts Expansion Modules, Analog Io, Digital Io, Timer Io, Serial Communications, Built-in Function Library, Data Acquisition, Measurement, and Control – This C programmable HCS12 9S12 single board computer features a real time operating system (RTOS), IO-rich microcontroller (MC9S12DP512 MC9S12A512), memory, serial communications, real-time clock, and dual expansion IO buses. HCS12 development board, 9S12 development board, Freescale HC9S12 MCU microcontroller, extensible io, expansion io, embedded design platform, io-rich, input-output, analog io, digital io, timer io, built-in function library, easily programmed, 9S12 processor, HCS12 processor, real time control, flash, EEPROM, RAM, RS232, RS485, serial communications, SPI, I2C, inter-IC bus, PWM, pulse width modulation, battery-backed real time clock
 
 
Navigation