function call problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

function call problem

605 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by unnati on Wed Mar 10 07:17:49 MST 2010
hi,

i have attached a program file.i am able to build, debug and download the same.
but i do not get the output.

also in single step debug mode, whenever a function call statement occurs it goes to "main() / void reset handler(void) / cr_startup_lpc11.c.

wot should i do?
0 项奖励
回复
3 回复数

596 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by unnati on Fri Mar 12 06:40:38 MST 2010
thanx both of u..

i tried the way renan suggested and it was successfully..:)
0 项奖励
回复

596 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by renan on Wed Mar 10 08:53:37 MST 2010
In your file:
int main()
{
    [B]void system_config(void);[/B]
    [B]void timer16b0_init(void);[/B]
    DISPLAY_DATA=0x07C0;      // DISPLAY 0000
    DISPLAY_DATA=0x0BC0;      //
    DISPLAY_DATA=0x0DC0;      //
    DISPLAY_DATA=0x0EC0;      //
   [B] void display_data(void);[/B]
}


Should be:

int main()
{
    [B]system_config();[/B]
    [B]timer16b0_init();[/B]
    DISPLAY_DATA=0x07C0;      // DISPLAY 0000
    DISPLAY_DATA=0x0BC0;      //
    DISPLAY_DATA=0x0DC0;      //
    DISPLAY_DATA=0x0EC0;      //
   [B] display_data();[/B]
}


Renan
0 项奖励
回复

596 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wrighflyer on Wed Mar 10 07:50:58 MST 2010

Quote: unnati
whenever a function call statement occurs it goes to "main() / void reset handler(void) / cr_startup_lpc11.c.


That often suggests a stack pointer that's been initialised to a non-RAM address. Could you be building for the wrong CPU model? (I believe in these chips it's flash address 0x0000 that holds the initial SP value)
0 项奖励
回复