Designed & Made
in America (DMA)

Internet of Things (IoT) Security, Privacy, Safety -Platform Development Project Part-13 | BASIL Networks Blog BN'B

6 Oct, 2018

Internet of Things (IoT) Security, Privacy, Safety -Platform Development Project Part-13

Part 13: IoT Core Platform Development: Peripheral I/O Device Design
-Device Design From the Beginning

"Two Roads diverged on a wood and I -I took the one less traveled by, and that made all the difference." -Robert Frost (1874-1963)


Quick review to set the atmosphere for Part 13:
From the previous Internet of Things Part-1 through Part- 12:

What we want to cover in Part 13:
OK, since this is the beginning part of the development project after an introductory presentation of the Internet technology of which we will be in communication with, this is a good time to develop our engineering discipline and the documentation process.  The Interactive Product Development System presented here was developed in pieces, manually over many years and since we will be offering it at the end of the series I have incorporated several changes to put it in a full package.   For the road less traveled, we will use the IPD System in real time while we develop our IoT Core Platform since we will be addressing many different aspects of the IoT Platform Project to show a tool of this type is really a good practice to be encouraged.

We will dive right in to designing the peripherals for the IoT Core Platform.  The hardware and software/firmware will take a couple of parts for each peripheral while we include the IPD system with the process to convey the organizational concept of product design.  For those wanting to experience the time element involved in component selection and design feel free to list several of each type of component and verify the selection we have made.  I have a private link to contact me directly from the website and will answer any questions privately for those wanting to participate in our development process.

Lets Get Started:
First  - The IPD Documentation -Developing Documentation Discipline
As we stated many times during this series that product development of any type requires a unique mind-set and the combination of documentation of thoughts and mind-set are essential for a successful product.    As we stated there are many categories of documentation during a development project and the IPD addresses these as an open interactive system.  The user can create segments of each layer of required documentation as the innovation process develops then return to the selected document sections at a later date to pick up where left off to continue the development.  OK, a system like this does exist in large companies and takes a while to learn the ins' and outs', however as entrepreneurs and small companies we need something less cumbersome and intuitive as well as organizational to use as well as much less expensive.

The main purpose of the IPD is to have a project related documentation system for any type of development project.  Keeping the proper documents and design files in a project oriented directory structure and being able to have an abstract outline each file allows the designer as well as new designers that will eventually take over the project maintenance and changes for future releases   There are many different application programs that are used during a development project and handling all the different file type becomes difficult without some type of organizational application program, hence: the Interactive Product Development System.   There are 58 different directories that separate each aspect of the development process, allowing the user to incorporate writing, drawing and CAD, CAM application software for each part of the development while maintaining separate directories for each section of the development.

Figure 13.0 show the startup page and how we create a new Project hence: The IoT Core Platform" using the IPD system.  We already have the conceptual drawing completed so that would be the first to be added to the system. Creating a new project is easy as well.  We will spend more time on the IPD later, our objective is to interact with the IPD while focusing on the actual development of the IoT Core Platform.  The key features for this program is the top level manager controls the access rights to each section of the program.  All sections are entered from a login process that controls the available sections of the development process.  Encryption with a global standard AES256 key may be used or a separate key for each individual access may be set by the top level manager of the project.  Each project is handled separately or may be combined via the AES256 access key.  This allows multiple designers to work on different pars of the project they have access rights to.  The IPD will run locally on a desktop, an in-house controlled server or the cloud, however is it not recommended for the cloud since security is still an issue and trade secrets and proprietary designs should be kept in-house on a controlled server or an assigned workstation.

The IPD System will be available at the end of the series with added features from readers comments from this series.  There are several Reserved buttons for expansion of the program for those that wish to contribute, send me your request either in a file or message using the Contact Form.  To date this program runs on Windows XP, Win7.x, Win8.x, and Win10.x either directly on the local machine drive or on a server.

Figure 13.0 IPD Interactive Product Development System Top Menu Update

The main dialog allows the user to setup a default project that the IPD will automatically load at startup.  Each project has a 4096 byte abstract to summarize the projects description and any special notes that would be useful to those accessing the project.

Figure 13.1 shows the dialog where we can create a new project, open/edit/modify an existing  project.  The projects description is the same that is displayed on the startup dialog and uses a in system RTF editor to add comments to the project abstract.   The user may also browse projects anywhere the system allows access to see the projects that are stored.  One of the comments from a reader was to have a central database of all the projects that the IPD has handled as well as archived, we will be adding this to the program while we write this blog.

Figure 13.1 IPD System Create/Edit/Open A Project

From this point one the project has been created the rest is simply used the IPD for its organizational and security features.   Since we already created the conceptual presentation we just simply add the file along with the API required to open / edit or modify it. From the dialog we also have a time stamp for when we started the file.  There is a add more time to the time elapsed working on this section of the project.   Each section has this feature in order to allow separate develop on each section.   The Project manager has the option of organizing all the different development times for budgetary purposes etc..

