why doesnt this code work on my AT91RM9200 (newbie)

From: funkymunky (prehistorictoad2k_at_yahoo.com)
Date: 12/31/04


Date: 31 Dec 2004 04:16:10 -0800

Hi,

Im an undergrad student, and a newbioe to the ARM. Im working on a
board based on the AT91RM9200 uC. Im relying on the default boot
program, and im using the xmodem protocol to load the foll. program
thru hyperterminal. Im just sending a nibble to the I/O pins, expecting
to verify the effect with a multimeter. but this isnt working:

#include <stdio.h>
int main()
{
__asm
{
start:MOV r1, #0xFFFFF800 //PIO C
MOV r0,#0xF //only the last 4 pins needed
STR r0, [r1] //send to PIO_PER
MOV r0, #0
STR r0, [r1, #0x4] //send to PIO_PDR
MOV r0, #0xF //output enabled on last 4 pins
STR r0, [r1, #0x10]//send to PIO_OER
MOV r0, #0
STR r0, [r1, #0x14] //send to PIO_ODR
MOV r0, #0xF //sync output on last 4 pins
STR r0, [r1, #0xA0] //send to PIO_OWER
MOV r0, #0
STR r0, [r1, #0xA4] //send to PIO_OWDR
MOV r0, #0xA
STR r0, [r1, #0x38] //send this to the pins
loop: B loop //infinite loop
}
}

after this ->

armcc -c test.c
armlink test.o -o test.axf
fromelf test.axf -bin -o test.bin

then i load this bin file onto the controller. But nothing
happens..whats going on :-(

thanx in anticipation
Mayank



Relevant Pages

  • Re: Code Optimization - AnsiStringReplace
    ... I have looked at the AnsiString Length function. ... function Length(const Str: AnsiString): Integer; ... push esi ... mov esi, ...
    (borland.public.delphi.language.basm)
  • Re: Use of square brackets in 8086 memory addressing
    ... Especially use of the square brackets in the mov instruction. ... exactly does the square brackets refer to? ... If I have a variable "str" and do the following, ... most likely the assembler will reject this one. ...
    (comp.lang.asm.x86)
  • Re: optimizing
    ... I wrote the following asm function: ... void shuf(char *str, int len) ... mov ecx, len ... mov esi, str ...
    (alt.lang.asm)
  • Re: Two 8086 Assembly Language Questions..
    ... PASSWORD DB 'FEELSAFE'; Destination String ... MOV AX, DATA ... AX; Initialise data segment register; as destination ... LEA DI, DESTSTR; Load destination pointer ...
    (comp.programming)
  • Re: How to load a single word(16 bit) to xmm register in Intel P4?
    ... Actually I want to load eight different 16bit values from different ... memory location to an xmm register. ... I cannot use MOVD to read it ... mov ax, ...
    (comp.lang.asm.x86)