Tuesday’s Newsletter: IoT Tech Focus

Coming to your inbox tomorrow: Circuit Cellar’s IoT Technology Focus newsletter. Tomorrow’s newsletter covers what’s happening with Internet-of-Things (IoT) technology–-from devices to gateway networks to cloud architectures. This newsletter tackles news and trends about the products and technologies needed to build IoT implementations and devices.

Bonus: We’ve added Drawings for Free Stuff to our weekly newsletters. Make sure you’ve subscribed to the newsletter so you can participate.

Already a Circuit Cellar Newsletter subscriber? Great!
You’ll get your IoT Technology Focus newsletter issue tomorrow.

Not a Circuit Cellar Newsletter subscriber?
Don’t be left out! Sign up now:

Our weekly Circuit Cellar Newsletter will switch its theme each week, so look for these in upcoming weeks:

Embedded Boards.(1/23 Wednesday) The focus here is on both standard and non-standard embedded computer boards that ease prototyping efforts and let you smoothly scale up to production volumes.

January has a 5th Tuesday, so we’re bringing you a bonus newsletter:
Displays and Graphics. (1/30) Display technology is where the user interacts with today’s modern embedded electronic devices This newsletter content examines the latest technology and product developments in displays along with the graphics ICs that drive those displays.

Analog & Power. (2/6) This newsletter content zeros in on the latest developments in analog and power technologies including DC-DC converters, AD-DC converters, power supplies, op amps, batteries and more.

Microcontroller Watch (2/13) This newsletter keeps you up-to-date on latest microcontroller news. In this section, we examine the microcontrollers along with their associated tools and support products.

Tuesday’s Newsletter: Microcontroller Watch

Coming to your inbox tomorrow: Circuit Cellar’s Microcontroller Watch newsletter. Tomorrow’s newsletter keeps you up-to-date on latest microcontroller news. In this section, we examine the microcontrollers along with their associated tools and support products.

Bonus: We’ve added Drawings for Free Stuff to our weekly newsletters. Make sure you’ve subscribed to the newsletter so you can participate.

Already a Circuit Cellar Newsletter subscriber? Great!
You’ll get your Microcontroller Watch newsletter issue tomorrow.

Not a Circuit Cellar Newsletter subscriber?
Don’t be left out! Sign up now:

Our weekly Circuit Cellar Newsletter will switch its theme each week, so look for these in upcoming weeks:

IoT Technology Focus. (1/16) Covers what’s happening with Internet-of-Things (IoT) technology–-from devices to gateway networks to cloud architectures. This newsletter tackles news and trends about the products and technologies needed to build IoT implementations and devices.

Embedded Boards.(1/23) The focus here is on both standard and non-standard embedded computer boards that ease prototyping efforts and let you smoothly scale up to production volumes.

January has a 5th Tuesday, so we’re bringing you a bonus newsletter:

Displays and Graphics. (1/30) Display technology is where the user interacts with today’s modern embedded electronic devices This newsletter content examines the latest technology and product developments in displays along with the graphics ICs that drive those displays.

Small Form Factor Board Sports Celeron J3455 Processor

American Portwell Technology has announces the launch of WUX-3455, a small form factor (SFF) embedded system board featuring the Intel Celeron processor J3455, formerly code-named Apollo Lake. The Intel Celeron processor J3455 integrates the low power Intel® Gen9 graphics engine up to 18 execution units, enabling enhanced 3D graphics performance and greater speed for 4K encode and decode operations. The WUX-3455 is well suited as a solution supporting visual communications and real-time computing applications in medical, digital surveillance, industrial automation, office automation, retail and more.

Portwell’s WUX-3455 embedded system board, designed with a compact footprint (101.6 mm x 101.6 mm; 4˝ x 4˝), also features DDR3L SO-DIMM up to 8 GB supporting 1866/1600 MT/s; 6x USB ports; one DisplayPort (DP) and one HDMI with resolution up to 4096 x 2160; one COM port for RS-232 on rear I/O (RJ45 connector); and multiple storage interfaces with 1x SATA III port, 1x microSD 3.0 socket and support for onboard eMMC 5.0 up to 64G. Moreover, it integrates the M.2 interface, which provides wireless connectivity including Wi-Fi and Bluetooth, allowing ideal communication and connectivity for IoT edge devices and designs.

The WUX-3455  operates with thermal design power (TDP) under 6W/10W for fanless applications. It also supports a wide voltage of power input from 12 V to 19 V for rugged applications. With its ingenious design and superior performance—up to quad-core processing power via Intel® Celeron processor J3455 and high capability—the Portwell WUX-3455 embedded system board is equipped with the ability to execute an extensive array of applications from digital signage in public spaces through manufacturing robots and machinery transforming industrial automation, to video analytics-based appliances enhancing intelligent digital security and surveillance, to end-to-end solutions for IoT use cases.

