Journal Sections:
• embedded • hardware • java • life • mac-osx • opinion • photography • software •
• embedded
-
Arduino, an open-source platform, Pt.3:
ATmega 8 / 168 internal clock and fuse settings
Considering the already low price of the Arduino board, building an Arduino-like board yourself probably doesn't save you any money but is certainly a fun and education project to do.
I tried to make the simple board even simpler, by using a Serial instead of an USB Port, the ATmega's internal clock instead of an external crystal, and requiring 5 VDC instead of providing any kind of power regulation. However, my board does expose the 6 header ICSP, equivalent to the one available on the original Arduino NG Board.
RadioShack's Multipurpose 417 Holes $1.79 PC Board (Model: 276-150 Catalog: 276-150) built a great starting point for this electronics project, which was obviously inspired by Tom Igoe's 'Arduino Breadboard'.

After soldering the components onto the board and checking all joints, it was time to put the Arduino bootloader into the Flash Ram, which raised a couple system / software related questions I hadn't thought much about before:- To be able to use either the ATmega8, which is used on the original Arduino, or the pin compatible ATmega168 microcontroller, which offers twice the amount of internal RAM, I had put a 28-Pin DIP Socket on the board. While the original Arduino board uses an 16.0MHz external crystal, my board relies on the internal clock, which for the ATmega8 means a 1.0MHz Internal RC Oscillator (slowly rising power) and for the ATmega168 an 8.0MHz internal RC oscillator, which by default however gets divided by 8, resulting in 1.0MHz system clock. How could I address the speed difference, to keep software changes to a minimum?
- Since this obviously involved messing with the ATmega's confusing fuse settings, what fuse bits do I have to adjust?
- Arduino, an open-source platform, Pt.2I have been playing with Arduino for one week now and really enjoyed the simplicity with which Wiring allows access to I/O ports. The comprehensible but mandatory structure of a program works really well as long as things are kept simple, while somewhat more advanced programs could certainly benefit from access to interrupts.
However, before making things more complicated on the Software side, I wanted to replace Arduino's microcontroller chip (ATmega8) with the Atmega168-20PU ($4.11 at DigiKey), which most of all, doubles the amount of Flash Memory, the memory space, where binary versions of compiled programs end up.
Burn Baby Burn
The Arduino Mini board is already based on the ATmega168 and the development environment supports the ATmega168 as well. But how to burn the boot loader on to the bigger chip was still a bit of a mystery, at least to me.
Obviously, the microcontroller chips isn't any bigger and comes in the same 28-lead PDIP packaging, and since it is not soldered on to the board but sits in a socket, replacing the chip is very straight forward and took only a couple of seconds.
Burning the boot loader on the other hand took a little longer. The Arduino board has the AVR typical 6 headers ICSP, an in system programming port, which allows burning a boot loader without removing the microcontroller chip from the board. Most ISPs (In-System-Programmers) still require an serial or parallel port but don't work too well through USB-to-Serial adapters, not even with devices like the Keyspan HS19, and Mac users have to rely on AVR's AVRISP mkII (ATAVRIPS2-ND), available for $34 at DigiKey.
The AVRIPS can program newer 8-bit RISC microcontrollers (with ICSP Interface) through the USB port. The target board still needs to be powered and its regular ports should be disconnected from other devices. Only after following Dr. T.C.P.'s advice, disconnecting the HD44780 LCD, I was able to have the Mac communicate with the Arduino board through the ICSP.
- Arduino, an open-source platform, Pt.1Taking advantage of strong disagreements inside Germany, the Italian feudatories rebelled and, in 1002, elected Arduino, Marquess of Ivrea, king of Italy. He distinguished himself particularly because of his fights against the Bishop of Ivrea.
Today, Arduino distinguishes itself in price, capability, openness, and ease of use - but first things first.
Arduino is an open-source computing platform based on a simple board, and a development environment for writing software. The Arduino board hosts an Atmel MicroController chip, the AVR-ATMega8, which has 8-KByte self-programming Flash Program Memory, 1-KByte SRAM, 512 Byte EEPROM, 23 I/O pins, 6 or 8 Channel 10-bit A/D-converter, and 16 MIPS throughput at 16 MHz.
The other IC on the board is an FTDI FT232RL, a single chip USB/Asynchronous serial data transfer solution, with 256 Byte receive and 128 Byte transmit buffer.

Considering that these two chips alone would cost you about $10, the $32 that Spark Fun charges for the fully assembled, RoHS compliant, and tested Arduino board looks like a real bargin.
Moreover, like Tod points out, the Arduino looks even more attractive, when compared to the $119 Basic Stamp, which is another embedded computing platform, mainly for hobbyists and education.
However, Arduino is actually two things, ... - Tweak, Hack, and Bend Technology @ UCILater this week, I'll be at the OCEJUG, Orange County Embedded Java Users' Group, to give a presentation titled: Innovate - Tweak, Hack, and Bend Technology, showing how a small device, about the size of an iPod Shuffle, but capable of executing Java-Byte-Code, is turned into a Web server. After taking a very close look inside the workings of a digital toy camera, we will connect it to the embedded device, creating a full featured web-cam.
Along the way we may add some more hardware and learn a few things about how CMOS sensors capture image data and how a Bayer-Pattern can be used to decode the sensor data.
The free OCEJUG event takes place on October 19th at the University of California, Irvine (Engineering Tower, Room 331 / ET331), starting at 6:30 PM.