The system can handle up to 256 different documents along with the application program to open each document.  Many projects are broken down to sub-projects that are considered modules or sub-modules.  Each of these can be a separate project in a Sub-Project directory in order to keep them in the same top-level directory.  Each of the sub-projects have a unique set of databases that may be shared or kept separate.  We will get into that as the development project moves forward.  Full security access is controlled by the Project manager at all project levels.  Multiple IPD systems may be opened at one time on a single desktop to handle different projects separately on if multiple users are sharing the same desktop.  Each file that is added to the Documents dialogs has its own abstract section allowing the user to give a brief summary of the files contents or any special modifications incorporated.  Last access and creation dates are displayed for reference to the activity of the file selected.  ;All databases may be packed and modified for ease of maintaining the database.  Projects may be archived easily and restored to any directory the system has access to.  Each of the document sections allow the encryption of a single file for communications outride the controlled area if required. If the user encrypts the file with a user private key and looses the key there is no spare key or hidden Administration key to decrypt the file.  The encryption programs is separate from the windows AES encryption and does not use any windows encryption resources. Any mixture of files may be added to the documentation along with the application program to open them. We added the Visio drawing and part 12 of the IoT Platform Development Project series. We use an older html WYSIWYG editor, however there are many free open source and commercial html editors on the market that will run on a variety of OS platforms.

Figure 13.2 IPD System Adding A& Presentation Document

Creators / Innovators  mind-sets are all wired differently and face unique challenges in business when putting a product or product line together for development.  The entrepreneur mind-set, the small company mind-set and the large company mind-set, all have their pros and cons.  Regardless be it entrepreneur or company, at the end of development the documentation should be the same prior to entering a manufacturing environment.  The processes are very similar, the conception of the product or product line, the creation of the high level business presentations that sum up the costs and market risk to obtain the business go-ahead, the technical presentations detailing specifications, testing and validation to solidify the budget "expectations" to create Proof of Design (PoD) and Proof of Manufacturing (PoM).  Then the manufacturing requirements presentations for supply chain, manufacturing costs, testing, packaging and build size.  The differences between the entrepreneur, the small company and the large company are the Return on Investment (ROI) statistics, development resources and of course time to market. Prior to the PoD or PoM the only deciding factor is the accuracy of the documentation created to present the project.

For a large company to enter a market arena, marketing has to show the expected ROI that meets the company guide lines for product development.  For a small company the analysis is similar however the ROI numbers are smaller since the overhead is much smaller.  For the entrepreneur it is generally the question; are the overhead bills being paid?  What will the initial prototype cost and will the market bring in a profit for a few years.  The documentation process should still end up the same, however less costly for the entrepreneur and small company which is where the IPD systems is effective.  As mentioned before I am updating the IPD software as this series as we develop the IoT Platform and there are many new features that I have learned writing this series and am very thankful for the encouragement from all the readers.

[Selection_Menu]            [Top_Menu]

Common Functions of Peripherals:
From our mind-map view in Part 12 on IoT Platform Peripheral's Interface Function Map  (will open in a new window) shows that we will be required to address several different types of peripherals from a single interface structure.   Our intention here is to develop a common hardware function that will allow full control of the devices and data transfers.  This allows us to incorporate different peripheral IC's into the design with simple translation (off the wall marketing plug for the IBPD System on our website) for the different IC's I/O BUS protocols.  Remember we previously discussed the pros and cons of all the peripheral devices embedded with the processor combined on a single chip leads us to separate peripherals and make this a Drop-In accessory.   This approach was how the actual desktops started where you had a processor and support I/O peripherals around it.  

In order to design an efficient multi-peripheral control interface we have to understand and document the various types of BUS translation requirements for each peripheral type.  This is where an FPGA or maybe a CPLD would be the best way to translate the different bus protocols to a single BUS protocol for our IoT Platform.  A single I/O Peripheral protocol will allow software efficiency and hardware stability.  Granted it is a bit more design work but it is a road less traveled in the industry due to pure market drive to compete not necessarily for quality/performance.  In the long run this final multi-peripheral design is a drop-in block for any or the fast changing processor designs to complete an IoT Platform for the next generation.

Peripheral Type

Number Channels

Data I/O Throughput

BUS Interface


Creator / Inventor







I2C® Controller


1MHz Max

8 Bit Parallel  50MHz


I2C UM10204 2014-04-04

1-Wire® MicroLAN





Maxim Integrated

SPI Controller






eSPI Controller





Intel Corp eSPI

CAN Controller






LIN Controller

16 1 Master

LIN 19.2Kbit/s

LIN Devices



RS232 Serial






16/32 Bit Digital Parallel


Max Chip Speed




A/D  - Analog Input



Serial SPI


Analog Devices

D/A - Analog Output



Serial SPI


Analog Devices

Thermocouple Temp Input



Serial SPI


Analog Devices



PWM Output


upto 10MHz

Serial Digital Stream



SQI Controller

4 chan eSPI

50Mbps plus

Serial/Parallel 8/16/32 bit




Ethernet Controller


1 to 10Gbps

Parallel / Serial/ PCIe



Storage RAM Devices (SQI)


80MHz Read




DMA Controllers


upto 50MHz

Parallel 16/32 bit



Interrupt Controller


upto 50MHz

Serial/Parallel 8/16/32



Table 13.0 IoT Interfaces Functions List

Each of these peripheral devices in the Table 13.0 Interface Function List are readily available in IC's and chip form with some type of BUS interface protocol designed in, some serial some parallel.  We will now look ate each of the BUS protocols and design a translator to form a standard BUS protocol our Core Platform.  This will make the Peripheral block a Drop-In device that is capable of being interfaced to any processor or desktop which is the objective of the common BUS architecture.  "A road less traveled" due to market stress and competition pressure to get a product to market before the competition, however a better long term solution when the road is paved.