American Portwell Technology | www.portwell.com

3.5″ Board Designed Rugged Environments

AAEON has launched the GENE-SKU6 W1, a 3.5-inch subcompact board with the specifications needed to handle harsh, unstable conditions. When hardware is used for outdoor, factory automation, or in-vehicle applications, you can’t always be sure that its DC input will remain stable. Because businesses can’t afford for their systems to shut down, they need computers that can withstand power fluctuations and keep on running. With that in mind, the GENE-SKU6 W1 has a DC input range of 9 to  36 VDC, so it takes power drops and spikes in its stride and continues operating.

pgal_160922_8bg2utThis rugged subcompact board also has a WiTAS 1 wide-temperature rating, meaning it’s guaranteed to run smoothly in environments as cold as -20°C and as hot as 70°C. This capability is achieved through intelligent design, low-power components and an effective heatsink. Those design features enable the GENE-SKU6 W1 to function as a reliable, fanless solution.

The board’s features include support for 4K resolution and independent DP, DVI, and LVDS display outputs. It has Mini-card and mSATA slots, four USB 3.0 and two USB 2.0 ports, four COM ports and an additional BIO interface enabling board-to-board connection.

AAEON | www.aaeon.com

January Circuit Cellar: Sneak Preview

The January issue of Circuit Cellar magazine is coming soon. And it’s got a robust selection of embedded electronics articles for you. Here’s a sneak peak.

Not a Circuit Cellar subscriber?  Don’t be left out! Sign up today:

 

Here’s a sneak preview of January 2018 Circuit Cellar:

 

                                     IMPROVING EMBEDDED SYSTEM DESIGNS

Special Feature: Powering Commercial Drones
The amount of power a commercial drone can draw on has a direct effect on how long it can stay flying as well as on what tasks it can perform. Circuit Cellar Chief Editor Jeff Child examines solar cells, fuel cells and other technology options for powering commercial drones.

CC 330 CoverFPGA Design: A Fresh Take
Although FPGAs are well established technology, many embedded systems developers—particularly those used the microcontroller realm—have never used them before. In this article, Faiz Rahman takes a fresh look a FPGAs for those new to designing them into their embedded systems.

Product Focus: COM Express boards
COM Express boards provide a complete computing core that can be upgraded when needed, leaving the application-specific I/O on the baseboard. This brand new Product Focus section updates readers on this technology and provides a product album of representative COM Express products.

TESTING, TESTING, 1, 2, 3

LF Resonator Filter
In Ed Nisley’s November column he described how an Arduino-based tester automatically measures a resonator’s frequency response to produce data defining its electrical parameters. This time he examines the resultsand explains a tester modification to measure the resonator’s response with a variable series capacitance.

Technology Spotlight: 5G Technology and Testing
The technologies that are enabling 5G communications are creating new challenges for embedded system developers. Circuit Cellar Chief Editor Jeff Child explores the latest digital and analog ICs aimed at 5G and at the test equipment designed to work with 5G technology.

                                     MICROCONTROLLERS IN EVERYTHING

MCU-based Platform Stabilizer
Using an Inertial Measurement Unit (IMU), two 180-degree rotation servos and a Microchip PCI MCU, three Cornell students implemented a microcontroller-based platform stabilizer. Learn how they used a pre-programmed sensor fusion algorithm and I2C to get the most out of their design.

Designing a Home Cleaning Robot (Part 2)
Continuing on with this four-part article series about building a home cleaning robot, Nishant Mittal this time discusses the mechanical aspect of the design. The robot is based on Cypress Semiconductor’s PSoC microcontroller.

Massage Vest Uses PIC32 MCU
Microcontrollers are being used for all kinds of things these days. Learn how three Cornell graduates designed a low-cost massage vest that pairs seamlessly with a custom iOS app. Using the Microchip PIC32 for its brains, the massage vest has sixteen vibration motors that the user can control to create the best massage possible.

AND MORE FROM OUR EXPERT COLUMNISTS:

Five Fault Injection Attacks
Colin O’Flynn returns to the topic of fault injection security attacks. To kick off 2018, he summarizes information about five different fault injection attack stories from 2017—attacks you should be thinking about as an embedded designer.

Money Sorting Machines (Part 2)
In part 1, Jeff Bachiochi delved into the interesting world of money sort machines and their evolution. In part 2, he discusses more details about his coin sorting project. He then looks at a typical bill validator implementation used in vending systems.

Overstress Protection
Last month George Novacek reviewed the causes and results of electrical overstress (EOS). Picking up where that left off, in this article he looks at how to prevent EOS/ESD induced damage—starting with choosing properly rated components.

