Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

working with multiple source files in a single Keil project

Status
Not open for further replies.

pawan kumar

Member level 4
Joined
Jan 31, 2012
Messages
73
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,298
Location
Chennai
Activity points
1,894
Hello gurus,


First of all, thanks for answering all my previous questions.I want to learn how to integrate multiple C files in the same project. As far as I know, each .c file (except main) requires a .h file. I am not able to make google understand this(no search results).I would be glad if you post any tutorial link of step by step procedure to do this.


Thanks

Pawan
 

I want to learn how to integrate multiple C files in the same project.
....
I would be glad if you post any tutorial link of step by step procedure to do this.


What version of µVision are you currently using? And for which compiler/microcontroller are you coding?

BigDog
 

Hello BigdogGuru,

I am using µVision 4 for programming LPC2148 microcontroller

Pawan
 

I think you will find this tutorial useful
Just ignore the part about make setup.

You may also check chapter 5 (page 118 ) of The Insider's Guide To The NXP LPC2000 Based Microcontrollers about the uvision IDE, it is for an older version but the functionality is identical
Insiders Guides
 
A couple of notes about the keil interface.
When you use separate source file you have the option to execute them from RAM or FLASH and select the ARM mode (32bit) or THUMB mode (16bit).
You can read about these modes in the Hitex book in the previous link.

You can see an example of the THUMB mode in the Interwork example included in the Keil example folder.
In order to force the functions in a source file to work in the thumb mode you right click on the source file and select options, you will see the thumb checkbox

uvision_thumb.gif

In the same screen there is a enable ARM/thumb interworking, when this is checked you can set parts of the code in 16bit mode and other parts in 32 bit mode.
There is also a global project option if you open the target options and select the C tab.

In order to set the code following the directive to THUMB mode (assuming that the source is to ARM mode by default) you write
#pragma thumb

and in order to restore the ARM mode you write
#pragma arm

This also exist in the book but the old uvision version was using a capital letter directive which will not work if you try it.

The RAM or FLASH feature can be seen in the RAM_Function example of uvision.
In order to execute a source code from the RAM you open the source right click options and then select a IRAM area

uvision_RAM_source.gif

Again you can read about this in the book
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top