LPC1758 toggle pin in assembly

Status
Not open for further replies.

thranduil

Member level 1
Joined
Jul 19, 2011
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,670
Hi all guys,

I have a problem with toggling pin in LPC1758 in assembly language.
I am not for years in assembly but I have fine understanding of the field.
So, the code is very simple:
Code:
asm volatile(
    "movt r0, #0x2008 \t\n"
    "movw r0, #0xc038 \t\n"
    "movw r1, #2 \t\n"
    "str r1, [r0] \t\n"
);

I want to toggle pin p1.1. The address of the corresponding FIO1SET register is 0c2008c038.
The problem is that processor is lost due to the store function. If I ommit it it will finish with assembly part of the code and continue, otherwise it never goes out of asm block.
Do you maybe have any suggestion why this hello world piece of cake doesn't work?

Best, cheers and thank you
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…