Show Your Circuit Cellar, Hackspace, Design Space!

Where do you design, hack, create, program, debug, and innovate? Do you work in a 20′ × 20′ space in your cellar? Do you share a small workspace in a lab at a university? Do you design in your dorm room? Do you work at your office after hours when the 9-to-5 employees are long gone? Have you built a “design cave” in your garage? Do you construct your projects at your local hackspace facility? We want to see where you design and program! Show us your personal circuit cellar or whatever you call your design space!

Email your pics, as well as a short description of the space, to editor@circuitcellar.com

We might feature your space on our website!

Check out these spaces:

Inside the Elektor lab in Limbricht, The Netherlands (November 2011)

 

Circuit Cellar columnist Robert Lacoste’s workspace in Chaville, France.

 

The Elektor Lab November 2011

Laser TV Project: BASCOM Programmers Wanted

Do you have sound programming skills and an interest in assisting a fellow electronics designer with an creative image projection project? If so, the Laser TV Project posted on the “Elektor Projects” website is for you.

The Laser TV Project (Source: Elektor-Projects.com)

Website editor Clemens Valens writes:

Some people use electronics to build something they need, others just want to find out if something can be done. These projects are often the most fun to read about because of their unusual character and the creativity needed to accomplish the (sometimes bizarre) goal. The laser TV project posted on Elektor Projects is such a project. It is an attempt to project an image by means of 30 rotating mirrors mounted on a VHS head motor. Why you would want to do such a thing is not important, can it be done is the thing that matters.

According to the author the main challenge is the phase synchronization of the top plate on which the mirrors are mounted, and the author is looking for interested BASCOM programmers to develop the motor PLL (or a similar software solution). The motor rotates at 750 rpm and must be precisely synchronized to a pulse, which is available once per revolution.

Do you want to help with this project? Have you done something similar with Atmel and BASCOM? If so, go to Elektor-projects.com and help “hpt” with the project. You can also review other projects and vote. Your vote counts!

CircuitCellar.com and Elektor-projects.com are Elektor International Media publications.

Free Webinar: Bridge Android & Your Electronics Projects

Do you want to add a powerful wireless Android device to your own projects? Now you can, and doing so is easier than you think.

With their high-resolution touchscreens, ample computing power, WLAN support, and telephone functions, Android smartphones and tablets are ideal for use as control centers in your projects. But until now, it has been difficult to connect them to external circuitry. Elektor’s AndroPod interface board, which adds a serial TTL port and an RS-485 port to the picture, changes this situation.

The Elektor AndroPod module

In a free webinar on June 21, 2012, Bernhard Wörndl-Aichriedler (codesigner of the AndroPod Interface) will explain how easy it is to connect your own circuitry to an Android smartphone using the AndroPod interface. Click here to register.

Elektor Academy and element14 have teamed up to bring you a series of exclusive webinars covering blockbuster projects from recent editions of Elektor magazine. Participation in these webinars is completely free!

Webinar: AndroPod – Bridging Android and Your Electronics Projects
Date: Thursday June 21, 2012
Time: 16:00 CET
Presenter: Bernhard Wörndl-Aichriedler (Codesigner of the Andropod Interface)
Language: English

CircuitCellar.com is an Elektor International Media publication.

A CTO’s Bright & Clean Workspace

Our enthusiasm for bright and clean workspaces won’t wane. A tidy, well-lit space is a must-have for a designer working with microcontrollers, PCBs, and small components such as transistors and capacitors. Fergus Dixon’s Sydney, Australia-based workspace is an excellent example.

Keeping a space clean and bright is key. (Source: F. Dixon)

Dixon submitted the following information about his workspace:

The tools I use include an oscilloscope, function generator, variable DC power supply and desoldering tool. The Oscilloscope is a new Agilent DSP-X 3014A which replaces the old Tektronix TDS210 which lasted for 12 years. I looked into the Chinese Rigol scopes, but while they are value for money, opted to go for a high-end scope. The function generator is a cheap one with an annoying mains hum, and the DC supply is a GPS-3030D which has been going well for over ten years, and another would be useful. The desoldering tool is a Hakko 701 which needs to be replaced with a hot-air gun soon for small SMD work. The workspace has a workbench for assembly of prototypes and a desk. The major issue is being able to store all the parts in a logical way – the new yellow boxes work well with pullout trays for small SMD parts. There are a few new projects this month including an energy meter which is better than the rest and electric fence energizers for farms. Reverse engineering projects are the hardest and most rewarding since you pick up experience from other engineers and see different methods of building circuits.

A narrow workspace can be useful when moving to and from equipment and tools (Source: F. Dixon)

Nice cabinet space and storage for electronics components (Source: F. Dixon)

Dixon is the Chief Technical Officer at Electronic System Design (ESD), which he started to provide hardware and software engineering services to clients. After completing one of ESD’s recent projects for a client, Dixon published an article titled “Smart Switch Management: Construct and MCU-Based, Net-Enabled Controller” in Circuit Cellar 263 (June 2012).

The following excerpt is the introduction to his article about the switch controller.

“Mate, we have a new project for you you’ll like this one,” said my pal from the contract assembly company. New projects are often referred to contract assembly companies and printed circuit board (PCB) designers, so it pays to be on good terms with them. This project was to design a controller for up to 50 smart switches. Smart switches are energy-saving devices installed in office blocks to automatically turn off the lights at the end of the day to conserve energy. The controller needed an accurate real-time clock (RTC) that would pulse a 24-V AC line once or twice to turn off the smart switches at the end of the working day, and repeat at two- to three-hour intervals in case the lights were turned on. After the first prototype was finished, the Ethernet interface was added.

The first prototype featured a Microchip Technology ENC28J60 Ethernet chip on a Vero board.

The design features Microchip Technology ENC28J60 Ethernet chip

You can read the entire article in the June 2012 issue.

Share your space! Circuit Cellar is interested in finding as many workspaces as possible and sharing them with the world. Email editor at circuitcellar.com to submit photos and information about your workspace. Write “workspace” in the subject line of the email, and include info such as where you’re located (city, country), the projects you build in your space, your tech interests, your occupation, and more. If you have an interesting space, we might feature it on CircuitCellar.com!

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.