Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

I want to start ARM with lpc1768 cortex M3

Status
Not open for further replies.

very question

Advanced Member level 4
Joined
Nov 11, 2012
Messages
104
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,298
Location
Iran
Activity points
1,920
hello friends
I want to start ARM with lpc1768 , help me
1-what do you suggest me in order to start learning ARM??
2-which compiler is better? (IAR or Keil)
3-I saw many libraries like CMSIS , what is CMSIS library ??

Thanks in advance
 
Last edited:

doraemon

Super Moderator
Staff member
Joined
Jun 21, 2009
Messages
1,068
Helped
273
Reputation
554
Reaction score
248
Trophy points
1,343
Location
Japan
Activity points
10,597
Hello!

1. If you want something cheap, you may want to try Texas Instruments ARM launchpad.
The boards costs about 5 Euros.
2. There is no reply to your question. There are people who prefer Keil, some who prefer
IAR, etc. On top of that, most of people's replies are not based on experience with 2 or more
systems, but on the only compiler they have installed on their PC.
3. CMSIS: Why this question? Did you try google first?

Dora.
 

alexxx

Advanced Member level 4
Joined
Apr 17, 2011
Messages
1,013
Helped
273
Reputation
552
Reaction score
270
Trophy points
1,383
Location
Greece
Activity points
7,938
2-which compiler is better? (IAR or Keil)
I have used both. IAR has better editor and world class compiler. Keil is more suited on ARM though, and has a much better debugger, ideal for new starters. Most of the references you will find in the web will be on Keil. IAR on the other hand, has the advantage of all in one. This means that if someday you switch to another MCU, IAR will propably support it. As far as I know Keil supports only 8051 and ARM cores.
 

bigdogguru

Administrator
Joined
Mar 12, 2010
Messages
9,831
Helped
2,348
Reputation
4,690
Reaction score
2,274
Trophy points
1,413
Location
Southwest, USA
Activity points
62,504
1. If you want something cheap, you may want to try Texas Instruments ARM launchpad.
The boards costs about 5 Euros.
Actually, I believe TI has recently raised their price on their Stellaris Launchpad.

I bought two units when they were first released at $5 USD per unit, now they are listed at $12.99 USD per unit.

Although, at $12.99 I would still consider the Stellaris Launchpad an economical option.


@very question

I own license for and use both KEIL and IAR. I prefer KEIL as it has become an industry standard partially due to the fact ARM, Ltd. has a financial interest in KEIL.

CMSIS is a standardized library of routines for the Cortex-Mx series of ARMs and portable regardless of the devices manufacturer.

BigDog
 

Jigar 4 Electronics

Full Member level 5
Joined
Apr 28, 2011
Messages
313
Helped
40
Reputation
80
Reaction score
38
Trophy points
1,318
Location
Hamilton, ON, Canada
Activity points
3,390
hello friends
I want to start ARM with lpc1768 , help me
1-what do you suggest me in order to start learning ARM??
If you're new to ARM then, the books - "Arm - System-on-chip architecture, Steve Furber "

or

"ARM System Developer’s Guide, Designing and Optimizing System Software,
By Andrew N. Sloss, Dominic Symes & Chris Wright " can be the good options to start with basics.

& if you're not new to ARM then technical reference manual & datasheet are enough to go through.
 

very question

Advanced Member level 4
Joined
Nov 11, 2012
Messages
104
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,298
Location
Iran
Activity points
1,920
Thanks my friends
I installed Keil u vision4
and I have lpc1768 header board
Now I want to continue,whould you please show me the way of learning ARM?
what is your idea about it's library?
Do you recommend using CMSIS library or the keil's library? which one is better & more helpful
 

very question

Advanced Member level 4
Joined
Nov 11, 2012
Messages
104
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,298
Location
Iran
Activity points
1,920
Hi my friends
I wrote my first program for LPC1768 with CMSIS library and compiled it with keil
I want to set p0.21 but after programing all of my p0 pins show 2.2v
I program with bootloader and I change the start address of memory in to 0x2000
please help me;-)
Code:
#include "lpc17xx.h"
#include "lpc17xx_gpio.h"

int main(void) {

	GPIO_SetDir(0,1<<21,1); 
	GPIO_SetValue(0,1<<21);

	while(1){
			
	}
}
 

very question

Advanced Member level 4
Joined
Nov 11, 2012
Messages
104
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,298
Location
Iran
Activity points
1,920
Can you retry with 1UL<<21 instead of 1<<21
Thanks alexan_e
but it does'nt have any difference from the past
in the simulation i see 0x00100000=1 but when I test port0 all of them 2.2V:shock:
 
Last edited:

alexan_e

Administrator
Joined
Mar 16, 2008
Messages
11,895
Helped
2,021
Reputation
4,158
Reaction score
2,031
Trophy points
1,393
Location
Greece
Activity points
64,377
I'm not sure if it's the code or there is something wrong with the project or the way you program the chip.

What if you try
Code:
LPC_GPIO0->FIODIR = 1UL<<21;  // set P0.21 as output
LPC_GPIO0->FIOCLR = 1UL<<21;  // set P0.21 to 0
 