The Peripheral Interface Function Map shows a common BUS structure that interfaces all peripherals. We will look at this closer when we analyze the timing features a typical parallel and serial bus structure.    To start we will make the decision to insure that all peripherals will have a set of control and data registers.   Over the years of developing peripherals for computer systems there have been may shortcuts to peripheral designs.  Some eliminated Write/Read registers for Write Only Registers and Read Only Registers expected the software to maintain what it wrote to the registers.  part of this was due to the space availability in the logic used for the design.  Today the density has increased to a high enough level that R/W registers are not an issue and in many cases are preferred.  Our design will use R/W register sets for each peripheral.  One of the reasons is it does not require extra CPU instructions to determine that state of the chip as we will experience.

The BASIL Networks Website has several of these interfaces with technical information readily available, so as not to retype everything lets get to the design organization of this platform.  From the list we see that there are several types of interface protocols that we have to address.  The main question at this point is what are the expectations of the data rates for each of these peripherals.  Lets try to answer logically for several applications to show the range of data transfer rates that will determine the amount of buffer memory required to fit the majority of applications for the IoT platform.

The Interface Protocol - Serial, Parallel or Both:
As we observed in Table 13.0 the selection of the IC's for this project primarily support the SPI BUS as the digital data transfer BUS protocol.  Several of the selected peripheral IC also have other data transfer BUS protocols however using a parallel bus several discrete peripheral IC would be very cumbersome to layout on a small PCB as well as maintain a reasonable noise margin for performance of all the peripherals.  Another argument is when we select the CPLD or FPGA pin assignments will be a concern.  It would be easier to have the parallel BUS architecture connect to the MAIN CPU and the peripherals that have to be external such as the high Speed A/D and D/A and others be connected serially or other transform BUS methodologies to adapt to a single BUS Protocol architecture.

Peripheral Characterization for Real-Time Data Acquisition:
The first question that comes to mind is, would we have an application that would use all the peripherals sending and receiving data at the maximum speed of the peripheral?  The answer is possibly if it is operating as a remote controller where environmental parameters are part of the control sequence.  So lets look at what real world data collection would entail and put some real parameters to the data transfer processes.

Side-Note: As a bit of mind-set guidance to encourage creativity; if you ever have the opportunity to develop a friendship with an artist, painter, sculpture etc. ask to spend some time with them while they are creating.  The experience is totally priceless, for you will be able to see both right and left brain working together uniquely to create, the order will also be unique since every mind creates its own order.  The Author is truly fortunate since my wife is and exceptional artist and well balanced in her creativity that I have the pleasure of being with. Ok, that's the personal side, and Oh by the way - creativity is very personal and unique so just allow your mind to flow and visually imagine the pieces being put together on the brains right side and the brains left logic side will guide you to complete the creation in its natural order.  That being stated,  we will not take these peripherals in any order, since that is generally how the creative mind works, which ever comes first since the subconscious already has this worked out, we just have to bring it to the service of the conscious right and left parts of the brain, hence the visual and logical.

Peripheral Memory Buffers:
The is a lot to be said about putting an internal real-time memory buffer on a peripheral device.  Many peripherals incorporate them such as the Ethernet IC's,  Analog Input peripherals, Analog Output peripherals for Analog Waveform Generations (AWG), digital I/O devices for fast sequencing and the list goes on.  Keep in mind not all peripherals incorporate memory buffers, in fact there are more that do not incorporate memory buffers.  The ones that do not have memory buffers expect the users program to perform that function which does have its limitations for periodic data transfers on a multi-tasking  system.  For our IoT Platform lets shoot for the best performance and incorporate a memory buffer, it is easier to take it pout than redesign it back in. As we analyze each peripheral and weigh data transfer requirements and price/performance will determine how we handle the additional memory buffers which is not a difficult decision to make when all the facts are presented.

[Selection_Menu]            [Top_Menu]

An Introduction To CPLD/FPGA Considerations:
CPLD's, FPGA's and other programmable logic devices and arrays are now mature in the industry and discrete logic is only used as a fill in when you run out of gates in the programmable device and need one more to finish the interface; or require higher voltages or currents for a signal line.  For our IoT Core Platform it becomes obvious that we will be using CPLD's and FPGA's as we develop the platform.  There are a few parameters to keep in mind when designing with these devices that we will present below.

We selected Intel®/Altera® Quartus for the IDE, no real preference just had to pick one and we have more experience with Intel® through our client preferences than Xilinx® or Lattice® although all will work just as well.  You can go to the Intel®Altera® website and download any version from the archive to accommodate various FPGA and CPLD devices or the latest release Quartus Prime® and Operating Systems you are using to follow this design process from XP to Win 10 x64 or Linux.  We have several versions on our development systems running Windows 10 Enterprise due to the fact that each of the free  versions either adds or removes certain devices one different versions.  The free version handles many of the applications, however if you require some complexity the  license release has many more features.  Here at BASIL Networks, we avoid and development that incorporates the cloud for security reasons at this time.  Some of the older releases allow full development without an Internet connection which we have incorporated on several clients manufacturing internal private networks.  For this CPLD development we are using release Quartus Web version 9.1 SP2 that runs on  Windows XP,  Windows 10 and Linux.  The majority of our designs are single FPGA or just a couple of CPLDs per PCB and it is easier to use the free release since it fits our needs.

