Tool/software: Code Composer Studio
I'm beginer in Code Composer and 5416. Now I try to write easy code but this code dosen't work correct.
I think it is problem this stack.
void SPI_Delay(const unsigned int Del) { volatile unsigned int i=0; for(i=0;i<Del;i++) { asm(" nop"); asm(" nop"); asm(" nop"); asm(" nop"); } } void main() { SPI_Delay(10); }
When I call this the Del is not eqvivalnt 10..
/****************************************************************************/ /* VC5416.cmd */ /* Copyright (c) 2010 Texas Instruments Incorporated */ /* Author: Rafael de Souza */ /* */ /* Description: This file is a sample linker command file that can be */ /* used for linking programs built with the C compiler and */ /* running the resulting .out file on a VC5416. */ /* Use it as a guideline. You will want to */ /* change the memory layout to match your specific */ /* target system. You may want to change the allocation */ /* scheme according to the size of your program. */ /* */ /****************************************************************************/ --stack_size 0x2000 /* PRIMARY STACK SIZE */ MEMORY { PAGE 0: EXT1: o = 0x00000 l = 0x00080 /* external or reserved (OVLY=1) */ DARAM0: o = 0x00080 l = 0x01F80 /* 8kW external or DARAM (OVLY=1) */ DARAM1: o = 0x02000 l = 0x01000 /* 8kW external or DARAM (OVLY=1) */ DARAM2: o = 0x04000 l = 0x02000 /* 8kW external or DARAM (OVLY=1) */ DARAM3: o = 0x06000 l = 0x02000 /* 8kW external or DARAM (OVLY=1) */ EXT2: o = 0x08000 l = 0x04000 /* external */ EXT3: o = 0x0C000 l = 0x03F80 /* external or ROM (MP/MC=0) */ VECS: o = 0x0FF80 l = 0x00080 /* Interrupt vectors */ DARAM4: o = 0x18000 l = 0x02000 /* 8kW external or DARAM4 (OVLY=1) */ DARAM5: o = 0x1A000 l = 0x02000 /* 8kW external or DARAM5 (OVLY=1) */ DARAM6: o = 0x1C000 l = 0x02000 /* 8kW external or DARAM6 (OVLY=1) */ DARAM7: o = 0x1E000 l = 0x02000 /* 8kW external or DARAM7 (OVLY=1) */ SARAM0: o = 0x28000 l = 0x02000 /* external or SARAM0 (MP/MC=0) */ SARAM1: o = 0x2A000 l = 0x02000 /* external or SARAM1 (MP/MC=0) */ SARAM2: o = 0x2C000 l = 0x02000 /* external or SARAM2 (MP/MC=0) */ SARAM3: o = 0x2E000 l = 0x02000 /* external or SARAM3 (MP/MC=0) */ SARAM4: o = 0x38000 l = 0x02000 /* external or SARAM4 (MP/MC=0) */ SARAM5: o = 0x3A000 l = 0x02000 /* external or SARAM5 (MP/MC=0) */ SARAM6: o = 0x3C000 l = 0x02000 /* external or SARAM6 (MP/MC=0) */ SARAM7: o = 0x3E000 l = 0x02000 /* external or SARAM7 (MP/MC=0) */ PAGE 1: MMR: o = 0x00000 l = 0x00060 /* Memory mapped registers */ SPRAM: o = 0x00060 l = 0x00020 /* 32W scratch-pad RAM */ DARAM0: o = 0x00080 l = 0x01F80 /* 8kW DARAM0 */ DARAM1: o = 0x02000 l = 0x02000 /* 8kW DARAM1 */ DARAM2: o = 0x04000 l = 0x02000 /* 8kW DARAM2 */ DARAM3: o = 0x06000 l = 0x02000 /* 8kW DARAM3 */ DARAM4: o = 0x08000 l = 0x02000 /* 8kW external or DARAM4 (DROM=1) */ DARAM5: o = 0x0A000 l = 0x02000 /* 8kW external or DARAM5 (DROM=1) */ DARAM6: o = 0x0C000 l = 0x02000 /* 8kW external or DARAM6 (DROM=1) */ DARAM7: o = 0x0E000 l = 0x02000 /* 8kW external or DARAM7 (DROM=1) */ } SECTIONS { vectors > DARAM1 PAGE 0 coefs > DARAM2 PAGE 1 .text > DARAM2 PAGE 0 .cinit > DARAM2 PAGE 0 .data > DARAM2 PAGE 1 .bss > DARAM2 PAGE 1 .stack > DARAM1 PAGE 1 .const > DARAM2 PAGE 1 .sysmem > DARAM1 PAGE 1 .cio > DARAM1 PAGE 1 }
This system without any external memory