Arduino Teaches Old Coder New Tricks
Because some of the components I was using do not exist in the built-in library, I scoured the Internet for contributed symbols, and in a few cases, I had to design my own symbols. A good source for contributed symbols and footprints is http://gedasymbols.org. For creating your own symbols, see David Weber's Online Symbol Creation Tool at http://EmbeddedToolBox.com. Symbols actually are text files. Figure 3 illustrates a symbol along with a portion of the text file used to draw it. Symbol files are not just an image. They also hold important pin definitions and the name of the footprint file that the gEDA PCB program ultimately will use to represent the component on the circuit board.
Figure 3. Symbol Example 1
A gEDA schematic is a text file interpreted for GUI presentation by gschem, but it also serves as the source for gEDA's PCB program. An intermediary helper program named gsch2pcb is used to prepare the schematic file for use as input to the PCB program. While xgsch2pcb is a GUI version of gsch2pcb for gsch2pcb, I use the gsch2pcb command-line version. For example, given the schematic file vt100lcd84.sch as an input, gsch2pcb creates vt100lcd84.pcb, vt100lcd84.net and vt100lcd84.cmd, all necessary files for PCB creation. gsch2pcb also displays important instructions as part of its command-line text output. To make the process a little easier, I use a file named "project" in the project folder for the current design. Figure 4 shows my project folder for the vt100lcd84 project, the "project" file and the command line with the gsch2pcb command just before execution.
Figure 4. Example of gsch2pcb Project File
It is worth noting that the gEDA suite includes circuit simulation capability (SPICE), enabling virtual design testing. I did not use SPICE with my VT100-LCD project, but see the Resources for this article if you are interested.
Software Design
Now that I had the circuitry designed for the project, it was time for the software. I wrote the software as a simple state machine that parses each character received on a character-by-character basis, meaning that there is no buffer. Characters are handled differently based upon the current state of the machine. If the state is NOTSPECIAL, the character simply is passed to the LCD screen for display. However, if the state is GOTESCAPE, GOTBRACKET or INNUM, the character is processed further. For example, if the state is GOTBRACKET, both an escape and left-bracket character have been received previously, and the current character must be parsed in that context. For illustration, the VT100 sequence for Screen-Clear is \033[2J, and if the current character being parsed was the 2, the state would be GOTBRACKET, and the next state would be INNUM (number collection).
This method of parsing has the advantage of simplicity, which is suitable for the limited-capacity microcontrollers but with the disadvantage of not being able to scroll the screen due to the absence of a buffer holding a copy what is on the screen. See Resources for a copy of the software source. I used Arduino libraries to build the code. Although the source can be compiled using the Arduino IDE, I used Linux make. Using the Arduino libraries makes the project extremely easy to build. Most of the drudgery of low-level code and the bootloader is hidden away within the Arduino libraries, which freed me to focus solely on my project. Even main() is hidden away such that Arduino code contains two required routines: setup() and loop(). Main actually does exist deep in the Arduino directory structure in ~/arduino/arduino-1.0/hardware/arduino/cores/arduino/main.cpp and is automatically linked in at compile time.
Edward Comer is retired from the telecommunications industry, having worked for the real AT&T, BellSouth and Numerex Corp during a 30-year career.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
- Dynamic DNS—an Object Lesson in Problem Solving
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- A Topic for Discussion - Open Source Feature-Richness?
- Drupal Is a Framework: Why Everyone Needs to Understand This
- RSS Feeds
- Validate an E-Mail Address with PHP, the Right Way
- Readers' Choice Awards
- Tech Tip: Really Simple HTTP Server with Python
- DynDNS
1 hour 21 min ago - Reply to comment | Linux Journal
1 hour 53 min ago - All the articles you talked
4 hours 17 min ago - All the articles you talked
4 hours 20 min ago - All the articles you talked
4 hours 21 min ago - myip
8 hours 46 min ago - Keeping track of IP address
10 hours 37 min ago - Roll your own dynamic dns
15 hours 50 min ago - Please correct the URL for Salt Stack's web site
19 hours 2 min ago - Android is Linux -- why no better inter-operation
21 hours 17 min ago



Comments
medical assistant
Medical Assistant programs and medical assistant classes are now online at St. Augustine School of Medical Assistants.
Now offers a nationally accredited and certified medical assistant program online.
St. Augustine School of Medical Assistants is a provider of online medical assistant programs and medical assistant courses.
Thank you for teaching us
Thank you for teaching us this trick. This trick is very useful.
Jasa SEO
You stirred my curiosity
You really did. Never been interested in playing with hardware stuff. Been a web developer for years, never looked into hardware programming and Arduino and stuff like this. Now I want to learn it lol
Good writeup on this, keep up the good work mate
Cheers,
Hosting Dude
I want to learn Arduino
I want to learn Arduino projects. maybe by reading this article can help me. tempo
medical assistant job
medical assistant job description
Check out: medical assistant
Check out: medical assistant job description
Thanks for share this
Thanks for share this article. I think Arduino projects is amazing. berita Indonesia
Nice one
Thanks for sharing your ideas and thoughts, i like your blog and bookmark this blog for further use thanks again…
It didn't take very long to
It didn't take very long to remove the mental cobwebs and get into the elegant simplicity of the Arduino Project. Years ago, when I built microprocessor projects, the underlying system code always was the problem. Before I actually could write my application, I had to develop or adapt systems-level code to interface the application-level code with the underlying hardware. Cleaners London
hello
I discovered your blog so far ... much information to improve our space! So thank you and have a nice day!
voyance en direct
The link to the source code
The link to the source code and design schematics just refers to the google code homepage :)
Nice!
What a great article!
Are you familiar with Instructables.com? They have many Arduino projects. I think this would be a great submission.