Designing High Performance GUIs

329 Brumby Lead Image for Web

UIs for the Multicore Era

For embedded developers, it’s critical to understand the types of performance problems a typical end-user might encounter and the performance metrics relevant to user
interface (UI) design. Phil examines these and other important UI design challenges.

By Phil Brumby
Mentor, Embedded Systems Division

The widespread proliferation of portable media devices has changed the way we interact with each other on a daily basis. In fact, there is now a generation of users who grew up with some type of touchscreen device. These users no longer see the UI as new or revolutionary, but rather as a standard piece of mobile device functionality. This phenomenon has created a new set of expectations. It means any device with an LCD must offer a fluid and intuitive user experience. It’s also expected that the touchscreen has to be “smartphone-like” whenever the device is powered on. Embedded system developers are now under pressure across multiple markets and device types to replicate the smartphone UI interactive experience.

The importance of getting the UI right is absolutely critical to the success of the device. Underpinning documented UI design methodologies is a need for the device to operate in a way that it will not impinge or be detrimental to the user experience. For developers, it’s necessary to understand the types of performance problems a typical end-user might encounter, and through an understanding of performance metrics employ various analyses to highlight the bottlenecks and performance degradation issues.

A key advantage to system start-up is analyzing selected input events.

A key advantage to system start-up is
analyzing selected input events.

TYPICAL PERFORMANCE ISSUES

To understand how to best analyze performance, it’s important to look at typical performance issues from the end-user’s perspective. In identifying these issues, developers can begin to identify the first data points or metrics needed for feedback on system performance.

Responsiveness: Responsiveness can be thought of as the time it takes for the user to receive feedback from the UI as a result of an input action made. Typically, this consists of a touchscreen input, but also includes hard key presses. Responsiveness is important as the user must feel the device performs within a certain timeframe to avoid the feeling a UI is “laggy” or slow to respond. Delays in updating the UI in response to input can result in frustration and mistakes made by the user.

Animation smoothness: Animation smoothness relates to the visible motion or change in appearance of elements displayed within the UI. As an element transitions from one point in 3D space to another, does it do so in a smooth manner that is pleasing to the eye? Animation smoothness is important because if the user perceives jagged or staggered motion in a transition, it will degrade the overall interactive experience.   …

Read the full article in the December 329 issue of Circuit Cellar

Don’t miss out on upcoming issues of Circuit Cellar. Subscribe today!
Note: We’ve made the October 2017 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

December Circuit Cellar: A Sneak Preview

The December issue of Circuit Cellar magazine is coming soon. Want a sneak peak? We’ve got a great selection of excellent embedded electronics articles for you.

Not a Circuit Cellar subscriber?  Don’t be left out! Sign up today:

 Here’s a sneak preview of December Circuit Cellar:

MICROCONTROLLERS IN MOTION

Special Feature: Electronics for Wearable Devices
Circuit Cellar Chief Editor Jeff Child examines how today’s microcontrollers, sensors and power electronics enable today’s wearable products.

329 Cover Screen CapSimulating a Hammond Tonewheel Organ
(Part 2)

Brian Millier continues this two-part series about simulating the Hammond tonewheel organ using a microcontrollers and DACs. This time he examines a Leslie speaker emulation.

Money Sorting Machines (Part 1)
In this new article series, Jeff Bachiochi looks the science, mechanics and electronics that are key to sorting everything from coins to paper money. This month he discusses a project that uses microcontroller technology to sort coins.

Designing a Home Cleaning Robot (Part 1)
This four-part article series about building a home cleaning robot starts with Nishant Mittal discussing his motivations behind to his design concept, some market analysis and the materials needed.

SPECIAL SECTION: GRAPHICS AND VISION

Designing High Performance GUI
It’s critical to understand the types of performance problems a typical end-user might encounter and the performance metrics relevant to user interface (UI) design. Phil Brumby of Mentor’s Embedded Systems Division examines these and other important UI design challenges.

Building a Robotic Candy Sorter
Learn how a pair of Cornell graduates designed and constructed a robotic candy sort. It includes a three degree of freedom robot arm and a vision system using a Microchip PIC32 and Raspberry Pi module.

Raster Laser Projector Uses FPGA
Two Cornell graduates describe a raster laser projector they designed that’s able to project images in 320 x 240 in monochrome red. The laser’s brightness and mirrors positions are controlled by an FPGA and analog circuitry.

ELECTRICITY UNDER CONTROL

Technology Spotlight: Power-over-Ethernet Solutions
Power-over-Ethernet (PoE) enables the delivery of electric power alongside data on twisted pair Ethernet cabling. Chief Editor Jeff Child explores the latest chips, modules and other gear for building PoE systems.