There are many different flavors of CPLDs and FPGAs and each manufacturer has their own way of maintaining non-compatibility with competitors.  For those engineers and beginners that want to change the selected types that is fine.  The other issue is supply chain as we mentioned in prior sections of this blog that the Mergers & Acquisitions over the past few years is creating havoc for designers and manufacturers that are not receiving information on what items will be discontinued and when.

We already researched several devices for the A/D input peripheral and ended up with a selection for the IoT Core Platform for CPLD's.  They are the MAX-V (1.8V) and MAX-II (3.3V) devices,  We selected the 3.3 Volt devices for this design and selected the 100, 144 and 240 pin QFP (Quad Flat Pack) packaging as resources as needed. So far it appears that a few CPLDs will meet the requirements of the peripherals for the IoT Core Platform peripherals.

CPLD and FPGA are characterized by the Logic Elements (LE)  or Logic Units (LU) and Logic Array Blocks (LAB) for CPLD's and of course for a Field Programmable Gate Array it is characterized by the number of, wait for it, Gates.  The key differences between CPLDs and FPGAs  as follows:

Programming these logic devices and gate arrays have come a log way over the years, they can be programmed in circuit easily.  It took a few years to design a suitable language to program these devices and what emerged was Verilog Hardware Description Language (VHDL) or HDL.  Companies that sold these CPLDs and FPGAs offered several compilers to easily program them, some free some paid license.  Not long after when companies like Altera, Xilinx and others realized that they sold more chips when the software was distributed free and that is where we are at today.  OK, lets get down to some important design parameters when using these devices.  If this is your first encounter with these devices and HDL or RTL (Register Transfer Level)  programming, the Internet has many short introduction and advanced programming courses for CPLDs and FPGAs.  We are not going to cover that here since every IDE has their unique way of handling the programming.  However, Veriliog and  HDL are behavioral hardware descriptive languages all have their limitations. Verilog is case sensitive who's syntax is similar to the C programming language and is a better choice for ASIC (Application Specifif Integrated Circuit) designs, VHDL is case insensitive and opposite to that of Verilog, VHDL contains more constructs and is a better high level modeling environment for FPGAs.  There are many companies that will create a fixed IC (ASIC) from an FPGAs VHDL design.  ASICs have their advantages over FPGAs, a CPLD is a mini ASIC that is programmable and does not require an external memory device to load it at power-on.

Pin Count:
The Pin count for these devices vary from 20 to several hundred on FlatPacks and BGAs (Ball Grid Arrays) along with various pin spacing (pitch).   The number of pins are easier to calculate when a functional block diagram is developed of the peripheral or device it is being used with.  Generally the CAD software used to design the CPLD/FPGA will supply information during compilation if the design will fit in the device selected.  Pin count primarily is a deciding point during the design process.  As the pin count increases the cost of the device increase and they not necessarily linear or proportional.

Programmable I/O Pins also vary depending on the number of LE and LABs or Gates the device has.  The MAX-II series handbook  Section 1-3 (page19) gives the characteristics for the MAX-II series we are looking at and the I/O Pin count. We are looking at 76 pins for the 100 Pin device and 116 I/O Pins for the 144 Pin device.  The max propagation delay for the 100 pin device is typically 5.4na and will clock at 304 MHz.  OK, what about FPGA's ?  Well for security at this time we will look at CPLD's for a few reasons, first- the MAX-series CPLDs have an 8 Kbit FLASH that can be used for security access and ID, second the complexity of the design parameters are not that complex and can be kept in a small package of a couple of chips.

Device  Package & Pitch:
The spacing between pins on a FlatPack pads or the ball size spacing for a BGA are very important during the board layout and determine the manufacturing PCB fabrication process which reflects the yield and price/performance of the PCB.  We selected the Quad Flat Pack for the core platform because the trace/space ratio for the PCB gives a high yield factor than that of Fine Pitch BGA devices.  Flat Packs are easier to assemble and are easier to inspect to name just a few of the advantages.

Device packages can become an issue when the design and layout software does not have a validated footprint for the part selected which requires the designer either designs a footprint or purchases a footprint from a company that creates them.  Creating a footprint depending on the CAD package can be an issue and is easy to have placement errors pop up during fabrication and assembly.   For our Core Platform CAD software we are using OrCAD and have been since the early 90's, however Mentor graphics and others are fine for this development and if they are what you use just reenter the schematic.  For our lab here we have a large validated ORCAD library of footprints that we have used in several designs, many of which we created ourselves and paid the price of validation during PCB fabrication and assembly. One of the prices we are still paying for is upgrades to the CAD packages for our many footprints that are not compatible to the latest releases.  Developing a design reuse library grows fast over the years and can easily become time consuming and costly to convert over.  Unfortunately there is no easy way to fix this dilemma since all of these packages have to deal with these issues.  The closet one that we have experience with so far was Altera, even though it was acquired by Intel designs that have been developed on 10 year old MaxII software are easily upgraded to just about any of the product line.  This is not a plug to use the product, it is just some experience gained.  When you look at the competition like Xilinx and others they all use HDL and RTL for the design environment therefore it is only reasonable that the core designs will be easily transferred.  Printed Circuit Board layout software is unique to the designers of the package and do not have to be compatible in any way, libraries and footprints creation is unique to the software which makes it YBIYSWI  (You Buy It, Your Stuck With It)  type software.

