What are ARM microcontrollers

First ARM microcontrollers I have tried was LPC2148. This is part of LPC2000 NXP 16/32-bit MCU family. The microcontroller I mentioned above is based on ARM7 core, which is based on RISC architecture.  ARM7 sometimes called ARM7TDMI is widely used ARM core variant. Many digital equipment like mobile phones, digital cameras, printers uses ARM7 microcontrollers.ARM7 is a 3 volt 32 core with Thumb 16-bit compressed instruction set. ARM7 can work at clock rates up to (and sometimes over) 100MHz. ARM core works using: 3-stage pipelining;32/16 bit RISC architecture(ARM/THUMB instruction set);64 bit result multiplies;EmbeddedICE system debugging via JTAG interface;low power; It is really simple architecture and you don't even to be a prof of ARM architecture to start working with. Almost all developers now are developing applications using high level languages like C. Compilers are dealing with hardware routines that you don't always need to care about. ARM microcontrollers are easy and fun to learn as they have some properties that you wont find in AVR microcontrollers or in MSC51 architecture. Few of them are: shaded Registers for different operation modes,  conditionally executed instructions, ARM/THUMB instructions for 32/16 instruction sets, memory acceleration (MAM), clock source programming, vectored interrupts and many more.…

Continue reading

Prepare GNUARM compiler toolchain for Windows

GNUARM is a toolchain for developing ARM microcontroller projects based on open source compiler GCC. GNUARM works on windows (requires Cygwin), Linux and MacOS. GNUARM doesn’t have any GUI, but you can adapt any GUI that supports commands from command line. One of good project is WinARM where you get all tools needed in one package. Thiswill be discussed later. GNUARM package consists of the GNU binutils, GCC compiler set and debugger (Insight for Windows and Linux, GDB only for MacOS). Newlib is used for the C library. With GNUARM yo uhave ability compile C and C++ programs.

Continue reading

Using LPC2000 flash ISP utility to program LPC2148

As I earlier was writing about my home made ARM7-Base development board for LPC2148 It is time to write few words on how to use LPC2000 flash ISP utility. LPC2000 flash utility is a software which is used to program LPC2000 series ARM microcontrollers: LPC2101, LPC2102, LPC2103, LPC2104, LPC2106, LPC2106, LPC2114, LPC2114, LPC2119, LPC2124, LPC2129, LPC2131, LPC2132, LPC2134, LPC2136, LPC2138, LPC2141, LPC2142, LPC2144, LPC2146, LPC2148, LPC2194. Programming is done through serial port. As you probably know, the LPC2000 series microcontrollers comes with boot-loader built in. This bootloader provides ISP interface for programming Flash or Ram memories and other operations like erasing. Bootloader is located in upper 8kB flash memory. Bootloader has an algorithm which detects incoming ISP connection, detects baud rate automatically. When starting ISP after reset P0.14 has to be pulled down what means that microcontroller is ready to accept ISP commands. Otherwise keep P0.14 pin pulled high to avoid unintended ISP entry. Lets take a look at main screen of LPC2000 flash utility: The program has very intuitive screen. First thing what you have to do is to power up your target board, connect serial cable to your computer. Then in a screen select COM port number and…

Continue reading

ARM Development Tools

