What are differences between WinARM and WinAVR

Everyone who is working with AVR microcontrollers knows this powerful tool – WinAVR which is completely open source and does the job comparable to commercial. It already has many routine tasks included in package that you don't need to worry about. So when shifting to ARM7 microcontrollers it is logical to try WinARM as nice alternative to WinAVR. WinARM tools are collected by Martin Thomas and put in one distribution package ready to use under Windows platform.

But in fact these tools are very different despite there is same GCC compiler used. First of all WinAVR is targeted to one manufacturer(ATMEL) AVR microcontrollers. One core allows to robust many routine tasks as RAM, ROM defining. WinARM targets various manufacturers who produce microcontrollers with ARM core which may vary in type.

LPC2000 watchdog timer

As in all microcontrollers watchdog timers purpose isto reset microcontroller after reasonable amount of MCU error time. If watchdog is enabled and if after some time watchdog timer doesn't reload due correct program flow, then it generates a system reset.

Watchdog unit consists of four registers:

  • WDMOD – Watchdog mode register where is watchdog mode and status saved. There are three watchdog modes available in LPC2000: Debug mode – allows to debug code with watchdog active but without WD reset; Watchdog Interrupt mode – generates interrupt when WD timer overflows; Watchdog Reset mode – reset MCU when WD timer overflows.

  • WDTC – Watchdog timer constant register where time out value is saved. Timeout value can be determined by formula: Period=Pclk·WDTC·4. While WDTC value can be in range from 256 to 2^32, then timeout when Pclk=60MHz can vary from 17.066us to 5min.

  • WDFEED – watchdog feed sequence register. Writing 0xAA followed by 0x55 wil reset Watchdog to WDTC value.

  • WDTV – watchdog timer value register holds current watchdog timer value which can be read.

JTAG wiggler clone for ARM microcontrollers

The Olimex ARM JTAG clone is well known as there are many schematics in the internet available. Circuits is very simple and seems to be reliable. This adapter can be also set up to work with WinARM tools: ocdremote and gdb/Insight-gdb.

In the circuit there is a critical part that needs to be considered – 74HC244 buffer IC. Family of HC support less than 4.8V if powered with 3.3V. But reality shows that Parallel port voltage usually is lower than 5V, so HC will fit. But of course it is better to measure the HIGH state of parallel port pins.

Real time clock of LPC2148

LPC2000 series of microcontrollers have built in Real Time Clock(RTC) unit which is may be used for counting time in order to maintain a calendar and clock. RTC is designed for low power designs that enables to use in battery powered designs. Real time clock is capable to count time in Seconds, Minutes, Hours, Days of Month, Months, Years, Days of the week and Days of Year. Real time module can be clock using distinct 32kHz clock oscillator or internal prescaller from VPB clock. Real time clock unit has additional power supply pins(3.3V) what allows RTC clock to work when system is off – actually power down mode operated from clock battery.

As there are many functions in clocks like time units(seconds, minutes, etc,) and alarms, there are quite a number of registers to cover clock functionality. There are several groups of registers:

Pulse Width Modulator in LPC2000 ARM7 MCU

In ARM7 microcontrollers PWM is designed as separate module but it has all features as a general purpose timers have, just limited pins are associated. PWM module have improved match module which allows to have six channels of single edge controlled PWM or three double edge controlled PWM. There are seven match registers used with improved update logic. PWM modulator have additional shadow match registers that perform latch effect. This means that you can update match registers on instantly, but new values are taking effect only at the beginning of new cycle. This mechanism ensures that all updates are performed at he beginning of a new cycle through latch enable register(LER). In general purpose timers match registers take effect immediately after they are updated.

Pages

Subscribe to ARM GCC tutorial RSS

Who's online

There are currently 0 users online.