Device Propagation Delays:
Welcome to the world of speed (Signal Speed Only).   We will address this during the actual CPLD design process. The CPLD design application software will allow a timing analysis of each section.   Signal path from LE - LAB to other LE and LABs effect the propagation delays as the signal passes through the elements.  OK, now down to the peripheral design itself.

[Selection_Menu]            [Top_Menu]

Analog Input A/D:
There are many questions initially when designing an A/D input peripheral, especially for a IoT Platform for many different applications.   There are many ways to accomplish this however, over the years we have come up with a group of features for A/D input designs that do address many data transfer features.  Creating a set of analog input specifications does require a bit of experience designing these, however for the beginner the Internet is full of a Analog Input peripheral cards that will give you a good reference of what would be flexible.  One of the most useful features of an analog input is incorporating a programmable gain amplifier.  This allows the flexibility to adjust the input range to accommodate many different analog sensors.   Another feature would be a programmable sample rate for stable periodic sampling.  We selected to incorporate a large memory buffer as well.  Table 13.1 below is the set of specifications that BASIL Networks standardized over the years below.

  • A/D 16 Bit Differential / Single ended input
  • Programmable Gain  x 1,  to 1024 programmable in 11 steps
  • ±10.240 Volts to ±9.7656 Millivolts full scale.
  • 2 Meg x16 SRAM data input buffer each channel for 1MSPS A/D
  • 1 Meg x16 (10ns) for 10 to 100 MHz A/D  8 or 16 bit
  • Expandable to 16 Meg x16 (Cost/Performance)
  • Programmable Number of  samples,Memory Buffer Control
  • 1 Meg to 100M SPS (Samples / Second)  Pending on A/D
  • Internal / External Clock and Synchronization Control
  • 32 bit Programmable Clock Controlled Sample Rate Timer/Counter
  • Digital Input/Output Trigger Control Start/Stop Sampling Data
  • 1 MA, ±10 Vdc Calibrated Constant Voltage & Current Sources for Bridge Measurements
  • Programmable DC Offset Control ±10 Volts DC Voltage

Table 13.1 IoT Platform A/D Input Specification list

To keep the blog for each part to a reasonable length, we already performed the research for the component selection for the analog input peripheral and created the block diagram from the set of specifications.  There are many A/D converters and programmable gain amplifiers (PGA) to choose from with new components being presented monthly.  A good exercise for both beginner and experienced designer to research the various types and features to develop a discipline as well as a table for supply chain availability and component selection for future design requirements.  The table can be incorporated in a component selection project using the IPD system for other designers in your company to use.   One of the issues we discussed earlier on Mergers and  Acquisitions pertaining to discontinued components encourages designers to research components and manufacturers at a business level as well to see the stability of the company.

For the A/D input peripheral we selected a CPLD device, which may easily be transferred to a FPGA to combine other peripherals if this becomes a contract issue once we go through the PoD (Proof of Design) stage.  This also allows us to establish a BUS protocol to interface for all peripherals.

From experience we selected a byte wide databus and a separate register address bus to access the internal control registers of the COLD.  This allows a wide range of control processors with a reasonable number of wires to control, also to jump ahead a bit the reason for the 8 bit bus is we ran out of pins on the COLD.  Table 13.2 is the component list for the A/D Input peripheral for the IT Platform.  The reasoning behind this choice will become evident as we move forward with the design process.