https://www.arm.com/ Professional information about ARM microcontrollers; https://www.codesourcery.com/gnu_toolchains/arm.html develops improvements to the GNU Tool-chain for ARM processors and provides regular, carefully tested, pre-compiled releases of the GNU Tool-chain; https://www.EmbeddedArtists.com/ Ships pre-setup GCC build environment with all their Quick-Start Boards/Kits; https://www.embedinfo.com/ Embest IDE for ARM, include Compiler,debugger,editor,project manager,flash programmer,JTAG Emulator, Low cost; https://www.iar.com/ Embedded Workbench for ARM7,9,11 C/C++ compiler; https://www.keil.com/ IDE,Debugger,Simulator which work with GNU, ADS/RealView, and Keil CARM Compiler; https://www.billgatliff.com/ Introduction to GNU tools on ARM https://www.ghs.com/ Green Hills Multi 2000 Compiler suite,JTAG probes, Integrity RTOS; https://www.rowley.co.uk/ ARM, MSP430 tools for Windows and Linux https://www.metrowerks.com/ ARM tools to compile Linux from Windows https://www.modularcircuits.com/gcc_arm.htm GCC 3.3.1 for ARM targets, compiled under MinGW. https://www.aeolusdevelopment.com/ Newlib porting layer for LPC210X https://www.gnuarm.com/ GCC tools for ARM, precompiled for Cygwin, Linux and MacOS https://www.forth.com/Content/Products/SwiftX/SwiftX.htm Forth for embedded ARM systems https://www.mpeltd.demon.co.uk/forth6.htm Forth for embedded ARM systems; https://www.lpc2106.com/ SBCs, C-Compiler, Development-Kits; https://rod.info/arm.html GNU tools (binutils, GCC, newlib and Insight/GDB) build script and tarballs for Linux; https://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/ The gnu-toolchain and several tools and samples for ARM controller/processors for MS-Windows-Platforms supported by Martin THOMAS.

Continue reading

Building embedded software using algorithm flow charts

Embedded software consists of various functions performing particular tasks. Before writing any ASM or C code it is good to draw algorithm flow chart. Flow charts are visual method of representing inner algorithm. It is easer analyze the algorithm and write the code according to diagram. The main parts of diagram: Fig 1. Simple series instructions Fig 2. Parallel instructions Fig 3. if-then-else structure Fig 4. while (for) structure Fig 5. do until structure Fig 6. case structure For each function or procedure make separate algorithm flow charts – this enables easer integration of them in to main function. Sample how program flow chart may look. Fig 7. Sample program Flow Chart

Continue reading

RTC example on ARM7 LPC2148 using WinARM

Finally got my LPC2148 RTC working on my development board. arm7 base development board for lpc2148 I am quite new to ARM microcontrollers, so I managed to make few tests using them by driving some peripherals and writing some test routines. First code I tried was simple LED blink program first lpc2148 arm7 microcontroller test led blink This one is running microcontrollers real time clock (RTC) and generating interrupts every second. When Interrupt occurs microcontroller sends particular message to UART that I could see via Terminal program. The main program: /****************************************************************************** * * WinARM RTC application * * – UART0 send in Interrupt-Mode * – Sends message every seccond. * – RTC interupt every second ******************************************************************************/ #include “types.h” #include “LPC214x.h” #include “config.h” #include “armVIC.h” #include “uart.h” uint32_t time_toggle=0; static void rtc0(void) __attribute__ ((interrupt (“IRQ”))); static void lowInit(void) { // set PLL multiplier & divisor. // values computed from config.h 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 = PIO0_ZERO_BITS; // clear the ZEROs output IO0SET = PIO0_ONE_BITS; // set the ONEs output…

Continue reading

Microcontroller eats too much of RAM

All you know that microcontrollers have limited amount RAM and EEPROM. For instance ATMega128 has 4-Kbytes of RAM, 4-Kbyte of EEPROM. This may seem quite enough for some applications, but more complicated routines require more of RAM. And there is no compiler that can do better optimization on usage of ram than programmer. The main aim of reaching this is reducing dependence on global data, stack and the heap. So if your application running in microcontroller eats too much of RAM then you should develop some strategy of using its RAM. Lets see… if you use constants as global values, why not to move them to EEPROM area? You can easily do this by compiler when you declare your variables by using const keyword: const uint8_t a=10; I compiled some code using this declaration and compiler (AVR-GCC) compiled .eep file which can be burned to microcontrollers EEPROM. In this way you can store your constants to your EEPROM memory. Another factor eating microcontroller RAM is stacks. Try to use us much stack as your program require and leave some reserved space just in case. There are many techniques that can help define requirement of stack memory. One of them is…

Continue reading