Component Overstress
When an electronic component starts to work improperly, Two likely culprits are electrical overstress (EOS) and electrostatic discharge (ESD). In his article, George Novacek breaks down the important differences between the two and how to avoid their effects.

AND MORE FROM OUR EXPERT COLUMNISTS:

Writing the Proposal
In this conclusion to his “Building an Embedded Systems Consulting Company” article series, Bob Japenga takes a detailed look at how to craft a Statement of Work (SOW) that will lead to success and provide clarity for all stakeholders.

Information Theory in a Nutshell
Claude Shannon is credited as one of the pioneers of computer science thanks to his work on Information Theory, informing how data flows in electronic systems. In this article, Robert Lacoste provides a useful exploration of Information Theory in an easily digestible way.

Dual-Channel 3G-SDI Video/Audio Capture Card

ADLINK PCIe-2602

ADLINK PCIe-2602 Video/Audio Capture Card

The PCIe-2602 is an SDI video/audio capture card that supports all SD/HD/3G-SDI signals and operates at six times the resolution of regular VGA connections. The card also provides video quality with lossless full color YUV 4:4:4 images for sharp, clean images.

The PCIe-2602 is well suited for medical imaging and intelligent video surveillance and analytics. With up to 12-bit pixel depth, the card  provides extreme image clarity and smoother transitions from color-to-color enhance image detail to support critical medical imaging applications, including picture archiving and communication system (PACS) endoscopy and broadcasting.

The card’s features include low latency uncompressed video streaming, CPU offloading, and support for high-quality live viewing for video analytics of real-time image acquisition, as required in casino and defense environments. PCIe-2602 signals can be transmitted over 100 m when combined with a 75-Ω coaxial cable.

The PCIe-2602 is equipped with RS-485 and digital I/O. It accommodates external devices (e.g., PTZ cameras and sensors) and supports Windows 7/XP OSes. The card comes with ADLINK’s ViewCreator Pro utility to enable setup, configuration, testing, and system debugging without any software programming. All ADLINK drivers are compatible with Microsoft DirectShow.

Contact ADLINK for pricing.

ADLINK Technology, Inc.
www.adlinktech.com

CC269: Break Through Designer’s Block

Are you experiencing designer’s block? Having a hard time starting a new project? You aren’t alone. After more than 11 months of designing and programming (which invariably involved numerous successes and failures), many engineers are simply spent. But don’t worry. Just like every other year, new projects are just around the corner. Sooner or later you’ll regain your energy and find yourself back in action. Plus, we’re here to give you a boost. The December issue (Circuit Cellar 269) is packed with projects that are sure to inspire your next flurry of innovation.

Turn to page 16 to learn how Dan Karmann built the “EBikeMeter” Atmel ATmega328-P-based bicycle computer. He details the hardware and firmware, as well as the assembly process. The monitoring/logging system can acquire and display data such as Speed/Distance, Power, and Recent Log Files.

The Atmel ATmega328-P-based “EBikeMeter” is mounted on the bike’s handlebar.

Another  interesting project is Joe Pfeiffer’s bell ringer system (p. 26). Although the design is intended for generating sound effects in a theater, you can build a similar system for any number of other uses.

You probably don’t have to be coerced into getting excited about a home control project. Most engineers love them. Check out Scott Weber’s garage door control system (p. 34), which features a MikroElektronika RFid Reader. He built it around a Microchip Technology PIC18F2221.

The reader is connected to a breadboard that reads the data and clock signals. It’s built with two chips—the Microchip 28-pin PIC and the eight-pin DS1487 driver shown above it—to connect it to the network for testing. (Source: S. Weber, CC269)

Once considered a hobby part, Arduino is now implemented in countless innovative ways by professional engineers like Ed Nisley. Read Ed’s article before you start your next Arduino-related project (p. 44). He covers the essential, but often overlooked, topic of the Arduino’s built-in power supply.

A heatsink epoxied atop the linear regulator on this Arduino MEGA board helped reduce the operating temperature to a comfortable level. This is certainly not recommended engineering practice, but it’s an acceptable hack. (Source: E. Nisley, CC269)

Need to extract a signal in a noisy environment? Consider a lock-in amplifier. On page 50, Robert Lacoste describes synchronous detection, which is a useful way to extract a signal.

This month, Bob Japenga continues his series, “Concurrency in Embedded Systems” (p. 58). He covers “the mechanisms to create concurrently in your software through processes and threads.”

On page 64, George Novacek presents the second article in his series, “Product Reliability.” He explains the importance of failure rate data and how to use the information.

