Give me IAR EW ARM example for LPC2148 LED blink

Status
Not open for further replies.
find attachement
 

Attachments

  • Lpc214x.zip
    361.3 KB · Views: 120


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
int i=8;
main()
{
  IO0DIR |= 0x0000FF00;   P0.8 to P0.15 as output
   IO0SET |= 0x0000FF00;  P0.8 to P0.15
while(1)
{
   IO0CLR |=(1<<i); 
   Sleep(200);
IO0SET |=(1<<i);
Sleep(200);
}
 
 
}

 
@EasyRider

What do you mean by bitbang write only registers ? We are only writing to PORT and not reading them.

I am new to IAR Compiler and LPC MCUs but if somebody help me with an LED example then I will try to master LPC MCU programming in another 3 months.

I tried this but it didn't work. That's why I am asking. http://embeddedcraft.org/iar_arm2.html
 

When I sad write only I mean that you can only write to this register.
IO0SET |= value equal IO0SET = IO0SET | value - read, modify, write
The correct way is to write directly:
IO0SET = value

- - - Updated - - -

I am new to IAR Compiler and LPC MCUs but if somebody help me
Man, you creating few topics per day with the same questions. Last time you crashed one PIC16F877 as I remember. Possible, beter way is to create one common topic like a "teaching Milan how to work with micronontrollers"
Iar, MikroC, PIC, LPC - doesn't matter.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…