Increase microcontroller code efficiency

C compilers are getting more and more advanced, but there is always a trade off made between speed and code size. Compiled code can be faster or smaller but not both. So you have to choose which part is more important speed or code size. The Increase of microcontroller code efficiency can be done in many ways. Don’t trust compiler optimization features, as they might not bee as effective as you expect. It is better to grab some profiler and inspect what parts of your code takes the most time and size. It is better to follow some techniques that may reduce code execution time and increase microcontroller code efficiency:

Continue reading

First LPC2148 ARM7 microcontroller test – led blink

This is simple led blinking routine using my development board. The compiler I used was WINARM. I like this compiler because its free and adaptation is easy while the same functionality is in WINAVR. This simple test just blinks pin 16 of port 0. This I used when I first got to know ARM microcontroller. Here is the main code: /************************************************* * WinARM Demo P0.16 blink **************************************************/ #include “types.h” #include “LPC214x.h” #include “config.h” #include “armVIC.h” #define IOPINS016 16 static void lowInit(void) { // set PLL multiplier & divisor. // values computed from config PLLCFG = PLLCFG_MSEL | PLLCFG_PSEL; // enable PLL PLLCON = PLLCON_PLLE; PLLFEED = 0xAA; // Make it happen. These two updates PLLFEED = 0x55; // MUST occur in sequence. // setup the parallel port pin IO0CLR = (1< IO0SET &= ~(1< IO0DIR =(1< // wait for PLL lock while (!(PLLSTAT & PLLSTAT_LOCK)) continue; // enable & connect…

Continue reading

Philips introduces advanced Hi-Speed USB microcontrollers

Royal Philips Electronics introduced the LPC2800 series – the industry’s most advanced ARM-based Hi-Speed USB microcontrollers on the market. The Philips LPC2800 is the first ARM7 MCU to deliver USB 2.0 device capabilities with maximum standard compliance and an on-chip Hi-Speed 480 Mbits/sec transceiver, and the first to enable single battery cell operation. These unique features allow embedded system design engineers to incorporate new capabilities into products such as PC peripherals, SD memory cards, smart card readers, and other USB battery-powered devices – all at a competitive price point. More at www.semiconductors.philips.com

Continue reading

ARM7 Development Tools

The development Software Keil for architecture ARM7 TDMI support the following devices ARM7: Atmel, Philips and Analog Devices, Sharp, OKI, ST Microelectronics. Instrument for ARM consist of the following parts: – CAARM Compiler/Assembler Kit Contains AARM Assembler, ARM Utilities, CARM Compiler, LARM Linker/Locator and the integrated medium of the development of Вµ.Vision IDE, which accomplishes complete control Compiler, Assembler; – PKARM – Professional Developer’.s Kit Includes all components CAARM plus of Вµ.Vision Debugger, which supports the complete simulation of devices and OS of the real time RTXA-Tiny; – DKARM Developer’s Kit – is included the integrated medium of the development of Вµ.Vision IDE and ВµVision Debugger; – Ar- ARM advanced Rtx- ARM the operating system of the real time Keil Rtx-ARM, which includes Flash File System and support TCP/IP Networking; – ULINK – adapter Usb-jtag for the connection of interface JTAG ARM7 to port USB of personal computer. Keil ARM…

Continue reading

GNUARM for ARM microcontrollers

In this article you’ll find some information about how to configure GNUARM toolset for compiling ARM7 microcontrollers. GNUARM is the open source toolset for ARM7 MCUs. It has GCC compiller and debugger. Our purpose now is to set up tools in Windows environment and compile one project. First of all download compiled toolset from http://www.gnuarm.com: Select the newest [GCC-4.0 toolchain] located bellow Cygwin. After it is downloaded, start the installation: 1. Start window 2. Accept license agreement. 3. Select folder where do you want GNUARM to be installed: 4. Select the components. You can select all of them. 5. Chose Start menu folder name – just leave as it is. 6. Select desktop shortcut to be placed. I higly recoment to check Cygwin DLL, because despite I had cygwin installed, but I had to copy DLLs to copy manually. If this option ischecked, DLL files will be copied without bothering…

Continue reading

ARM7-Base development board for LPC2148

After ARM mini board for LPC2148 is created its time to develop development board. I want to make board as universal as possible. So I decided to put I2C, SPI, COM and JTAG on board. I decided to use external voltage adapter as there is needed 5V and 3.3V DC sources. For my experiments I can use those voltages straight from PC source. 5V there is used to supply MAX232IC.I decided to use it instead of MAX3232 because it is easer to get them in market. Of course I left ability to use and MAX3232 by changing jumper. All other free pins I made accessible by adding pinheads in board. I made 100x100mm double sided PCB PCB Bottom image PCB top image (when printing – use mirror function) And real world images. PCB Bottom Completed soldered board with ARM mini board on top. And of course I put Eagle3D traced…

Continue reading

ARM7 LPC2148 mini board

One day I’ve got ARM LPC2148 chip in my hands. The Philips LPC2148 is an ARM7TDMI-S based high-performance 32-bit RISC Microcontroller with Thumb extensions 512KB on-chip Flash ROM with In-System Programming (ISP) and In-Application Programming (IAP), 32KB RAM, Vectored Interrupt Controller, Two 10bit ADCs with 14 channels, USB 2.0 Full Speed Device Controller, Two UARTs, one with full modem interface. Two I2C serial interfaces, Two SPI serial interfaces Two 32-bit timers, Watchdog Timer, PWM unit, Real Time Clock with optional battery backup, Brown out detect circuit General purpose I/O pins. CPU clock up to 60 MHz, On-chip crystal oscillator and On-chip PLL. Looks like it can be powerful thing in good hands. I decided to test its power, so I needed development board, which could I use for my experiments. Because I wanted to have more universal board, so I faced few problems – PCB tracing. My purpose was to…

Continue reading