tag:blogger.com,1999:blog-11542175370133731022024-02-02T22:44:56.587+07:00Embedded Microcontroller ProgrammingµC - News, Resources and Tutorials <br>8051erhttp://www.blogger.com/profile/14637202055329685184noreply@blogger.comBlogger40125tag:blogger.com,1999:blog-1154217537013373102.post-14767479680694376952010-06-14T16:52:00.001+07:002012-08-13T22:35:45.307+07:00Understanding Processor Architecture: Machine and Assembly LanguageThe processor understands only the machine language, whose instructions consist of strings of 1s and 0s. Machine language is closely related to the assembly language. We prefer to use the assembly language rather than the machine language. Programming in the assembly language also requires knowledge about the processor architecture.<br />
<br />
Assembly language programming is referred to low-level programming because each assembly language instruction performs a much lower-level task compared to an instruction in a high-level language. Assembly language instructions are processor specification dependents. For example, a program written in the Intel assembly language cannot be executed on the PowerPC processor.<br />
<br />
Here are some IA-32 assembly language examples:<br />
<pre lang="asm">
inc result
mov class_size, 45
and mask1, 128
add marks, 10</pre>
<br />
The first instruction increments the variable result. This assembly language instruction is equivalent to<br />
<code> </code><br />
<pre lang="c">
result++;</pre>
<br />
in C. The second instruction initializes <code>class_size</code> to 45. The equivalent statement in C is<br />
<code> </code><br />
<pre lang="c">
class_size = 45;</pre>
<br />
The third instruction performs the bitwise and operation on <code>mask1</code> and can be expressed in C as<br />
<code> </code><br />
<pre lang="c">
mask1 = mask1 & 128;</pre>
<br />
The last instruction updates marks by adding 10. In C, this is equivalent to<br />
<code> </code><br />
<pre lang="c">
marks = marks + 10;</pre>
<br />
We can translate the assembly language instructions to the equivalent machine language instructions. Machine language instructions are written in the hexadecimal number system. Here are some IA-32 machine language examples:<br />
<br /><table border="0" style="width: 100%px;"><tbody>
<tr><td bgcolor="#cccccc"><br />
<div align="center">
Assembly</div>
<br /></td><td bgcolor="#cccccc"><br />
<div align="center">
Operation</div>
<br /></td><td bgcolor="#cccccc"><br />
<div align="center">
Machine language (in hex)</div>
<br /></td></tr>
<tr><td><br />
<pre lang="asm">nop</pre>
<br /></td><td>No operation</td><td>90</td></tr>
<tr><td><br />
<pre lang="asm">inc result</pre>
<br /></td><td>Increment</td><td>FF060A00</td></tr>
<tr><td><br />
<pre lang="asm">mov class_size, 45</pre>
<br /></td><td>Copy</td><td>C7060C002D00</td></tr>
<tr><td><br />
<pre lang="asm">and mask, 128</pre>
<br /></td><td>Logical and</td><td>80260E0080</td></tr>
<tr><td><br />
<pre lang="asm">add marks, 10</pre>
<br /></td><td>Integer addition</td><td>83060F000A</td></tr>
</tbody></table>
<br />
<br />
<b>References</b><br />
<ul><br />
<li><i>Guide to RISC Processors for Programmers and Engineers</i> by Sivarama P. Dandamudi, Springer (2005), ISBN 0-387-21017-2.</li>
</ul>
Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-1154217537013373102.post-52410670434969433812008-11-03T14:52:00.003+07:002010-06-14T14:40:10.013+07:00P89V51 code SVNI have decided to open my small project on SDCC c code for P89V51. This project is open source. It is distributed under <a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a>.<br /><br /><b>How to download?</b><br /><br />Use this command to anonymously check out the latest project source code<br /><br /><code>svn checkout http://p89v51-sdcc.googlecode.com/svn/trunk/ p89v51-sdcc-read-only</code><br /><br />Or, please find the compressed files (.zip, .gz) from the project page<br /><br /><a href="http://p89v51-sdcc.googlecode.com/">http://p89v51-sdcc.googlecode.com</a><br /><br /><br />If found bugs or got troubles, please feel free to report here.<br /><br /><br />---Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-1154217537013373102.post-81776531427200278612007-04-22T16:34:00.003+07:002010-06-14T12:12:27.955+07:00Build Your Own ARM Cross Compiler Toolchain<a href="http://www.gnuarm.com/">GNUARM</a> is a set of open source GNU compiler for ARM microcontroller. The toolchain consists of the GNU binutils, GCC compiler set, Newlib and Insight, the graphical user interface to GNU debugger for Windows and Linux. This article will guide the building process of GNUARM toolchain only for Linux users. For Windows users, there have the installer executable EXE files already. <a href="http://www.scienceprog.com/gnuarm-for-arm-microcontrollers/">www.scienceprog.com</a> has a tutorial on setting up this tool on Windows environment.<br /><br /> <strong>Get the sources</strong><br />I will demonstrate the building process for GCC-4.1 only. For the others version, you can find the <a href="http://www.gnuarm.com/files.html">GNUARM distributions files from here</a>. Here is the list of files that are required for the installation.<br /><ul><br /> <li>binutils-2.17.tar.bz2 [13.1MB]</li><br /> <li>gcc-4.1.1.tar.bz2 [37.3MB]</li><br /> <li>newlib-1.14.0.tar.gz [7.61MB]</li><br /> <li>insight-6.5.tar.bz2 [20.4MB]</li><br /></ul><br />I compiled the sources code with gcc-4.1.1 on Fedora Core 6 (kernel-2.6.18). Note that I built the toolchain as root. I also wanted the arm-target stuff separate from my Linux-native stuff, so I put the toolchain in /usr/local/gnuarm.<br /><br /><strong>Building Instruction</strong><br /><pre lang="bash">[home]# tar xvf binutils-2.17.tar.bz2<br />[home]# tar xvf gcc-4.1.1.tar.bz2<br />[home]# tar xvf newlib-1.14.0.tar.gz<br />[home]# tar xvf insight-6.5.tar.bz2<br />[home]# cd binutils-2.17<br />[binutils-2.17]# ./configure --target=arm-elf \<br />--prefix=/usr/local/gnuarm --enable-interwork --enable-multilib<br />[binutils-2.17]# make all install<br />[binutils-2.17]# export PATH="$PATH:/usr/local/gnuarm/bin"<br />[binutils-2.17]# cd ../gcc-4.1.1<br />[gcc-4.1.1]# ./configure --target=arm-elf \<br />--prefix=/usr/local/gnuarm --enable-interwork \<br />--enable-multilib --enable-languages="c,c++" \<br />--with-newlib --with-headers=../newlib-1.14.0/newlib/libc/include<br />[gcc-4.1.1]# make all-gcc install-gcc<br />[gcc-4.1.1]# cd ../newlib-1.14.0<br />[newlib-1.14.0]# ./configure --target=arm-elf \<br />--prefix=/usr/local/gnuarm --enable-interwork --enable-multilib<br />[newlib-1.14.0]# make all install<br />[newlib-1.14.0]# cd ../gcc-4.1.1<br />[gcc-4.1.1]# make all install<br />[gcc-4.1.1]# cd ../insight-6.5<br />[insight-6.5]# ./configure --target=arm-elf \<br />--prefix=/usr/local/gnuarm --enable-interwork --enable-multilib<br />[insight-6.5]# make all install</pre><br />Now, I hope everthing is done. You can test by running arm-elf-gcc command in the shell.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1154217537013373102.post-62972706852312560192007-04-19T17:41:00.001+07:002010-06-14T16:29:54.273+07:008051 mcu, von Neumann vs Harvard ArchitecturesWe can classify computer architectures into two categories:<br /><br /><strong>von Neumann architecture:</strong> computers has a single, common memory space in which both program instructions and data are stored. There is a single internal data bus that fetches both instructions and data. They can not be performed at the same time.<br /><br /><strong> Harvard architecture:</strong> computers have separate memory areas for program instructions and data. There are two or more internal data buses, which allow simultaneous access to both instructions and data. The CPU fetches program instructions on the program memory bus.<br /><br />The 8051 microcontrollers (MCS-51) have an 8-bit data bus. They can address 64K of external data memory and 64K of external program memory. These may be separate blocks of memory, so that up to 128K of memory can be attached to the microcontroller. Separate blocks of code and data memory are referred to as the <strong>Harvard architecture</strong>. A single block of memory may be mapped to act as both data and program memory. This is referred to as the <strong>Von Neumann architecture</strong>.<br /><br />The 8051 has two separate read signals, RD# (P3.7) and PSEN#. The RD# (P3.7) is activated by clearing to logic level 0 when a byte is to be read from external data memory, PSEN#, from external program memory. All external code is fetched from external program memory. The bytes from external program memory may be read by special read instructions such as the MOVC. And there are separate instructions to read from external data memory, such as the MOVX instruction. In order to read from the same block using either the RD# signal or the PSEN# signal, the two signals are combined with a logic AND operation. This way, the output of the AND gate is low when either input is low.<br /><br />By adopting the Von Neumann architecture, code may be written to memory as data bytes, and then executed as program instructions.<br /><br /><strong>Further Reading</strong><br /><ul><br /> <li><a href="http://www.keil.com/download/docs/192.asp">8051 von Neumann Memory Example Program (Keil)</a></li><br /> <li><a href="http://www.nabble.com/Harvard-vs-von-Neumann-t1853153.html">Harvard vs von Neumann (MSP430 Discussion)</a></li><br /></ul>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1154217537013373102.post-88539830617122159142007-04-12T22:35:00.002+07:002010-06-14T16:32:07.184+07:00Microcontroller Programmer DIYI search about this issue for a while, "Building programmer of our own designs". I found a few of open source programmer projects so that every body can use and contribute it. Here is an opportunity of learning the microcontroller programmer designs from that open schematics.<br /><br />Here is a list of Microcontroller Programmer, Do It Yourself (DIY).<br /><ul> <strong>8051</strong><br /> <li><a href="http://chaokhun.kmitl.ac.th/~kswichit/pgm89_web/Pgm89.html">ATMEL 89C Series Flash Microcontroller Programmer Ver 1.1</a> - This programmer was designed in view of to be flexible, economical and easy to built, the programmer hardware utilizes the standard TTL series parts and no special components are used. The programmer is interfaced with the PC parallel port and there is no special requirement for the PC parallel port, so the older computers can also be used with this programmer.</li><br /> <li><a href="http://www.pjrc.com/tech/8051/aicp-schematic.html">Atmel 89C2051 In-Circuit Programmer Schematic</a> - The idea is to add this circuitry to a board with already has ram at 2000 and an 82C55 I/O chip to provide ports A, B and C. <strong>This is a "beta release" schematic. Use at your own risk</strong></li><br /> <li><a href="http://www.kmitl.ac.th/~kswichit/ISP-Pgm3v0/ISP-Pgm3v0.html">ISP Flash Microcontroller Programmer Ver 3.0</a> - This ISP Programmer can be used either for in-system programming or as a stand-alone spi programmer for Atmel ISP programmable devices. The programming interface is compatible to STK200 ISP programmer hardware so the users of STK200 can also use the software which can program both the 8051 and AVR series devices.</li><br /> <li><a href="http://sokrates.mimuw.edu.pl/~sebek/atmelprog/">Atmel AT89Cx051 programmer</a></li><br /><strong>PIC</strong><br /> <li><a href="http://pp06.sourceforge.net/">PP06 PIC Programmer Software</a> - PP06 is an open-source Production programmer for Microchip's PIC micros. Specifically designed for use in factory in-circuit programming, and development of master/slave systems it supports many pics,and is easily extended to different hardware.</li><br /> <li><a href="http://www.bobblick.com/techref/projects/picprog/picprog.html">Classic PIC Programmer</a> - The classic PIC 16C84/16F84 programmer. The design is originally by David Tait and modified by Bob Blick</li><br /><strong>AVR</strong><br /> <li><a href="http://www.avrfreaks.net/index.php?module=Freaks%20Tools&func=viewItem&item_id=584&item_type=tool">AVR911: AVR Open-source Programmer</a> - The AVR Open-source Programmer (AVROSP) is an AVR programmer application that replaces the AVRProg tool included in AVR Studio. It is a command-line tool, using the same syntax as the STK500 and JTAGICE command-line tools in AVR Studio.</li><br /> <li><a href="http://electrons.psychogenic.com/modules/arms/art/5/AVRInSystemProgrammer.php">AVR In-System Programmer</a> - They provide details on our version of the Atmel AVR In-System Programmer (ISP). They provide schematics and printed circuit board (PCB) art to allow you to construct your own programmer.</li><br /></ul>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-1154217537013373102.post-11144558643750574992007-04-09T00:05:00.002+07:002012-08-13T22:35:02.217+07:00Learn Embedded Linux with ARMulator<a href="http://www.uclinux.org/index.html"><b>uClinux</b></a> is an excellent way to study the embedded operating systems for an engineer, student, hobbyist, Linux-enthusiast. I am interested in Embedded Linux for ARM microcontroller. Before buying a new mcu evaluation board, there is a smart way to study the Embedded Linux. That is studying it with the emulator called <a href="http://www.uclinux.org/pub/uClinux/utilities/armulator/">ARMUlator</a>.<br />
<br />
I tested on <a href="http://fedoraproject.org/">Fedora Core 6</a> Linux with GCC 3.4.x (<a href="http://www.mjmwired.net/resources/mjm-fedora-fc6.html#gcc3">how to install gcc 3.4 for FC6</a>).<br />
<br />
<b>What you get</b><br />
<br />
Here are some files you can use to put together uClinux running in the GDB/ARMulator.<br />
<ul><br />
<li><a href="http://www.uclinux.org/pub/uClinux/utilities/armulator/gdb-5.0.tar.bz2">gdb-5.0.tar.bz2</a> - The orginal gdb-5.0 archive.</li>
<br />
<li><a href="http://www.uclinux.org/pub/uClinux/utilities/armulator/gdb-5.0-uclinux-armulator-20060104.patch.gz">gdb-5.0-uclinux-armulator-20060104.patch.gz</a> - Patches against gdb-5.0 based heavily on the ARMulator changes from Ben Williamson <benw pobox.com="pobox.com"> with changes to behave like an Atmel AT91 device.</benw></li>
<br />
<li><a href="http://www.uclinux.org/pub/uClinux/utilities/armulator/linux.2.4.x.gz">linux.2.4.x.gz</a> - A precompiled uClinux kernel binaries that you can run in the emulator.</li>
<br />
<li><a href="http://www.uclinux.org/pub/uClinux/utilities/armulator/romfs.2.4.x.gz">romfs.2.4.x.gz</a> - romfs images to use with the above kernels.</li>
</ul>
<br />
<b>Building the Debugger/Emulator</b><br />
<pre lang="bash">
tar xvf gdb-5.0.tar.bz2
gunzip gdb-5.0-uclinux-armulator-20060104.patch.gz
patch -p0 < gdb-5.0-uclinux-armulator-20060104.patch
cd gdb-5.0
export CC=gcc34
./configure --target=arm-elf
make
make install</pre>
<br />
<b>Running the precompiled binaries</b><br />
<br />
The ARMulator expects the romfs to be in a file called "boot.rom". You must use the matching kernel/romfs combo's.<br />
<pre lang="bash">
gunzip romfs.2.4.x
gunzip linux.2.4.x
ln -s romfs.2.4.x boot.rom
arm-elf-gdb linux-2.4.x
...
gdb> target sim
...
gdb> load
...
gdb> run</pre>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1154217537013373102.post-30185343808750281582007-04-07T19:52:00.002+07:002010-06-14T16:35:08.728+07:00Microcontrollers and the GNU Public License (GPL)Open Source software is released according to the terms of the GNU Public License, GPL. The GPL is intended to guarantee your rights to use, modify and copy the subject software. Along with the rights comes an obligation. If you modify and subsequently distribute software covered by the GPL, you are obligated to make available the modified source code. The changes become a “derivative work” which is also subject to the terms of the GPL. This allows other users to understand the software better and to make further changes if they wish.<br /><br />This works well for most software but there is at least one problem. Suppose, for example, that you write a clever application that you wish to keep proprietary. If you link it with a C library covered by the GPL, your application becomes a derivative work and thus you’re required to distribute your source code.<br /><br />To get around this, and therefore promote the development of Open Source libraries, the Free Software Foundation came up with the “Library GPL.” The distinction is that a program linked to a library covered by the LGPL is not considered a derivative work and so there’s no requirement to distribute the source, although you must still distribute the source to the library itself.<br />Subsequently, the LGPL became known as the “Lesser GPL” because it offers less freedom to the user. So while the LGPL makes it possible to develop proprietary products using Open Source software, the FSF encourages developers to place their libraries under the GPL in the interest of maximizing openness.<br /><br />Here is a list of GPL software for microcontroller developers.<br /><ul><br /> <li><strong><a href="http://sdcc.sourceforge.net/">SDCC</a></strong>: a Freeware, retargettable, optimizing ANSI - C compiler that targets the Intel 8051, Maxim 80DS390, Zilog Z80 and the Motorola 68HC08 based MCUs (GPL)</li><br /> <li><strong><a href="http://www.gnupic.org/">GNUPIC</a></strong>: a collect of GNU software for PIC microcontrollers</li><br /> <li><strong><a href="http://winavr.sourceforge.net/">WinAVR</a></strong>: a suite of executable, open source software development tools for the Atmel AVR series on the Windows</li><br /> <li><strong><a href="http://www.gnuarm.org/">GNUARM</a></strong>: GNU toolchain ARM microcontrollers</li><br /></ul>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1154217537013373102.post-87719833757165367722007-04-06T19:48:00.002+07:002010-06-14T16:36:37.282+07:00Linux for Embedded SystemsFor a microcontroller learner, Embedded System is a challenge. Linux are used as an operating system for the modern embedded devices. I am a one who are trying to study Linux on an embedded microcontroller, i.e., 8051 mcu and ARM. Let's start together!<br /><br />This is a list of some sites that are of particular interest to embedded developers.<br /><br /><a href="http://www.kernel.org/">kernel.org</a> – The Linux kernel archive. This is where you can download the latest kernel versions as well as virtually any previous version.<br /><br /><a href="http://sourceforge.net/">sourceforge.net</a> – “World’s largest Open Source development website.” Provides free services to open source developers including project hosting and management, version control, bug and issue tracking, backups and archives, and communication and collaboration resources.<br /><br /><a href="http://www.linuxdevices.com/">linuxdevices.com</a> – A news and portal site devoted to the entire range of issues surrounding embedded Linux.<br /><br /><a href="http://www.embedded-linux.org/">embedded-linux.org</a> – The Embedded Linux Consortium, a nonprofit, vendor neutral trade association promoting Linux in the embedded space. Its major effort at present is the development of an embedded Linux platform specification.<br /><br /><a href="http://www.embedded.com/">embedded.com</a> – The web site for Embedded Systems Programming magazine.<br />This site is not specifically oriented to Linux, but is quite useful as a more general embedded information tool.<br /><br /><!--adsense#banner-->Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1154217537013373102.post-77241023991875956402007-04-05T17:39:00.002+07:002010-06-14T16:38:02.018+07:00Understanding Processor Architecture: RISC versus CISCPopular processor designs can be broadly divided into two categories: Complex Instruction Set Computers (CISC) and Reduced Instruction Set Computers (RISC). The dominant processor in the PC market, Pentium, belongs to the CISC category. However, the recent trend is to use the RISC designs. Even Intel has moved from CISC to RISC design for their 64-bit processor.<br /><br />CISC systems use complex instructions. For example, adding two integers is considered a simple instruction. But, an instruction that copies an element from one array to another and automatically updates both array subscripts is considered a complex instruction. RISC systems use only simple instructions. Furthermore, RISC systems assume that the required operands are in the processor’s internal registers, not in the main memory. It turns out that characteristics like simple instructions and restrictions like register-based operands not only simplify the processor design but also result in a processor that provides improved application performance.<br /><br />Several factors contributed to the popularity of CISC in the 1970s. In those days, memory was very expensive and small in capacity. Even in the mid-1970s, the price of a small 16 KB memory was about $500. So there was a need to minimize the amount of memory required to store a program. An implication of this requirement is that each processor instruction must do more, leading to complex instruction set designs. Complex instructions meant complex hardware, which was also expensive. This was a problem processor designers grappled with until Wilkes proposed microprogrammed control in the early 1950s.<br /><br /><center><a href="http://computingfreak.com/weblog/wp-content/uploads/2007/04/mico_prog.gif" title="ISA-level"><img src="http://computingfreak.com/weblog/wp-content/uploads/2007/04/mico_prog.gif" alt="ISA-level" /></a></center><strong>Figure 1</strong>. The ISA-level architecture can be implemented either directly in hardware or through a microprogrammed control.<br /><br />A microprogram is a small run-time interpreter that takes the complex instruction and generates a sequence of simple instructions that can be executed by the hardware. Thus the hardware need not be complex. Once it became possible to design such complex processors by using microprogrammed control, designers went crazy and tried to close the semantic gap between the instructions of the processor and high-level languages. This semantic gap refers to the fact that each instruction in a high-level language specifies a lot more work than an instruction in the machine language. Think of a while loop statement in a high-level language such as C, for example. If we have a processor instruction with the while loop semantics, we could just use one machine language instruction. This explains why most CISC designs use microprogrammed control, as shown in Figure 1.<br /><br />RISC designs, on the other hand, eliminate the microprogram layer and use the hardware to directly execute instructions. Here is another reason why RISC processors can potentially give improved performance. One advantage of using microprogrammed control is that we can implement variations on the basic ISA architecture by simply modifying the microprogram; there is no need to change the underlying hardware. Thus it is possible to come up with cheaper versions as well as high-performance processors for the same family of processors.<br /><br /><strong>References</strong><br /><ul><br /> <li><em>Guide to RISC Processors for Programmers and Engineers</em> by Sivarama P. Dandamudi, Springer (2005), ISBN 0-387-21017-2.</li><br /></ul><br /><!--adsense#banner-->Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1154217537013373102.post-89534855440636470532007-04-03T14:36:00.002+07:002010-06-14T16:39:44.767+07:00ASEM-51 step-by-step Installation on Windows XPLast time I wrote <a href="http://computingfreak.com/2007/04/01/learning-machine-code-with-8-bit-microcontrollers/">an installation for ASEM-51</a>, a two-pass macro assembler for the Intel MCS-51 family of microcontrollers, using the batch file INSTALL.BAT. For someone who do not like anything that is running automatically, or things are not quite clear, here is an step-by-step installation guide for ASEM-51.<br /><br />The files we require are <a href="http://plit.de/asem-51/asem5113.zip">ASEM-51 v1.3 for DOS/Windows</a> (599 kB) and a collection of the latest <a href="http://plit.de/asem-51/mcufiles.zip">MCU files</a> (188 kB).<br /><br />1. Create a new directory on your harddisk, e.g. C:\ASEM51 and unpack all files of the ASEM-51 package into this directory (see Figure 1.).<br /><br /><a href="http://computingfreak.com/weblog/wp-content/uploads/2007/04/asem51folder.gif" title="unpack ASEM-51"><img src="http://computingfreak.com/weblog/wp-content/uploads/2007/04/asem51folder.gif" alt="unpack ASEM-51" /></a><br /><br /><strong>Figure 1.</strong><br /><br />2. Unpack MCUFILES into a directory (see Figure 2). Move the *.MCU you want to C:\ASEM51\MCU (see Figure 3). Here I move the P89V51RD2.MCU only.<br /><br /><a href="http://computingfreak.com/weblog/wp-content/uploads/2007/04/mcufiles.gif" title="mcufiles"><img src="http://computingfreak.com/weblog/wp-content/uploads/2007/04/mcufiles.gif" alt="mcufiles" /></a><br /><br /><strong>Figure 2.</strong><br /><br /><a href="http://computingfreak.com/weblog/wp-content/uploads/2007/04/mcufiles2.gif" title="move mcufiles"><img src="http://computingfreak.com/weblog/wp-content/uploads/2007/04/mcufiles2.gif" alt="move mcufiles" /></a><br /><br /><strong>Figure 3.</strong><br /><br />3. Edit System Variable: Start-->right click on My Computer-->Properties. On System Properties click Advanced Tab then click Environment Variables. On System variables select Path then click Edit and append ;C:\ASEM51 in Variable value (see Figure 4).<br /><br /><a href="http://computingfreak.com/weblog/wp-content/uploads/2007/04/sys_var.gif" title="edit System Variables"><img src="http://computingfreak.com/weblog/wp-content/uploads/2007/04/sys_var.gif" alt="edit System Variables" /></a><br /><br /><strong>Figure 4.</strong><br /><br />4. Define ASEM51INC environment variable: On System variables (from 3) click New the fill Variable name with ASEM51INC and Variable value with C:\ASEM51\MCU (see Figure 5).<br /><br /><a href="http://computingfreak.com/weblog/wp-content/uploads/2007/04/sys_var1.gif" title="add new varible"><img src="http://computingfreak.com/weblog/wp-content/uploads/2007/04/sys_var1.gif" alt="add new varible" /></a><br /><br /><strong>Figure 5.</strong><br /><br />5. Click OK and close all windows.<br /><br />6. You can test by typing <code>asem</code> in Command Shell (Start-->Run-->cmd). You should get something like this (see Figure 6).<br /><br /><a href="http://computingfreak.com/weblog/wp-content/uploads/2007/04/cmd.gif" title="Test ASEM51"><img src="http://computingfreak.com/weblog/wp-content/uploads/2007/04/cmd.gif" alt="Test ASEM51" /></a><br /><br /><strong>Figure 6.</strong><br /><br /><!--adsense#banner-->Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-1154217537013373102.post-50533342009358249122007-04-01T15:34:00.002+07:002010-06-14T16:41:35.941+07:00Learning Machine Code with 8-bit MicrocontrollersTo understand deeply in processor architecture, we have to learn the Machine Code. I decide to select the 8051 microcontroller as a microprocessor model. A microcontroller (or MCU) is a computer-on-a-chip. They integrate many modules on one chip such as RAM, Flash memory, EEPROM, serial ports (UARTs), I²C, Serial Peripheral Interface (SPI), analog-to-digital converters (ADC), clock generator (XTAL) and more.<br /><br />Humans almost never write programs directly in machine code. Instead, they use a programming language which is translated by the computer into machine code. The simplest kind of programming language is assembly language which usually has a one-to-one correspondence with the resulting machine code instructions but allows the use of mnemonics (ASCII strings) for the "op codes" (the part of the instruction which encodes the basic type of operation to perform) and names for locations in the program (branch labels) and for variables and constants.<br /><br /><strong>Installing ASEM-51</strong><br /><br /><a href="http://plit.de/asem-51/introv13.htm">ASEM-51</a> is a two-pass macro assembler for the Intel <a href="http://developer.intel.com/design/mcs51/">MCS-51</a> family of microcontrollers. It is running on the PC under MS-DOS, Windows and Linux. The <strong>ASEM-51</strong> assembly language is based on the standard <strong>Intel</strong> syntax, and implements conditional assembly, macros, and include file processing. The assembler can output object code in <strong>Intel-HEX</strong> or Intel <strong>OMF-51</strong> format as well as a detailed list file. The <strong>ASEM-51</strong> package includes support for more than 180 <a href="http://developer.intel.com/design/mcs51/ov_51.htm" target="_blank">8051</a> derivatives, a bootstrap program for MCS-51 target boards, and documentation in ASCII and HTML format. And it is free ...<br /><br />The simplest way of installing ASEM-51 is copying all files of the package to your working directory, and enjoy the benefits of true plug-and-play compatibility!. Alternatively, I have set it up on Windows XP manually:<br /><ul><br /> <li>Downloads the lastest <a href="http://plit.de/asem-51/download.htm">ASEM-51 for DOS/Windows</a> (currently v1.3)</li><br /> <li>Create a new, empty directory on your harddisk (C:\ASEM51).</li><br /> <li>Unpack your ASEM-51 distribution archive into this directory, or copy all files of the ASEM-51 package into it.</li><br /> <li>Make the scratch directory default, run the batch file INSTALL.BAT provided, and follow the instructions.</li><br /> <li>Reboot your PC.</li><br /></ul><br />You can update MPU file by downloading <a href="http://plit.de/asem-51/mcufiles.zip">http://plit.de/asem-51/mcufiles.zip.</a><br /><br /><strong>References</strong><br /><ul><br /> <li><a href="http://en.wikipedia.org/wiki/Microcontroller">Wikipedia</a></li><br /> <li><a href="http://foldoc.org/foldoc/foldoc.cgi?machine+code">machine code from FOLDOC</a></li><br /> <li><a href="http://mcu-programming.blogspot.com/2006/09/installing-mide-51-and-sdcc-and-for.html">Installing MIDE-51 and SDCC and for Win32</a></li><br /></ul><br /><!--adsense#banner-->Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1154217537013373102.post-52223489614420280642007-03-27T16:21:00.001+07:002010-06-14T16:46:32.559+07:00Understanding Processor Architecture: Simplify Computer ComplexityComputers are complex systems. We study computer systems by using layers of abstraction. We use a hierarchical structure to simplify the management. Each level of management filters out unnecessary details on the lower levels and presents only an abstracted version to the higher-level management.<br /><br />People can look at computer systems from several different perspectives depending on the type of their interaction. We use the concept of abstraction to look at only the details that are necessary from a particular viewpoint. For example, a computer user interacts with the system through an application program. Suppose you are interested in browsing the Internet. Your obvious choice is to interact with the system through a Web browser such as the Fire fox (FF) or Internet Explorer (IE). On the other hand, if you are a computer architect, you are interested in the internal details that do not interest a normal user of the system.<br /><br />From the programmer’s viewpoint, there exists a hierarchy from low-level languages to high-level languages (see Figure 1). At the lowest level, we have the machine language that is the language understood by the machine hardware. Because digital computers use 0 and 1 as their alphabet, machine language naturally uses 1s and 0s to encode the instructions. One level up, there is the assembly language as shown in Figure 1. Assembly language does not use 1s and 0s; instead, it uses mnemonics to express the instructions. Assembly language is closely related to the machine language.<br /><br /><center><a href="http://computingfreak.com/weblog/wp-content/uploads/2007/03/comp_abstract_layer.gif" title="computer abstraction layers"><img src="http://computingfreak.com/weblog/wp-content/uploads/2007/03/comp_abstract_layer.gif" alt="computer abstraction layers" /></a>Figure 1. Abstract layers of Computer Systems<br /><br /></center><strong>References</strong><br /><ul><br /> <li><em>Guide to RISC Processors for Programmers and Engineers</em> by Sivarama P. Dandamudi, Springer (2005), ISBN 0-387-21017-2.</li><br /></ul><br /><!--adsense#banner-->Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1154217537013373102.post-4122818747156934282007-03-26T16:59:00.001+07:002010-06-14T16:50:31.827+07:00Understanding Processor Architecture: ISAA programmer uses the Instruction Set Architecture (ISA) as an abstraction to understand the processor’s internal details. This abstraction suits us very well as we are interested in the logical details of the processor without getting bogged down by the myriad implementation details.<br /><br />The ISA specifies how a processor functions: what instructions it executes and what interpretation is given to these instructions. If these specifications are precise, they give freedom to various chip manufacturers to implement physical designs that look functionally the same at the ISA level. Thus, if we run the same program on these different implementations, we still get the same results. For example, the Intel 32-bit ISA (IA-32) has several implementations including the Pentium processors, cheaper Celeron processors, high-performance Xeon processors, and so on.<br /><br />The ISA-level abstraction provides a common platform to execute programs. If a program is written in C, a compiler translates it into the equivalent machine language program that can run on the ISA-level logical processor. Similarly, if you write your program in FORTRAN, use a FORTRAN compiler to generate code that can execute on the ISA-level logical processor.<br /><br /><strong>References</strong><br /><ul><br /> <li><em>Guide to RISC Processors for Programmers and Engineers</em> by Sivarama P. Dandamudi, Springer (2005), ISBN 0-387-21017-2.</li><br /></ul><br /><!--adsense#banner-->Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1154217537013373102.post-938432124091596712007-01-26T14:08:00.000+07:002007-01-26T14:16:05.847+07:00OpenServoOpenServo is an open community-based project started by Mike Thompson with the goal of creating a low-cost digital servo for robotics. The hardware and software design of the OpenServo is free for anyone to use and modify to meet their particular needs. It is currently being developed by a small group of dedicated individuals striving to maintain the very best in free, open source software and standards. We hope that you will find the OpenServo project interesting and become a member of our community.<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://openservo.com/moin.cgi/FrontPage?action=AttachFile&do=get&target=openservo.jpg"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 320px;" src="http://openservo.com/moin.cgi/FrontPage?action=AttachFile&do=get&target=openservo.jpg" alt="" border="0" /></a><p>The OpenServo is a combination of hardware and software meant to replace the original PCB internal to low-cost analog RC servos such as the <a href="http://openservo.com/moin.cgi/Servo_Futaba_S3003"> Futaba S3003</a> or <a href="http://openservo.com/moin.cgi/Servo_HiTec_HS-311">HiTec HS-311</a></p><br /><p>Some features of the OpenServo include: <span id="line-2" class="anchor"></span></p> <ul><li><p>High performance <a class="http" href="http://www.atmel.com/products/avr/">AVR 8-bit microcontroller</a> <span id="line-3" class="anchor"></span></p> </li><li><p>Compact H-Bridge implemented with low-cost MOSFET drivers <span id="line-4" class="anchor"></span></p> </li><li><p>I2C/TWI based interface for control and feedback <span id="line-5" class="anchor"></span></p> </li><li><p>Control over servo position and speed <span id="line-6" class="anchor"></span></p> </li><li><p>Feedback of servo position, speed, voltage and power consumption <span id="line-7" class="anchor"></span></p> </li><li><p>EEPROM storage of servo configuration information <span id="line-8" class="anchor"></span></p> </li><li><p>Software written in C using free development tools <span id="line-9" class="anchor"></span></p> </li><li><p>I2C/TWI based bootloader and Windows GUI programmer <span id="line-10" class="anchor"></span></p> </li><li><p>Total cost about $20 per servo in quantity ($10 servo hardware + $10 parts) <span id="line-11" class="anchor"></span></p> </li></ul> <span id="bottom_Include_Features" class="anchor"></span> <p>Information can be found on this site regarding <a href="http://openservo.com/moin.cgi/Hardware">Hardware</a>, <a href="http://openservo.com/moin.cgi/Software">Software</a> and <a href="http://openservo.com/moin.cgi/Tools_%26_Utilities">Tools & Utilities</a> to create your own OpenServo.<br /></p>Home page: <a href="http://openservo.com/">http://openservo.com/</a>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-1154217537013373102.post-40975017121626764862007-01-24T10:50:00.000+07:002007-01-24T10:55:17.923+07:00Piklab IDE for PIC and dsPIC microcontrollersPiklab is an integrated development environment for applications based on Microchip <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=74">PIC</a> and <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=75">dsPIC</a> microcontrollers similar to the <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469">MPLAB</a> environment. Support for several compiler and assembler toolchains, programmers, debuggers and simulators is integrated. A command-line programmer and debugger is also available.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://piklab.sourceforge.net/screenshots/piklab_asm_view.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px;" src="http://piklab.sourceforge.net/screenshots/piklab_asm_view.png" alt="" border="0" /></a><br />Piklab home: <a href="http://piklab.sourceforge.net/index.php">http://piklab.sourceforge.net/</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1154217537013373102.post-77913986114661045542006-12-26T19:37:00.000+07:002006-12-26T19:31:45.337+07:00New book explains how to build Linux 2.6 kernels<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://oreilly.com/catalog/covers/0596100795_cat.gif"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 200px;" src="http://oreilly.com/catalog/covers/0596100795_cat.gif" alt="" border="0" /></a>O'Reilly has published a book for Linux users interested in learning to build their own kernels. Linux Kernel in a Nutshell describes how to build and install Linux 2.6 kernels, starting with downloading the source. It was written by well-known kernel hacker Greg Kroah-Hartman.<br /><br />I think, this book is a starting point when you would like to learn the Embedded Linux for a Microcontroller, also the Real Time Operating System.<br /><br /><br /><br /><br /><br /><br /><br /><br />Source: <a href="http://oreilly.com/emails/press/9780596100797.html">http://oreilly.com/emails/press/9780596100797.html</a><br /><br />Buy <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2FLinux-Kernel-Nutshell-OReilly%2Fdp%2F0596100795%2Fsr%3D8-1%2Fqid%3D1166365991%3Fie%3DUTF8%26s%3Dbooks&amp;amp;amp;amp;amp;tag=microcontroll-20&linkCode=ur2&camp=1789&creative=9325">Linux Kernel in a Nutshell</a><img src="http://www.assoc-amazon.com/e/ir?t=microcontroll-20&amp;amp;amp;amp;amp;amp;l=ur2&o=1" alt="" style="border: medium none ! important; margin: 0px ! important;" border="0" height="1" width="1" /> from Amazon.comUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-1154217537013373102.post-19793903579334450312006-12-17T21:21:00.000+07:002006-12-17T21:39:15.346+07:00Eclipse for SDCCAlthough I use <a href="http://www.opcube.com/home.html">MIDE-51</a> as a major IDE, I still seek for the best (free) IDE for developing<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.eclipse.org/eclipse.org-common/themes/Phoenix/images/header_logo.gif"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 200px;" src="http://www.eclipse.org/eclipse.org-common/themes/Phoenix/images/header_logo.gif" alt="" border="0" /></a> Microcontroller Programming. The combination of <a href="http://www.eclipse.org/">Eclipse</a>, <a href="http://www.eclipse.org/cdt/downloads.php"> CDT</a> and <a href="http://eclipse-sdcc.sourceforge.net/">SDCC</a> is an alternation tools for 8051 Microcontroller C Programming.<br /><br /><a href="http://www.eclipse.org/">Eclipse</a> is an open source community whose projects are focused on building an open development platform comprised of extensible frameworks, tools and runtimes for building, deploying and managing software across the lifecycle. Eclipse is used for Enterprise Development, Embedded and Device Development, Rich Client Platform, Application Frameworks and Language IDE.<br /><br />The<a href="http://www.eclipse.org/cdt/downloads.php"> <b>CDT</b></a> is <b>Eclipse's C/C++ Development Tooling</b> project. It is an industrial strength C/C++ IDE that also serves as a platform for others to provide value added tooling for C/C++ developers.<br /><p>The <a href="http://eclipse-sdcc.sourceforge.net/">eclipseSDCC project</a> aims to provide full support for the open source Small Device C Compiler (SDCC) from within the eclipse/CDT development environment. This allows embedded 'C' applications for 8051 and Z80 devices to be developed using the fully featured eclipse IDE. EclipseSDCC supports CDT managed make projects. In managed make projects CDT manages the build process by creating and maintaining the underlaying makefiles. CDT keeps track of source dependencies and can automatically rebuild the target when needed.</p><p style="font-weight: bold;">To install (for Windows)</p><ol><li>It requires <a href="http://java.sun.com/j2se/1.4.2/download.html">Java Runtime Environment (JRE),</a> I download only JRE not SDK and install it.<br /></li><li>Downlaod <a href="http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.2.1-200609210945/eclipse-SDK-3.2.1-win32.zip">Eclipse SDK 3.2.1</a> for Windows (120 MB) and extract it to c:/eclipse. In the directory it contains eclipse.exe which is an executable.</li><li>Download <a href="http://download.eclipse.org/tools/cdt/releases/callisto/dist/3.1.1">CDT 3.1.1</a> (September 29, 2006) and extract it c:/eclipse, this will prompt to replace plugins and features directory.</li><li>If you have already installed <a href="http://sdcc.sourceforge.net/">SDCC</a> for Window, skip this step. If you have no SDCC installed, <a href="http://mcu-programming.blogspot.com/2006/09/installing-mide-51-and-sdcc-and-for.html">read this first</a>.</li><li>Download <a href="http://sourceforge.net/project/showfiles.php?group_id=160896">eclipseSDCC-1.0.0</a>, when you extract the file, it contains plugins and features directory. Copy the two direct to c:\eclipse.</li></ol>Now the installation have been completed and you can find its manual in c:/eclipse/plugins/net.sourceforge.eclipsesdcc_1.0.0/help/index.html.<br /><br />Eclipse for SDCC is quite large when compared it MIDE-51. However, you can manage project in Eclipse whereas MIDE-51 still have no this feature in the present version. Here is a screen shot, you should see this dialog.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi8fS3tcyN5crhXJAMbGrpxGnFr8HV5FFvwYtHP3boCriFP9N6UfKzamsGUkZdkfyFz-8kE7bKJgJKOx3q9bTF2qRXAVJvI45l2OowPXBqInaqjOtYtK9fkIqHNqSoJgNQWdeypq_IHvju/s1600-h/eclipseSDCC.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi8fS3tcyN5crhXJAMbGrpxGnFr8HV5FFvwYtHP3boCriFP9N6UfKzamsGUkZdkfyFz-8kE7bKJgJKOx3q9bTF2qRXAVJvI45l2OowPXBqInaqjOtYtK9fkIqHNqSoJgNQWdeypq_IHvju/s400/eclipseSDCC.gif" alt="" id="BLOGGER_PHOTO_ID_5007979498227860914" border="0" /></a><span style="font-weight: bold;">Related Links</span><br /><ul><li><a href="http://www.cs.umanitoba.ca/%7Eeclipse/1-Install.pdf">Installing Eclipse (pdf)<br /></a></li><li><a href="http://www.cs.umd.edu/class/spring2006/cmsc132/EclipseTutorial/install.html"><span style="text-decoration: underline;">http://www.cs.umd.edu/class/spring2006/cmsc132/EclipseTutorial/install.html</span></a></li></ul>Unknownnoreply@blogger.com23tag:blogger.com,1999:blog-1154217537013373102.post-6723251617905209162006-12-01T16:04:00.000+07:002006-12-01T18:41:18.415+07:00What's coming up, MIDE-51?<a href="http://www.opcube.com/home.html">MIDE-51</a>, by Worapoht Kornkaewwattanakul, is an IDE for MCS-51 microcontroller. The toolchain supports by <a href="http://plit.de/asem-51/home.htm">ASEM-51</a> assembler, SDCC : Small Device C Compiler, TS Controls 8051 Emulator and <a href="http://home.arcor.de/jensaltmann/jsim-e.htm">JSIM-51</a> Simulator (<a href="http://mcu-programming.blogspot.com/2006/09/installing-mide-51-and-sdcc-and-for.html">see installation guide</a>).<br /><br />The current version is 0.2.5.10. The author is working for next major version 0.3.0.0, which supports SDCC multiple files project style. Hopefully, he will finish this version soon.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1154217537013373102.post-35610634675116973122006-11-29T19:18:00.000+07:002006-11-30T14:12:36.327+07:00128KB Flash 8051 MCU from AtmelAT89C51RE2, an 8051 based microcontroller with 128kbyte of flash, has been launched from <a href="http://www.atmel.com/">Atmel</a>. The device is an addition to the existing 16-, 32- and 64Kbyte <a href="http://www.eetasia.com/search/keyword.php?keywords=8051&ACTION_TYPE=SEARCH&operation=PHRASE&search_mod=advanced&section=ALL&encode=1&sub_form=quickform" target="_blank">8051</a> flash family of AT89C51RB2/RC2/RD2/ED2 MCUs. This new chip offers 8kbyte of ram, two UARTs, watchdog timer, power<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.newelectronics.co.uk/articles/8092/atmel%20flash2.jpg"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 200px;" src="http://www.newelectronics.co.uk/articles/8092/atmel%20flash2.jpg" alt="" border="0" /></a> on reset, power fail detector and up to 50 general purpose I/Os. Suited to industrial and consumer applications, the AT89C51RE2 can operate from 2.7 to 5.5V and achieves a 4MIPS throughput when running at 40MHz.<br /><br />A key feature is the on chip debug capability that enables low cost emulation. The hardware debug system with Windows IDE interface allows the user to access debugging functions built into the AT89C51RE2 resulting in faster development and verification of user code in real time.<br /><p>The AT89C51RE2 is available in 44-pin PLCC and VQFP packages at $4.80 for 10,000 units. </p><p>Atmel offers the AT89STK-11, a starter kit for $99, to evaluate the AT89C51RE2; designers can either run the demonstration program or their own application. A new low-cost on-chip debug tool, AT89OCD-01 will be available by the end of November 2006.<br /></p>Source: <a href="http://www.newelectronics.co.uk/article/index.aspx?articleid=dm7leIJx2YQXad3fKT6kjnowyzvkHye3Hirc9Te3MooA">www.newelectronics.co.uk </a> and <a href="http://www.eetasia.com/ART_8800443675_1034362_89b3843720061129.HTM?from=RSS">www.eetasia.com</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1154217537013373102.post-82018289194220793422006-11-28T14:28:00.000+07:002006-11-28T14:27:34.878+07:00Low-cost ARM7TDMI Evaluation Board based on STR730FZ2T6<span class="main"><a href="http://www.armkits.com/product/STDV730F.asp">Embest</a> announced the availablity of the STDV730F, a low-cost development board based on STR730FZ2T6, ARM7TDMI 32-BIT processor from STMicroelectronics.<br /></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.armkits.com/product/images/stdv730.gif"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 260px;" src="http://www.armkits.com/product/images/stdv730.gif" alt="" border="0" /></a><br /><span class="main"><span style="font-weight: bold;">Features</span></span><span class="main"><span style="font-weight: bold;"></span><br /></span><ul><li><span class="main">256 Kbytes of flash</span></li><li><span class="main">16 Kbytes of RAM<br /></span></li><li><span class="main">up to 16-channel 10-bit ADC</span></li><li><span class="main">20 timers<br /></span></li><li><span class="main">4xUARTs<br /></span></li><li><span class="main">3xCANs<br /></span></li><li><span class="main">SPI<br /></span></li><li><span class="main">I2C<br /></span></li><li><span class="main">DMA<br /></span></li><li><span class="main">RTC<br /></span></li><li><span class="main">PWM<br /></span></li><li><span class="main">112 GPIO</span></li></ul><span class="main"><br />The board integrates a 2x16 LCD, LEDs, UART, CAN interface, buzzer, test buttons and Jtag interface to create a versatile stand-alone test platform. The board itself is provided with plenty of example</span><span class="main"> programs to help you startup with your design quickly.<br /></span> <span style="font-family:verdana;"> <br /> <b>Source: </b><a href="http://www.embedded-computing.com/news/db/?4707">www.embedded-computing.com</a><br /><br /></span>Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-1154217537013373102.post-58086577079593562152006-11-27T17:25:00.000+07:002006-11-27T17:35:18.972+07:00ARM offers OpenMAX DL, free video codec software library<span class="noindex"><span id="ArticleBody">ARM has made the source code for its sample implementation of OpenMAX DL (Development Layer) audio and video codec software library <a href="http://www.arm.com/products/esd/openmax_home.html">freely available for download</a> from the company’s website. </span></span><span class="noindex"><span id="ArticleBody">ARM’s sample OpenMAX DL software library provides source code written in C for easy platform portability and code readability.<br /><br /></span></span>OpenMAX is a royalty-free, cross-platform API developed by the <a class="inlinelink" href="http://www.khronos.org/">Khronos Group</a> that provides a comprehensive media codec and application portability by enabling accelerated multimedia components to be developed, integrated and programmed across multiple operating systems and silicon platforms. <a class="inlinelink" href="http://www.khronos.org/openmax/">[OpenMAX]</a><br /><span class="noindex"><span id="ArticleBody"><br /></span></span><span class="noindex"><span id="ArticleBody">ARM said it plans to create a series of libraries including an implementation that will take full advantage of the ARMv6 architecture found in the ARM11 family and an implementation for the NEON signal processing technology found in the Cortex-A8 processor.<br /><br />Source: <a href="http://www.electronicsweekly.com/Articles/2006/11/24/40231/arm-offers-video-codec-software-library-free-on-the-web.htm">www.electronicsweekly.com</a><br /></span></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1154217537013373102.post-63425068663854037962006-11-26T12:29:00.000+07:002006-11-28T14:30:56.214+07:00A Real-Time Operating System (RTOS) for the 8051A <b>real-time operating system</b> (<b>RTOS</b>) is a class of <a href="http://en.wikipedia.org/wiki/Operating_system" title="Operating system">operating system</a> intended for <a href="http://en.wikipedia.org/wiki/Real-time_computing" title="Real-time computing">real-time</a> applications, including <a href="http://en.wikipedia.org/wiki/Embedded_system" title="Embedded system">embedded systems</a> (programmable thermostats, household appliance controllers, <a href="http://en.wikipedia.org/wiki/Mobile_telephones" title="Mobile telephones">mobile telephones</a>), industrial <a href="http://en.wikipedia.org/wiki/Robot" title="Robot">robots</a>, spacecraft, industrial control (see <a href="http://en.wikipedia.org/wiki/SCADA" title="SCADA">SCADA</a>), and scientific research equipment [<a title="wikipedia" href="http://en.wikipedia.org/wiki/Real-time_operating_system">wikipedia</a>]. It is an advance topic in Microcontroller and Embedded Systems.<br /><br /><a title="FreeRTOS.org" href="http://www.freertos.org/">FreeRTOS.org</a><small><sup>TM</sup></small> is a portable, open source, mini Real Time Kernel - a free to download RTOS. It have been ported to support several microcontroller architectures - ARM7, ARM CORTEX M3, 8051, AVR (MegaAVR), x86, PIC18, PIC24, dsPIC, HCS12, H8S, RDC, ColdFire. FreeRTOS is licensed under a modified GPL and can be used in commercial applications under this license.<br /><br />For the 8051, this RTOS have been ported to Cygnal (Silicon Labs) 8051. This is the starting point for anyone who would like to study the Operating System and Embedded Design on 8051. The Cygnal port was developed on a <a href="http://www2.silabs.com/tgwWebApp/appmanager/tgw/tgwHome;jsessionid=BFHyzNLJHjgvy4xYJRfsTXP5GptQvtG4DmPsvNQG1zndv1T2Jc9P%211832090486?_nfpb=true&_pageLabel=GenericContentPage&contentObjectId=/public/web_content/products/Microcontrollers/en/C8051F120TB.htm">C8051F120-TB</a> prototyping board fitted with a <a href="http://www2.silabs.com/public/documents/tpub_doc/dsheet/Microcontrollers/Precision_Mixed-Signal/en/C8051F12x-13x.pdf">8051F120</a> microcontroller. The freeware <a href="http://sdcc.sourceforge.net/">SDCC</a> compiler was used along with the Cygnal IDE.<br /><br /><span style="font-weight: bold;">Building and executing the RTOS demo application</span><br /><br />After downloads the <a title="freeRTOS source file" href="http://sourceforge.net/project/showfiles.php?group_id=111543&package_id=120544">freeRTOS source file</a> (.exe or .zip), I extract the file to C:\FreeRTOS. The demo application for Cygnal 8051 is located in C:\FreeRTOS\Demo\Cygnal. To compiler this demo, it is require <a href="http://sdcc.sourceforge.net/">SDCC</a> (<a title="see how to install" href="http://mcu-programming.blogspot.com/2006/09/installing-mide-51-and-sdcc-and-for.html">see how to install</a>) and <a title="GNU make" href="http://unxutils.sourceforge.net/">GNU make</a>. For Gnu make, I download <a href="http://unxutils.sourceforge.net/UnxUtils.zip">UnxUtils.zip</a> then extract it to C:\UnxUtils and finally edit PATH to C:\UnxUtils\usr\local\wbin (<a title="see how to edit path on 2000 and XP" href="http://www.computerhope.com/issues/ch000549.htm">see how to edit PATH on 2000 and XP</a>). In DOS Command Shell, change directory (cd) to C:\FreeRTOS\Demo\Cygnal and type make, the final product is main.ihx which the demo real time application for Cygnal 8051. However. the size of this file is quiet big, 72k. I have succeed compiling with SDCC 2.5.x but failed for SDCC 2.6.x.<br /><br />In the conclusion, The demo application of the opensource freeRTOS have been ported to Cygnal 8051 which contains the demonstration source code. This is an avenue to learn the Real Time Operating System for the others 8051 chip.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-1154217537013373102.post-79806185521400561992006-11-21T18:24:00.000+07:002006-11-22T12:15:50.590+07:00A Simulator for P89V51RD2The Philips' <a href="http://mcu-programming.blogspot.com/2006/09/philips-p89v51rd2-microcontroller.html">P89V51RD2</a> is a 80c51 microcontroller which provides a set of powerful features:<br /><ul><li>Timer/Counter 2</li><li>PCA (Programmable Counter Array)</li><li> Watchdog timer</li></ul><a href="http://mcu-programming.blogspot.com/2006/11/ucsim-8051-simulator-for-sdcc.html">uCsim</a>, the 8051 simulator for SDCC, supports various types of 8051 family and one of them is 89C51R. I think it close to the features of P89V51RD2 microcontroller as mentioned above.<br /><br />To use, enter this commands:<br /><code></code><pre><br />$s51 -t 89c51r<br /></pre><br />which prompt you to uCsim command shell. You can view the special modules supported by uCsim by enter this in the uCsim shell:<br /><code></code><pre><br />0>conf<br />ucsim version 0.5.4<br />Type of microcontroller: 89C51R CMOS<br />Controller has 13 hardware element(s).<br />timer0[0]<br />timer1[1]<br />uart[0]<br />port[0]<br />port[1]<br />port[2]<br />port[3]<br />irq[0]<br />_51_dummy[0]<br />timer2[2]<br />wdt[0]<br />pca[0]<br />_89c51r_dummy[0]<br /></pre><br />Although this simulator is based on command line, it is free and powerful for the modern 8051 chips.<br /><br />uCsim home: <a href="http://mazsola.iit.uni-miskolc.hu/%7Edrdani/embedded/s51/">http://mazsola.iit.uni-miskolc.hu/%7Edrdani/embedded/s51/</a><br /><br /><a href="http://mazsola.iit.uni-miskolc.hu/%7Edrdani/embedded/s51/"> </a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1154217537013373102.post-88042347450411363612006-11-15T19:04:00.000+07:002006-11-15T19:35:03.712+07:00Installing SDCC on Fedora Core 6I have upgraded my Linux to the latest version <a href="http://fedora.redhat.com/">Fedora Core 6</a>. This version come with linux kernel 2.6.18 and gcc v4.1.1. I don't hesitate to install the SDCC to work on it. After I downloaded the latest of <a href="http://sdcc.sourceforge.net/snap.php#Source">SDCC source</a>, sdcc-src-xxx-xxx.tar.bz2, I installed it with this command:<br /><pre>$tar -xvfz sdcc-src-xxx-xxx.tar.bz2<br />$cd sdcc<br />$./configure --prefix=/usr<br />$make<br />$make install<br /></pre>If it succeed, you should have these directories:<br />/usr/bin for execute files<br />/usr/share/sdcc/doc for documentation<br />/usr/share/sdcc/include for header files<br />/usr/share/sdcc/lib for libraries<br /><br />I tested it with this simple code, I edited with gedit:<br /><code></code><pre><br />#include <8051.h><br />void min() {<br />unsigned char var_1;<br />var_1 = 0xFF;<br />}<br /></pre><br />then saved it, let say test.c. To compile I use this command:<pre>$sdcc test.c<br /></pre>and I found the test.ihx file in that directory which is the expected output.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1154217537013373102.post-78902193971585510712006-11-10T15:25:00.000+07:002006-11-10T17:35:53.179+07:00uCsim: the 8051 simulator for SDCC<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://mazsola.iit.uni-miskolc.hu/%7Edrdani/embedded/s51/UCsim.jpg"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 200px;" src="http://mazsola.iit.uni-miskolc.hu/%7Edrdani/embedded/s51/UCsim.jpg" alt="" border="0" /></a><a href="http://mazsola.iit.uni-miskolc.hu/%7Edrdani/embedded/s51/">uCsim</a> is a microcontroller simulator for SDCC. It is free and opensource under GNU GPL. Currently it supports MCS51 family. AVR core, Z80, HC08 and XA are supported by UNIX version only.<br /><br />For the 8051, the recognized types are: 51, 8051, 8751, C51, 80C51, 87C51, 31, 8031, C31, 80C31, 52, 8052, 8752, C52, 80C52, 87C52, 32, 8032, C32, 80C32, 51R, 51RA, 51RB, 51RC, C51R, C51RA, C51RB, C51RC, 89C51R, 251, C251, DS390, DS390F.<br /><br />uCsim is available for two platforms: DOS (MCS51 only) and UNIX but DOS version is not supported any more. DOS version is not finished so I call it demo version and it is available in binary only. Limitations of DOS version are: <ul><li>There is no built in help available; </li><li>Some of the utilities are not working, for example calculator, bit simulator; </li><li>Serial line works in mode 1 independently of mode bits.</li></ul>If you are using the latest version of SDCC on Windows, uCsim is already in your hand (C:\Program Files\SDCC\bin). If you have not installed it yet, <a href="http://mcu-programming.blogspot.com/2006/09/installing-mide-51-and-sdcc-and-for.html">please see my installation guide</a>.<br /><br /><br /><span style="font-weight: bold;font-size:130%;" >Starting the Simulator</span><br /><br />There are separate programs to simulate different microcontroller families: <p>MCS51 family is simulated by <b>s51</b><br />AVR family is simulated by <b>savr</b><br />Z80 processor is simulated by <b>sz80</b><br />XA family is simulated by <b>sxa</b><br />HC08 processor is simulated by <b>shc08</b> </p><p>The program can be started using following command:</p><p><tt>C:\> s51 [input file]</tt> </p>Parameter is optional. If it specified it must be the name of an Intel hex file.<br /><br />For more details, <a href="http://mazsola.iit.uni-miskolc.hu/%7Edrdani/embedded/s51/">please see its documentation</a>. This is an overview and I will write about this simulator later.Unknownnoreply@blogger.com0