Jeff Bachiochi wraps up the issue with a article about using heat to power up electronic devices (p. 68). Fire and a Peltier device can save the day when you need to charge a cell phone!

Set aside time to carefully study the prize-winning projects from the Reneas RL78 Green Energy Challenge (p. 30). Among the noteworthy designs are an electrostatic cleaning robot and a solar energy-harvesting system.

Lastly, I want to take the opportunity to thank Steve Ciarcia for bringing the electrical engineering community 25 years of innovative projects, essential content, and industry insight. Since 1988, he’s devoted himself to the pursuit of EE innovation and publishing excellence, and we’re all better off for it. I encourage you to read Steve’s final “Priority Interrupt” editorial on page 80. I’m sure you’ll agree that there’s no better way to begin the next 25 years of innovation than by taking a moment to understand and celebrate our past. Thanks, Steve.

DIY 10.1˝ Touchscreen Home Control System

Domotics (home automation) control systems are among the most innovative and rewarding design projects creative electrical engineers can undertake. Let’s take a look at an innovative Beagle Board-based control system that enables a user to control lights with a 10.1˝ capacitive touchscreen.

Domotics control system

The design features the following modules:

• An I/O board for testing purposes
• An LED strip board for controlling an RGB LED strip
• A relay board for switching 230-VAC devices
• An energy meter for measuring on/off (and also for logging)

ELektor editor and engineer Clemens Valens recently interviewed Koen van Dongen about the design. Van Dongen describes the system’s electronics and then demonstrates how to use the touchscreen to control a light and LED strip.

As Valens explains suggests, it would be a worthwhile endeavor to incorporate a Wi-Fi connection to enable cellphone and tablet control. If you build such system, be sure to share it with our staff. Good luck!

CircuitCellar.com is an KCK Media website.

DIY Solar-Powered, Gas-Detecting Mobile Robot

German engineer Jens Altenburg’s solar-powered hidden observing vehicle system (SOPHECLES) is an innovative gas-detecting mobile robot. When the Texas Instruments MSP430-based mobile robot detects noxious gas, it transmits a notification alert to a PC, Altenburg explains in his article, “SOPHOCLES: A Solar-Powered MSP430 Robot.”  The MCU controls an on-board CMOS camera and can wirelessly transmit images to the “Robot Control Center” user interface.

Take a look at the complete SOPHOCLES design. The CMOS camera is located on top of the robot. Radio modem is hidden behind the camera so only the antenna is visible. A flexible cable connects the camera with the MSP430 microcontroller.

Altenburg writes:

The MSP430 microcontroller controls SOPHOCLES. Why did I need an MSP430? There are lots of other micros, some of which have more power than the MSP430, but the word “power” shows you the right way. SOPHOCLES is the first robot (with the exception of space robots like Sojourner and Lunakhod) that I know of that’s powered by a single lithium battery and a solar cell for long missions.

The SOPHOCLES includes a transceiver, sensors, power supply, motor
drivers, and an MSP430. Some block functions (i.e., the motor driver or radio modems) are represented by software modules.

How is this possible? The magic mantra is, “Save power, save power, save power.” In this case, the most important feature of the MSP430 is its low power consumption. It needs less than 1 mA in Operating mode and even less in Sleep mode because the main function of the robot is sleeping (my main function, too). From time to time the robot wakes up, checks the sensor, takes pictures of its surroundings, and then falls back to sleep. Nice job, not only for robots, I think.

The power for the active time comes from the solar cell. High-efficiency cells provide electric energy for a minimum of approximately two minutes of active time per hour. Good lighting conditions (e.g., direct sunlight or a light beam from a lamp) activate the robot permanently. The robot needs only about 25 mA for actions such as driving its wheel, communicating via radio, or takes pictures with its built in camera. Isn’t that impossible? No! …

The robot has two power sources. One source is a 3-V lithium battery with a 600-mAh capacity. The battery supplies the CPU in Sleep mode, during which all other loads are turned off. The other source of power comes from a solar cell. The solar cell charges a special 2.2-F capacitor. A step-up converter changes the unregulated input voltage into 5-V main power. The LTC3401 changes the voltage with an efficiency of about 96% …

Because of the changing light conditions, a step-up voltage converter is needed for generating stabilized VCC voltage. The LTC3401 is a high-efficiency converter that starts up from an input voltage as low as 1 V.

If the input voltage increases to about 3.5 V (at the capacitor), the robot will wake up, changing into Standby mode. Now the robot can work.

The approximate lifetime with a full-charged capacitor depends on its tasks. With maximum activity, the charging is used after one or two minutes and then the robot goes into Sleep mode. Under poor conditions (e.g., low light for a long time), the robot has an Emergency mode, during which the robot charges the capacitor from its lithium cell. Therefore, the robot has a chance to leave the bad area or contact the PC…