A/D  - 1 MHz A/D Converter

  • Main reasons is the PI BUS interface to reduce the number of PCB traces
  • Single Trigger input to start the Conversion, no special register setup required
  • A/D technology is a traditional SR (Successive Approximation Register) AC.
  • 1us conversion time (1 Meg Samples/ Second

PGA281 - Programmable Gain Amplifier

  • Large Gain Span (1/8 to 128 V/V)
  • Very Low Noise
  • CMRR 140db
  • High Input Impedance
  • Low Offset Voltage 5uv
  • Good Slew Rate
  • Good GainBandwidth Product
  • Good EMI Rejection
  • Allows many sensors including thermocouples and RTD temperature elements

IS66WVE2M16EBLL - 2Megx16 PSRAM Memory

  • Pseudo Static Ram Technology
  • Simple Async SRAM BUS interface Parallel
  • 70ns Write Time
  • 25ns Read Time
  • Small 48-ball TFBGA
  • Largest available at time
  • Possible 4Megx16 Future Release FFF (Form,Fit,Function) Drop-in

CPLD Altera - MAX II 100TQFP

  • Altera MaxII 100TQFP CPLD 5ns chip
  • 512 x16 internal FLASH for Device ID and Security
  • Small package, easily programmable in-circuit
  • Free IDE software Quartus II
  • Cost Effective
  • Assign custom part number to the device

Table 13.2 IoT Platform A/D Input Component list

Figure 13.3 shows a functional block diagram of the A/D input peripheral for the IoT Platform.  I know we just jumped right into the functional block diagram of the A/D peripheral without discussion of each part of the peripheral.  OK, There are only a few  function blocks to the A/D Peripheral and using a CPLD makes this easier to design the A/D Input peripheral they are:

[Selection_Menu]            [Top_Menu]

The A/D Converter IC
SO, the question should have surfaced as why did we choose a serial A/D and why just a 1 Megasample converter?  To answer the first Why a serial output put A/D, well it only needs three wires to run.  Trigger, Serial Data out and Clock.  The second, why only 1 MSPS, well, the device exists and has very good conversion specifications.  1 MSPS A/D is a good sample rate to handle many audio analysis directly and with RF up/Down converters can handle many of the 1 MHz bands of RF applications.  Another reason we selected a 1us A/D is the memory buffer selected is price/performance and mechanical packaging.

The SPI to Parallel Interface
 This is simply required to translate the A/D data to transfer it to the CPU and Memory.

The Memory Control Interface
There are several advantages of designing in embedded A/D memory buffers.  First, data collection is CPU independent and guaranteed to be periodically stable.  Second, Data collection is a retained for retrieving at a later time. Third, data can be collected at higher speeds that the peripheral system throughput is capable of.

Adding a Memory buffer to an A/D peripheral allows collecting data at a controlled stable periodic rate.  It also adds a capture feature that may be triggered at the maximum rate of the A/D.  We selected 2 Meg x16 (32Mbit) RAM. This is a Pseudo Static RAM (PSRAM) it is a dynamic RAM with and internal hidden refresh and has a 70ns asynchronous write cycle allowing a stable fixed interface for 1 megasample data collection.  Also there is a possibility that this chip will be available in a 4Mx16 IC.  Also the expansion of adding several of these chips for special applications will accommodate the 23 bit memory address interface giving up to 16 Meg x16 data buffering.

The Counter/Timer Control
 This is a 32 bit counter timer that is used to control the data collection in 20ns intervals to beyond 85 second intervals based on a stable over controlled base clock of 200MHz.  The counter is programmable by the user.

The User Interface Control
 The User interface allows the user to interface with a variety of applications from synchronizing with a remote start of data collection to using a external clock.

The BUS Interface Control
The BUS interface selected is an 8 bit  4 address line CPU type interface. This is mainly because of the pin count of the 100 pin CPLD that we are using.  We could go with a larger CPLD however the cost from 100 to 144 pin to accommodate the speed exceeds the price/performance ration that would be comfortable.  This is derived from the functional block diagram of Figure 13.3 as we will see shortly.

From all the discussion and specifications we are now able to construct a functional block diagram as shown in Figure 13.3 below.  The CPLD has to be designed to accommodate all the control and communication setup for the A/D peripheral.  From the block diagram we should be able to develop the timing diagrams for the critical portions of the A/D peripheral as well.  Experience is the best teacher and as you practice creating these block diagrams and timing diagrams they will become easier as you let your mind become accustom to developing this type of logic. "Repetition is the mother of retention" - Samuel Rodenhizer.  

Figure 13.3  Analog Input Peripheral Block Diagram

The next stage of the peripheral design is to establish a timing diagram to be sure that we cover all the timing requirements of the components connected together.  It is a good engineering practice to develop a timing diagram of how you want the circuit to function and compare it to the CPLD timing analysis once we put it in the CPLD.  There are unique timing Propagation delays when using CPLD's that we will see when we start designing the functions in the CPLD.

OK,  the next important step after we get the block diagram complete is to calculate the number of pins the design will require.  Remember in the past parts we discussed pin assignments with embedded processors and all the peripherals on one chip.  This will determine our interface BUS architecture approach for a price/performance for the optimal design.  From Figure 13.3 Analog Input Block Diagram we derive the following functional pin requirements for the real world outside the CPLD.

So, before we address the CPU interface BUS structure (a bit of a pun) we already have used up 58 I/O Pins.  CPLDs programmable pin count for a 100 pin CPLD is limited to 76 I/O Pins.  That leaves only 19 pins free for the BUS interface.  So I guess the 32 bit parallel BUS architecture is out for the 100 pin device package.  The next CPLD size up is 144 pins that has about 116 I/O Pins, allowing 58 pins for the 32 bit interface, a bit overkill for a 32 bit bus.  However if we use an 8 bit bus we would require a total of 8 Data, 4 address, 4 control = 16 total which leaves us 3 spare pins.  This is also the best price/performance and mechanical size choice for the peripheral.  The A/D input peripheral consists of  4 IC's and a few support components without the constant voltage and current sources.  We will get to the constant voltage and current source later in the process.

The next issue is the number of Logical Units or Logic Elements required for the CPLD and will the design fit in the selection.  This is realized when we start the design and run timing analysis to see if it meets the speed requirements.   A discussion on an effective way to present HDL (Hardware Definition Language) and RTL(Register Transfer Level)  and Block Schematic Level used in programming Logic devices is always a challenge of education.  The all around standard is HDL older acronym is Verilog HDL (VHDL) and RTL both are C like structured high level languages to represent logic elements where as the Block Schematic Level language is a much higher level representation of a function.  It is similar top a function in C and the programming of the actual function line by line.  For the beginner it is best to use the Block Schematic Level and all of the Block Schematic have an HDL code assigned to them that has already debugged and functional as long as you follow the rules of the Blocks Function, just like programming in C or PHP languages.  So for the remain of this part of the series we will present the CPLD design then go through and show reasoning on why for simpler designs a block schematic is easier and for complex designs as we will see as the series moves forward other approaches will be discussed.

CPLDs have the resources to handle many interface requirements including Schmitt Trigger, PullUp, PullDown Resisters, Open Drain and Tri-State programmable pins.  If you give a set of specifications to a dozen designer and just say to use some type of programmable logic you would have a dozen different designs all doing the same thing, some using CPLDs, some using FPGAs.  The way the author approached this design is designing each of the modules separately then interfacing them for the final design.  This is much easier when working with CPLDs and FPGAs as we will see.

The CPLD will require a 50MHz SPI to parallel translator to handle the clock from the A/D and the serial data stream along with the associated registers to buffer the data and setup registers.  Since all the timing requirements are given on the A/D and SRAM datasheets we can construct a timing diagram for starting the A/D and putting the data into memory.  We will compare the datasheets to the final timing for the peripheral.  


OK - Where do we start the design, what section of the logic is timing most critical - simple the A/D 50MHz SPI interface translator on steroids.  From the ADAQ7980 datasheet the full conversion timing is shown below in Figure 13.4A for a single conversion.  From our experience to capture data serially we generally use a clock that is at least four times the frequency of the data we want to capture, so for this it would be 200 MHz for capturing a 50MHz serial datastream.  If you remember back the slower serial protocols like RS232 used a clock 16 times the serial data stream, well 800 MHz would be a bit too high of a frequency for standard COTS CPLDs.   Using a stable TCXO (Temperature Compensated Crystal Oscillator) will work just fine as a reference frequency as we will see when we move forward with the design.

Figure 13.4A  A/D Single Conversion Timing Diagram

OK, now that we have the functional timing diagram lets just dive in and use the CPLD development program to design the 50MHz SPI interface translator.  Figure 13.4B shows this in a Block Schematic Level diagram that is part of the Quartus IDE.  

Figure 13.4B  50MHz SPI Interface for the A/D Converter

The timing analysis for the 50Mhz SPI to 16 bit translator interface is shown in Figure 13.4B.  The CPLD  used to perofrm the design was the 100Pin MAX-II C5 device.  We ran the timing at 80 MHz and it ran fine. That gives us a good design margin for this peripheral.  It took a total of 46 LE (Logic Elements) for this section of the design.   Since we control when the SDO data stream will start for the timing simulator we too the liberty to only make the conversion time shorter for clarity only. in reality the full conversion time would be 1 micosecond.   Our main interest in timing is the serial translator to 16 bits.  I ran the A/D Translator at higher speeds to see if we were at the CPLD speed limits and it ran at 80MHz to give a design tolerance for prop delays is shown in Figure 13 4A, 13.4B and 13.4C show the SPI interface translator of the peripheral.  

Figure 13.4C  50MHz SPI Interface Timing Analysis Diagram

Figure 13.4D below shows the function block of Figure 13.4B for the A/D Translator.  OK by this time we see the convenience of building the CPLD in sections and testing each section as we design it, then saving that section as a Block Schematic Level Function.  The educational part of this processes is the fact that you can create a complex design and reduce it to a single block of Input and Output signal names, then use it as a single component to be added to other complex blocks.   This is what makes the CPLD and FPGA such a useful tool for designing logic devices.  The other main feature that makes this technology useful is the actual pin assignments are flexible.  Putting this device down on a PCB and connecting pins to a CPU BUS architecture makes this useful since you can add components to the CPLD or FPGA to within the full resources of the device without having to re-layout the PCB.  Also during the PCB layout we can assign pins to keep the PCB traces in a group to minimize runs.

Figure 13.4D  50MHz SPI Translator CPLD Symbol Block

So as we see for those starting out with any of the CPLD, FPGA IDE platforms, the Block Schematic Level is capable of handling many of the design tasks.  You always have the option and capability of adding HDL blocks for the IDE as well.  When designing with CPLDs a block schematic is all that is needed for this design since it is primarily register control for the data transfer.  Although we selected a CPLD for the PoD (Proof of Design), keep in mind that HDL is a standard language and may be transferred to other IDE platforms to FPGAs if so desired on the final release if you add other functions to the A/D peripheral.

Since we are incorporating a memory buffer on the A/D channel there are a few features that would add flexibility and data collection stability to the analog input.  These are a periodic trigger to automatically trigger the A/D on a programmable interval, a programmable number of conversions comparator to take a smaller burst (less than 2 meg) of data points, an external clock synchronization input.  The control lines are shown in the block diagram above in Figure 13.3.

[Selection_Menu]            [Top_Menu]

From this point we should look at the timing from the A/D SPI translator to the buffer memory.  Creating a timing diagram of this processes will aid in the developing of the peripheral since we already have the A/D single conversion timing diagram.  This design does not fall into the complex category so a simple timing diagram is all that should be necessary to start the design process.  The diagrams developed for this peripheral are shown in Figures 13.4B and 13.4E show the timing diagrams for the A/D SPI translator data transfer for a single conversion and A/D conversion data transfer to memory which are the critical areas for the data collection.  The remaining parts of the design are simply holding registers for the counter/timer and control registers for the users interface as follows

Figure 13.4E A/D Conversion To Memory Timing Diagram

Now that the main timing diagrams for the data transfer from the A/D converter to the buffer memory have been created we can now start to design the CPLD control.   As stated I am using Intel®/Altera Quartus® 9.1 Sp2 since it has devices that we will be looking to use for our IoT Platform continues being developed which are not in the new 18.x lite release.  90% of designs that incorporate a single FPGA or CPLD may be easily designed with the Lite or free Web version.  If you want to include some of the IP modules then a license is preferred and required.

I have several of the free Quartus releases on my system since each release adds and removes some of  components.  The new systems relies on the cloud to do the timing analysis and for propriety designs that is not advised it would be advantageous to keep propriety information in house.  Release 9.1 Sp2 handles all the MAX II designs that we have been using for the past several years and do not have to be connected to the Internet to run, this gives us control of the designs.  The archived releases like 9.1 Sp2 are also available for download from the Intel website along with both paid and free releases, a link is available at the end of this part after the summary.  We did load Quartus Lite on Windows 10 Enterprise 64 bit, transferred this design and it ran fine.  This just validates the stability of the M&A of Intel/Altera and to date keeping compatibility across the board.

OK, Figures 13.5A and 13.5B show the compete A/D Channel Peripheral CPLD Block Schematic and timing diagram respectively.   This design is part of several re-use designs from BASIL Networks Design Library which are being incorporating for this series.  There is more to be done before this design is a plugNplay device for our platform.  The next steps are setting up a register assignment matrix outlining the functionality for each register as well as addressing requirements for programming, analyse the timing, address the program flow of operation and more to be presented.  The Byte (8 bit) CPU BUS interface protocol make this compatible with any embedded CPU.

Figure 13.5A  A/D CPLD Block Schematic Design

OK, the design pace is a bit fast at this point, however do not worry about it, we will slow down in the next part to cover the design methodology etc. for this A/D peripheral.  This high level presentation is to give the reader a design to review and question to learn the VHDL IDE  platform development process.  There are many readers more familiar with other CPLD and FPGA VHDL development IDEs so we will keep this at a level that to allow the capability to transfer to other VHDL  IDEs.

Figure 13.5B  A/D CPLD Conversion To Memory Timing Diagram

[Selection_Menu]            [Top_Menu]

As we see there are many different aspects to developing a product.  The A/D Peripheral is just one small part of our platform, which emphasizes the necessity of an organized product development protocol.  The question arises and probably will throughout this development process for those that ask the question "why an IPD system?"  The answer for this part is, the A/D Channel peripheral is just one part and this may be setup as a project or sub-project as well as a reuse project just as the CPLD has been for BASIL Networks Design Library.  It is much easier to setup a CPLD for reuse since it is just a single package IC as BASIL Networks has done to be called up a few years later when the need arises.  This is the main purpose of the IPD system allowing the organizational processes required for successful product development.   All functions neatly organized in the appropriate folder with a easy Click'N'Open to continue the development process.  Much of the IPD system is being rewritten since it has been developed over the years with small additions of code and this gives me the opportunity to update the software and allow for the development of other products as the series continues.

We are now in the world of peripherals and sensors to monitor and respond to the physical world.  Just as we have our human five physical sensors, touch, visual, audio, smell and taste, they all have their sensor operating ranges.  The human brain, the unique bio-chemical (not silicon) central processor receives information, organizes and interprets this information to give a perspective on reality for each individual.  The unique perspective of system integration.   The IoT (silicon) on the other hand is uniquely programmed by humans to perform specific functions that with the right type of sensors be capable of interfacing to what ever the real environment requirements may be.

I am always thankful for my readers, their public and private comments for the encouragement it gives me to continue this series and the great input for additions to the IPD system.

Part 13 Preliminary Outline" A/D Channel Hardware Design: -Continued

More to come in the series

Reference Links for Part 13:

Intel®/Altera® Quartus Download 9.1 sp2 from Archives

Intel®/Altera® Quartus Lite 18.x Download

Requirements Traceability Matrix & (RTM)
Project Management
Mezzanine Board

The majority of Internet scheme and protocol information are from a few open public information sources on the net, IETF (Internet Engineering Task Force) RFC's that explain details on the application of the protocols used for both IPv4 and IPv6 as well as experimental protocols for the next generation Internet & and the Network Sorcery web site.  The remaining of this series on the IoT platform will be from BASIL Networks MDM (Modular Design Methodology) applied with the Socratic teaching method.   Thank You - expand your horizon- Sal Tuzzo

Network Sorcery:
The Internet Engineering task Force: IETF - RFC references

Memory Segmentation
The Memory Management Unit (MMU)
Virtual Address Space
Virtual Addresses and Page Tables
Extended Memory

Part 12 IoT Core Platform - IoT Core Platform - Product Design -Creating Conceptual Design Documentation (July 29, 2018)

Part 14 IoT Core Platform
- Peripheral I/O Development - Analog Input Peripheral Device Design (Oct 29, 2018)


Publishing this series on a website or reprinting is authorized by displaying the following, including the hyperlink to BASIL Networks, PLLC either at the beginning or end of each part.
BASIL Networks, PLLC - Internet of Things (IoT) -Security, Privacy, Safety-The Information Playground Part-13 Peripheral Interface Devices -Peripheral Design From the Beginning (Oct 7, 2018)

For Website Link: cut and paste this code:

<p><a href="" target="_blank"> BASIL Networks, PLLC - Internet of Things (IoT) -Security, Privacy, Safety-The Information Playground Part-13 A/D Peripheral Design:<i> (Oct 7, 2018)</i></a></p>



Sal (JT) Tuzzo - Founder CEO/CTO BASIL Networks, PLLC.
Sal may be contacted directly through this sites Contact Form or
through LinkedIn

Copyright© 1990-2019 BASIL Networks, PLLC. All rights reserved