ATmega32
Programming In assembly
Using OS on ATmega32
Few Links
Back
Home

Some OS for ATmega32


    AVRX : A very small Operating system for AVR series, originally designed for 8K flash processors

AVRX

Download the latest Version. Old versions were compatible with Mega series processors. Even the Latest one avrx2.6e needs some changes to get it working for ATmega32. The main cause of problem lies not with AVRX but with change of some specification in Mega series like 16 bit registers.


Compiling avrx for ATmega32

  • Unzip it
  • Enter avrx directory. A thing to be kept in mind is that Makefiles etc are made in windows environment and there are no utilities like autoconf for configuring the Makefile. One needs to edit them Manually. Change the ABSPATH variable to point to current directory (My case i am working in /root/tinyosdownload/OS/avrx). Change the Microcontroller name, type etc. (My makefile)
  • Another very important change is needed in serialio.s file. Here in function InitSerialIO some changes are required.

    My InitSerialIO looks like this:

    _FUNCTION(InitSerialIO)
    InitSerialIO:
    ;out _SFR_IO_ADDR(UBRR), p1l
    out UBRRL, p1l
    #if defined(UBRRH)
    sts UBRRH, p1h // THIS appears to be a no-op
    #endif
    #if defined(UCSR0C)
    ldi tmp0, UCRC_INIT // SET word length.
    sts UCSR0C, tmp0 // Extended register in mega128
    #endif
    ldi tmp0, UCR_INIT
    ;out _SFR_IO_ADDR(UCR), tmp0
    out _SFR_IO_ADDR(UCR), tmp0
    out (UCR), tmp0
    ret
    _ENDFUNC
    (my serialio.s)

  • This would allow you to compile the avrx libraries. For compiling some examples. go to the examples directory. Here again edit the makefile (my makefile). Here we also need to exclude the building of elf files which may be required in windows environment. In hardware.h file one variable (TMC8_CK256) is to be defined.I have added this code to do that.

    #define TMC8_CK256 (1<<CS02)

    After this compiling the Examples using # make gcc, may produce this error

    In file included from Timers.c:13:
    ../avrx/avrx.h:80:24: iomacros.h: No such file or directory


    I don't know if it is required at all. In my case i removed the iomacros.h form avrx/avrx.h and recompiled the library files.
    Also at many places you may find error like this

    Messages.c:17:18: Avrx.h: No such file or directory

    Go to the line specified and change the case from Avrx.h to avrx.h. Since the author developed the code on windows the cases were transparent to him, but Linux is case sensitive. After this code should compile without any problem. Download the hex file on the micro controller. They would run perfectly.







  • Udayan Kumar [udayan_kumar[at]da-iict[dot]org] 2005-2006, All Rights Granted (8/02/2005).
    eXTReMe Tracker