The control software runs on a normal PC, and all you need is a small radio box to get the signals from the robot.

The Robot Control Center serves as an interface to control the robot. Its main feature is to display the transmitted pictures and measurement values of the sensors.

Various buttons and throttles give you full control of the robot when power is available or sunlight hits the solar cells. In addition, it’s easy to make short slide shows from the pictures captured by the robot. Each session can be saved on a disk and played in the Robot Control Center…

The entire article appears in Circuit Cellar 147 2002. Type “solarrobot”  to access the password-protected article.

Propeller Games (P2): Game Logic

In the first part of this article series on Parallax Propeller-based gaming projects, I hooked up the hardware for the Hi/Lo game on a breadboard. Now I’ll write the game logic. The finished code is available here.

The power of the Propeller chip is in its multiple CPU cores. But you can do just fine with one processor, especially for a simple game like Hi/Lo. You program each of the processors in assembly or in the Parallax-invented SPIN high-level language. Assembly programs run blazingly fast directly in the CPU core. SPIN compiles to a binary format that is interpreted by the SPIN interpreter (written in assembly). The interpreter runs in the CPU core.

The CPU core is designed for speed, but it only has room for 512 instructions. The SPIN interpreter fetches your program byte by byte from shared RAM. Your code runs more slowly, but you have 32K of space to work with. I’ll use assembly in future projects, but SPIN is perfect for Hi/Lo.

A SPIN file is a collection of functions and data (shared by all functions in the file). The functions use local variables kept on a call stack. You break up your programming task into smaller functions that build on one another and call each other. You pass parameters to the functions and use the return values. It is all very similar to C programming though the syntax is different. The interpreter begins with the first function in your file no matter what you name it.

I started the project with a test “main” and the functions to control the Hi/Lo speaker, LEDs, and switches. 

This function plays a tone on the speaker (Source: C. Cantrell)

The “playTone” function generates a square wave on the speaker pin. The “cnt” register is a built-in 32-bit value that increments with every system clock. I run the prop stick full out with an 80-MHz clock configuration (5M-Hz crystal with a *16 internal multiplier). The “waitcnt” instruction puts the CPU to sleep until the system clock reaches the requested value. There are two waits in the loop that generates one clock cycle. Thus the generated frequency is roughly 40 MHz/freq. I say “roughly” because each instruction takes a little time to execute. The actual generated frequency is slightly less. There are much better ways to generate a precise square wave with the propeller hardware, but this is function is easy to understand, and it works fine for the simple Hi/Lo game.

The LED display is a collection of 14 segments and two dots that are turned on or off by writing a 1 or 0 to the Propeller port pins. The program use a look-up table that defines the various segment patterns to be shown.

The output pin bit patterns for numeric digits (Source: C. Cantrell)

The look-up table is defined in a data (DAT) section in the program. The SPIN language allows you to define binary constants with a “%” prefix. You can use the underscore (“_”) anywhere in any numeric constant to make it easier to read. The comment line just above the table shows how the segments map to bit positions in the propeller’s output register.