very question

Advanced Member level 4
Joined
Nov 11, 2012
Messages
104
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,298
Location
Iran
Activity points
1,920
I'm not sure if it's the code or there is something wrong with the project or the way you program the chip.

What if you try
Code:
LPC_GPIO0->FIODIR = 1UL<<21;  // set P0.21 as output
LPC_GPIO0->FIOCLR = 1UL<<21;  // set P0.21 to 0
I haven't any problem in the simulation
what is the default value of this microcontroller's pins?(zero?)
I will change this program as you told & I will tell you the result:grin:
 

alexan_e

Administrator
Joined
Mar 16, 2008
Messages
11,895
Helped
2,021
Reputation
4,158
Reaction score
2,031
Trophy points
1,393
Location
Greece
Activity points
64,377
The default for all pins is input with pull-up enabled so you would read logic 1.
Exceptions are the P0.27, P0.28, P0.29, P0.30 which are I2C and USB pins and have no pullup resistor feature.

The code I gave you write the values directly to the registers instead of calling the functions because I want to make sure that the problem is not the functions (which I have never used)
 

very question

Advanced Member level 4
Joined
Nov 11, 2012
Messages
104
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,298
Location
Iran
Activity points
1,920
HI my friends
I changed program in the following way and everything is ok now
Code:
#include "lpc17xx.h"
#include "lpc17xx_gpio.h"
int main(void) 
{
FIO_SetDir(0,0x0000000f,1);
FIO_SetValue(0,0x0000000f);

}
but I haven't understood yet what was the problem of my last program and why the keil compiler didn't make any error 8-O
this is my last program
Code:
#include "lpc17xx.h"
#include "lpc17xx_gpio.h"
int main(void) {

	GPIO_SetDir(0,1<<21,1); 
	GPIO_SetValue(0,1<<21);

	while(1){
				}
}
 

alexan_e

Administrator
Joined
Mar 16, 2008
Messages
11,895
Helped
2,021
Reputation
4,158
Reaction score
2,031
Trophy points
1,393
Location
Greece
Activity points
64,377
1<<21 equals 0x00200000 but now you have used 0x0000000f , these two are not the same.

I also suggest you use 1UL<<x , UL means unsigned long because if you don't it may not work correctly due to truncation

- - - Updated - - -

Actually you have used different functions too, FIO_SetDir and FIO_SetValue instead of GPIO_SetDir and GPIO_SetValue .
You should check the library code to see the difference.
 

very question

Advanced Member level 4
Joined
Nov 11, 2012
Messages
104
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,298
Location
Iran
Activity points
1,920
1<<21 equals 0x00200000 but now you have used 0x0000000f , these two are not the same.

I also suggest you use 1UL<<x , UL means unsigned long because if you don't it may not work correctly due to truncation
I know 1<<21 is different with 0x0000000f ,that was just an example

Actually you have used different functions too, FIO_SetDir and FIO_SetValue instead of GPIO_SetDir and GPIO_SetValue .
You should check the library code to see the difference.
by the following program it worked right
Code:
#include "lpc17xx.h"
#include "lpc17xx_gpio.h"
int main(void) 
{
GPIO_SetDir(0,0x0000000f,1);
GPIO_SetValue(0,0x0000000f);

while(1)
            {
                    }
}
I think we can't use this form 1<<21 in this library
 
Last edited:

alexan_e

Administrator
Joined
Mar 16, 2008
Messages
11,895
Helped
2,021
Reputation
4,158
Reaction score
2,031
Trophy points
1,393
Location
Greece
Activity points
64,377
Where did you find the "lpc17xx_gpio.h" header, I can't find it in the code bundle.

I remember having problems with 1<<x in the past but I don't remember exactly the case.
 

very question

Advanced Member level 4
Joined
Nov 11, 2012
Messages
104
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,298
Location
Iran
Activity points
1,920
I wrote another program according to the LedBlinky example from cmsis library , I want 300ms delay, but in the experiment it delays more than 300ms
I think ,the problem is in SysTick_Config
Is there any body know how to set it?
Code:
#include"lpc17xx.h"
#include "lpc17xx_gpio.h"
#include "lpc17xx_libcfg.h"
volatile unsigned long SysTickCnt;
void SysTick_Handler (void);
void Delay (unsigned long tick);
void SysTick_Handler (void) {
  SysTickCnt++;
}

void Delay (unsigned long tick) {
  unsigned long systickcnt;

  systickcnt = SysTickCnt;
  while ((SysTickCnt - systickcnt) < tick);
}

int main(void){
 GPIO_SetDir(1, 0x10000000, 1);             /* LED on P1.0 defined as Output    */ 
 SysTick_Config(SystemCoreClock/1000 - 1); /* Generate interrupt each 1 ms   */ 
 
 while(1){            
  GPIO_SetValue(1,0x10000000);             /* LED on P1.0 on    */ 
  Delay(300);
  GPIO_ClearValue(1, 0x10000000);         /* LED on P1.0 off    */ 
  Delay(300);
 
 }
 }
 
Last edited:

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top