- SD Code Camp Pt.1 - Innovate - Tweak, Hack, and Bend TechnologyWhile San Diego Code Camp, which is taking place this weekend in the UCSD Extension facilities, looks more than just a little Microsoft .net heavy, there are some really good speakers lined-up, with very interesting topics.
To give attendees a chance to see some cool Microsoft .net-free technology and to reflect on how to inject innovation into their projects, I will give my favorite talk: "Innovate - Tweak, Hack, and Bend Technology".
Attendees will see how a small device (available for about $100 at Dallas Semiconductor), about the size of an iPod Shuffle, but capable of executing Java-Byte-Code, is turned into a Web server. After taking a very close look inside the workings of a digital toy camera, (available for about $10 on eBay), we are connecting it to the embedded device, creating a full featured web-cam.
Then we are going to write some Java code, load it into the device, and execute it remotely. But be warned, we are targeting an 8-bit processor running at only 40 MHz and its 1MB SRAM serves as file-system, program memory, and runtime heap.
Along the way we may add some more hardware and learn a few things about how CMOS sensors capture image data and how a Bayer-Pattern can be used to decode the sensor data.
San Diego Code Camp is taking place this weekend in the UCSD Extension buildings.
See you in Room 143, 1:15 PM to 2:30 PM: Innovate - Tweek, Hack, and Bend Technology

- DivX, H.264, Video Codecs, etc.While the big guys fight over the next DVD standard, (Blu-ray optical discs and HD DVD discs, two different and new DVD formats offering higher capacity than current DVDs, which aren't capable of storing an entire high-definition movie on a single disc), what are you and I do when capturing a movie from a DVD or TV Capture board or (USB device)?
Years back, when I was recording every episode of Millennium (a Chris Carter creation), I was using DivX, but since I wanted to be able to watch it on TV, I ended up encoding in MPEG-2 and writing in onto a CD in VCD format.
Today, one can find quite a few DVD-Players supporting DivX (http://www.divx.com and http://www.divxnetworks.com)out of the box and most of you probably have some kind of PC or Mac mini sitting right next to the TV, able to feet it with all kind of video stuff, no matter the format.
However, imagine for a moment, you still had the goal to burn your captured video onto a CD or DVD, what codec would fit the bill? Apple seems to be pushing H.264, a next-generation MPEG-4 video compression technolog, quite heavily and beside Quicktime, Vsoft for instance has codecs available. DivX, which has arrived at Version 5.2.1 for the Mac is also still an option.
A couple Russians have put together an amazing 66 pages long comparison (don't worry - it's written in English) of some of the most popular CODECs (DivX, H.264, Fraunhofer, AVC, etc.)
Looks like current H264 codecs are approximately on a level of DivX 2.0 but are catching up quickly and the next versions should be similar DivX5.
Any thoughts?
-wolf
- Specialized Certificate In Embedded Computer SoftwareOver the last year or two I have blogged a couple times about the late-night classes I was taking at UCSD Extension here in San Diego. Some of related work I did is documented in the Embedded Systems Projects area of my site.
Most classes were tought by Ken Arnold, president of HiTech Equipment Corporation and author of Embedded Controller Hardware Design and like I have said before, the speed he is going through the 1st three or four chapters is always mind boggling ..
After working quite a few nightshifts and weekends, doing homework, even some soldering, project reports, preparing for presentations, mid-term and final exams, it finally happened:
UCSD's "Specialized Certificate In Embedded Computer Software" came is the mail.
Now, the only question remaining .. what do I do with all that spare time ;-)
- When I needed it mostJust when I needed it most, Germany's CadSoft Computer GmbH made their awesome PCB design, Schematic and Board Layout, and Autorouter Software available for the Mac.
CadSoft's German site: http://www.cadsoft.de/
CadSoft's US site: http://www.cadsoftusa.com/
Their EAGLE Layout Editor is an easy to use, powerful tool for designing printed circuit boards (PCBs). Best of all, the EAGLE Light Edition can be used for free!

- MIDP 2.0 on a Mac - so close - so far awayDid you ever ask yourself why there aren't any really cool MIDP2 applications for your PDA or cell phone?
If you are reading this blog, chances are you have switched to a Mac soon after OS X was released or maybe more recently - if not - you probably wish you had and still look for the right moment. Anyway, our developer friends on Window PCs enjoy developing MIDP 2.0 applications, using Sun's J2ME Wireless Toolkit, which has become the de facto standard toolkit for developing applications for Java 2, Micro Edition (J2ME).
J2ME Wireless Toolkit 2.2 supports:
- MIDP 1.0 and 2.0
- CLDC 1.0 and 1.1
- Java APIs for Bluetooth
- Mobile 3D Graphics API for J2ME
- Wireless Messaging API (WMA)
- Mobile Media API (MMAPI)
- J2ME Web Services
- etc.
Developers, working on a Mac have been left behind - way behind. MIDP 1.0.3 is the most recent reference implementation available on OS X.
- Java, C, J2ME, and BREW
Embedded Devices
When working on embedded devices, I occasionally do some C programming. Writing a driver allowing downloading images from a digital camera into an 8-bit Microcontroller required even some assembler coding. Anyway, besides those adventurous expeditions I'm pretty much a hardcore Java coder - if you hadn't heard.
Mobile Devices
Sun Micro's Java Micro Edition (J2ME, Java subset for small consumer and embedded devices with limited capabilities) and Qualcomm's Binary Runtime Environment for Wireless (BREW, runtime environment running at the firmware level (CDMA chipset) and available only to CDMA-based wireless devices sporting Qualcomm processors) are the two technologies at hand when developing an application targeting a mobile device. J2ME and BREW compete on the execution platform (phone, PDA, etc.) but also through different distribution and billing systems as well as through their respective developer communities.
But there is a lot going on currently in the mobile devices space:
Subscribe