The “drawNumber” function displays a two digit value on the display. The function first divides the value by 10. The whole part (value/10) is the digit in the 10s place. The remainder (value//10) is the digit in the 1s place. The function looks up the separate patterns, ORs them together, and writes to the “outa” output register to toggle the lights.

I wrote LED functions to “drawBlank” (blank the display) and “drawHi” (show “Hi”) and “drawLo” (show “Lo”). These one-line functions are easy enough to code inline where they are used. But having the functions in distinct blocks makes the using code easier to understand and modify.

The functions to read the buttons return Boolean values: true if the switch is pressed or false if it is not. When a button is pressed, the corresponding input bit in “ina” goes to “1.” There are five buttons and five functions—one for each. There is also an “isAny” function to detect if any button is pressed.

The function returns "true" if a button is pressed. (Source: C. Cantrell)

The game itself has two distinct modes. The “splash” mode flashes “Hi/Lo” and waits for a player to press a button. This is an “attract” mode that draws players to the game. The “splash” function returns when a button has been pressed. The “playGame” function is the game logic. The function returns when the game is over. Thus the main loop simply calls the two functions in an infinite loop.

???????????. (Source: C. Cantrell)

The “splash” function calls “drawHi” and “drawLo” with a pause between.

The function attracts a player to the game. (Source: C. Cantrell)

The “pauseStopOnAnyButton” function counts up the delay and watches for “isAny”. It aborts the pause and returns true if a button is pressed. The “SPLASH_DELAY” is defined in the constant (“CON”) area of the program. I keep all “magic numbers” like delay counts and tone values in the CON area for easy tweaking.

The “playGame” function uses three helper functions: “getPlayerGuess,” “showWin,” and “showHint.” The “showWin” and “showHint” functions are just a couple of lines each and could be coded inline. Having them separate allows you to enhance the visual effects without changing the game logic code.

The “getPlayerGuess” does the real work of the game. It watches the buttons and changes the displayed number accordingly.

The function takes the player input. (Source: C. Cantrell)

The “getPlayerGuess” function is an infinite loop with five IF checks for each button. When the middle button is pressed the function returns with the global “playerGuess” variable holding the input value. The other buttons increment or decrement the digits on the display. Each IF block checks for overflow and plays a feedback tone.

There you have it: a simple Hi Lo game. The visual and input effects are in separate functions ready to be spruced up. I bet your solution has many more bells and whistles! I look forward to reading your ideas in the comments of this blog.

Next time I’ll wrap up the Hi Lo game with a little multitasking. I’ll write parallel programs to run in two new CPU cogs to manage sound effects and the LED display.

Chris Cantrell earned an MSEE from the University of Alabama. He writes Java and Flex for Emerson Network Power in Huntsville, Alabama. Circuit Cellar published 10 of his articles between 2002 and 2012: Issue 145, Issue 152, Issue 161, Issue 184, Issue 187, Issue 193, Issue 205, Issue 209, Issue 139, and Issue 260.

Propeller Games (P1): Hi Lo

Welcome to the Propeller Games! In a few installments, I’ll present several gaming projects that use the Parallax Propeller chip. The Propeller is perfect for gaming with its multiple CPU cores to handle simultaneous gaming activities and its on-board video generation circuitry.

My first game project is the classic “higher/lower” game, where the computer thinks of a number between 0 and 99 and you guess it. You have probably seen this played as the “Clock Game” on The Price is Right TV show, though some contestants struggle with a basic binary search algorithm. (You can watch videos of the game at YouTube.com.)

This entire project is built on a solderless breadboard. If you are new to the Propeller, this is the perfect project to get acquainted with the hardware and programming. If you are a Propeller guru, you will enjoy the nostalgia of gaming on LEDs and push buttons. Grab your breadboard and follow along.

Parts

What you’ll need:

  • Breadboard and wire
  • 9-VDC wall transformer
  • Parallax PropStick USB
  • Two-digit 7-segment LED display
  • Five SPST pushbuttons
  • Audio speaker
  • Sixteen 200-Ω resistors
  • Five 10-kΩ resistors

The board and basic parts

The Parallax Propeller chip requires a few external components. You need a 3.3-VDC power regulator, a crystal, and a USB-to-serial converter. You also need a serial EEPROM if you want the Propeller to run your program at power up. You can buy all these separately and wire them up on the breadboard. Or you can save time and space with the Parallax PropStick USB. It combines all these external parts on the same footprint as the 40-pin Propeller chip.

I bought the LED display for this project from Mouser Electronics (part number 630-HDSP-521E). The large red segments are common anode (common ground). You supply positive voltage from a propeller port pin through a 220-Ω resistor to light the segments.

I bought the push buttons from Pololu Robotics & Electronics (part number 1400). They are specially designed for mounting on a breadboard. One side of each switch is connected to 3.3 V and the other is connected to a propeller port pin and pulled to ground with a 10-kΩ resistor.

I bought the speaker from Digi-Key (part number 668-1140-ND). The negative terminal of the speaker hooks to the breadboard’s ground. The positive terminal hooks directly to a Propeller port pin.

A speaker, one LED segment, and one switch wired to the Propeller

I placed four of the switches on the corners of the display. These switches are used as up/down inputs for each digit allowing the player to select a number from 00 to 99. The fifth button to the right of the display is the “Enter” button.

The photo above shows the speaker, one LED segment, and one switch wired to the Propeller. I tested the hardware and software incrementally as I hooked it up instead of trying to debug the final system as a whole.

The Parallax Propeller Tool is the free graphical Integrated Development Environment (IDE) you use to develop code for the Propeller. The code editor colors and highlights your work making it easy to see functions and keywords. It also manages indentation. The SPIN programming language uses indentation to identify code blocks much as Python does.

Basic hardware test

The code above is my basic hardware test. The CON (constants) section at the top configures the clock speed of the chip: 5 MHz × 16 = 80 MHz. The OBJ (object) section pulls in the serial terminal driver library. This library object allows you to use the USB cable for both programming and an input/output terminal. The one second pause on line 12 gives you time to switch from the IDE program to the terminal program on your PC once the code is downloaded. The Propeller tool download includes the parallax serial terminal for your PC.

Line 10 sets general I/O pin 0 (P0) as an output (they are inputs by default). Line 17 reads the switch connected to P11 and turns the LED segment on or off accordingly. Line 18 prints the state of the input pins to the PC terminal in an infinite loop.

Parallax serial terminal

It took me a while to warm up to the SPIN programming language. It is syntactically very different from C and its derivatives. But conceptually it is familiar: you break your software up into functions and local/global variables. In the end the simplicity of the syntax and the friendliness of the IDE won me over!

I really like the “Propeller font” used in the Propeller Tool IDE. It includes special symbols you can use to draw circuits and timing diagrams in your code comments. For instance:

Check out the font

Now to wire up the rest of the LEDs and switches. I thought about wiring the left digit to the first port byte and the right digit to the second port byte so that the segments are laid out the same way in each byte. This would make the software easier to write. But the pins for the segments on the display are kind of scattered around at random. The wiring is easier and neater if you wire the segments from the bottom of the display to the bottom of the propeller and from the top of the display to the top of the propeller. You can make up for the scattered pattern with software.

Two tips: Wire the segments from the bottom of the display to the bottom of the Propeller. Wire from the top of the display to the top of the Propeller.

Hi/Lo breadboard layout

That’s it for this installment. Now I’ll clean up all the little wire stripping sprinkles I left around my workbench. In Part 2 of this series, I’ll switch modes from hardware to software and write the Hi/Lo game. Hopefully you are following along. Until next time, may the COGs be ever in your favor.

Chris Cantrell earned an MSEE from the University of Alabama. He writes Java and Flex for Emerson Network Power in Huntsville, Alabama. Circuit Cellar published 10 of his articles between 2002 and 2012: Issue 145, Issue 152, Issue 161, Issue 184, Issue 187, Issue 193, Issue 205, Issue 209, Issue 139, and Issue 260.

User Interface Innovation: Collaborative Navigation in Virtual Search and Rescue

An engineering team from Virginia Tech’s Center of HCI and Department of Computer Science recently won first place in the IEEE’s 2012 3DUI Contest the for their Collaborative Navigation in Virtual Search and Rescue Escort (CARNAGE) project. The project was designed to enable emergency responders to collaborate and safely navigate a dangerous environment such as a disaster area.

The contest was open to researchers, students, and professionals working on 3-D user interface technologies. Entrants were challenged to design an application to enable two users—situated in different locations with his or her own UI—to navigate a 3-D environment without speaking to each other.

Collaborative Augmented Rescue Navigation and Guidance Escort UI (Source: Virginia Tech News, YouTube)

The Virginia Tech team—comprising Felipe Bacim, Eric Ragan, Siroberto, and Cheryl Stinson—described their design in a concise system description, which is currently available on the 3DUI 2012 contest website:

Our task specifically looks at communication between a scene commander and a disaster relief responder during a search and rescue operation. The responders inside the environment have great difficulty navigating because of hazards, reduced visibility, disorientation, and lack of survey knowledge of the environment. Observing the operation from outside of the disaster area, scene commanders work to help coordinate the response effort  [1, 2]. With the responder’s notifications about the environment, scene commanders can provide new instructions, alert the responders to risks, and issue evacuation orders. Since neither the commander nor the responder has complete information about the environment, effective communication is essential.

As technology advances, the incorporation of new tools into search and rescue protocols shows promise for improving  operation efficiency and safety. In this research, we explore the  use of 3D user interfaces to assist collaborative search-and-rescue. Ideally, users should be able to focus on their primary tasks in the VE, rather than struggle with travel and way finding. Using virtual reality (VR) as a prototyping testbed, we implemented a proof-of-concept collaborative guidance system. Preliminary evaluation has demonstrated promising results for efficient rescue operations.

The team also created an explanatory 6:16-minute project video:

Click here for more information about the IEEE Symposium on 3D User Interfaces in Costa Mesa, CA.

Source: Virginia Tech News

 

FPGA-Based VisualSonic Design Project

The VisualSonic Studio project on display at Design West last week was as innovative as it was fun to watch in operation. The design—which included an Altera DE2-115 FPGA development kit and a Terasic 5-megapixel CMOS Sensor (D5M)—used interactive tokens to control computer-generated music.

at Design West 2012 in San Jose, CA (Photo: Circuit Cellar)

I spoke with Allen Houng, Strategic Marketing Manager for Terasic, about the project developed by students from National Taiwan University. He described the overall design, and let me see the Altera kit and Terasic sensor installation.

A view of the kit and sensor (Photo: Circuit Cellar)

Houng also he also showed me the design in action. To operate the sound system, you simply move the tokens to create the sound effects of your choosing. Below is a video of the project in operation (Source: Terasic’s YouTube channel).