This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS320F28335: Assembly Language

Part Number: TMS320F28335
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hi team

I want to use Assembly Language to initialize XINTF. I success when i use C Language.

The following is the C 

EALLOW;
*(unsigned long *)0x0B20 = 0x0043FFFF; /* Zone0 */
*(unsigned long *)0x0B2C = 0x0043FFFF; /* Zone6 */
*(unsigned long *)0x0B2E = 0x0043FFFF; /* Zone7 */

*(unsigned long *)0X0B34 = 0X00010D14;
*(unsigned long *)0X0B38 = 0X0000003F;
*(unsigned long *)0X0B3A = 0X00000005;

*(unsigned long volatile *)0x6F96 = 0xFFFFFFF5; /* GPBMUX1 */
*(unsigned long volatile *)0x6f88 = 0xFF000000; /* GPAMUX2 */
*(unsigned long volatile *)0x6FA8 = 0x0000AAAA; /* GPCMUX2 */
*(unsigned long volatile *)0x6FA6 = 0xAAAAAAAA; /* GPCMUX1 */
EDIS;

And then,i use CCS Disassembly 

EALLOW
MOV @AL, #0xffff
MOVB AH, #0x43
MOVL XAR4, #0x000b20
MOVL *+XAR4[0], ACC

MOVL XAR4, #0x000b2c
MOVL *+XAR4[0], ACC

MOVL XAR4, #0x000b2e
MOVL *+XAR4[0], ACC

MOVL XAR5, #0x010d14
MOVL XAR4, #0x000b34
MOVL *+XAR4[0], XAR5

MOVL XAR4, #0x000b38
MOVB ACC, #63
MOVL *+XAR4[0], ACC

MOVL XAR4, #0x000b3a
MOVB ACC, #5
MOVL *+XAR4[0], ACC

MOVL XAR4, #0x006f96
MOVB ACC, #0
SUBB ACC, #11
MOVL *+XAR4[0], ACC


SETC SXM
MOVL XAR4, #0x006f88
MOV ACC, #0xfe00 << 15
MOVL *+XAR4[0], ACC

MOVL XAR4, #0x006fa8
MOVL XAR5, #0x00aaaa
MOVL *+XAR4[0], XAR5

MOV @AL, #0xaaaa
MOV @AH, #0xaaaa
MOVL XAR4, #0x006fa6
MOVL *+XAR4[0], ACC

EDIS

Please help. 

BR,

  • Hi,

    Sorry, but the question is not very clear. Are you saying you already use assembly code and it's not working, or do you need some help to write in assembly? I guess the latter, but want to be sure.

    Also, can I ask what is the reason for doing this? At times it can be useful to code time critical parts of a program in assembly, but XINTF initialization is not typically time critical.

    Regards,

    Richard

  • Thank you for your reply, That's my question I want to ask. This question can be simplified that I want to use Assembly Language to write register. The XintfRegs is success to write while the GpioCtrlRegs is fail. I guess this problem is caused by the qualifier "volatile". But look up the CCS Disassembly, I found whether use the "volatile" or not, this translate is almost the same. So I hope someone to analyze problem and give me some advises, thank you.

  • Writes to GPIO registers should work in the same way as in your XINTF example. They are 32-bit registers and providing you have enabled EALLOW protection as is done in the XINTF code, it should be fine. If you can send the code I'll be glad to see if I can find the issue.

    I don't have an F28335 example to hand, but I've coded a simple assembly function for F28069 which simply toggles the GPIO pins on the LaunchPad board for that device. You would prototype the function in C like this:

    extern void afunc(void);

    ...then just call it.

    afunc();

    A similar function to run on F28335 would differ only in the register address. I placed the register settings on call at the top of the file in case you need to pass arguments or return a value.

    I hope this helps. Please post back if anything's unclear.

    Regards,

    Richard

    demo2806x_afunc.asm

  • thank you very much again.

    I think I have found the cause of the issue. In my project, I have build a large global variable that the heap is not enough to use. So I want to move the .bss sections to the outside ram and init XINTF before _c_int00. But it seen that it doesn't work, no matter write the GPIO registers or XINTF registers. (As I debug not carefully, I have said success to write XINTF registers. The true is that after InitSysCtrl, it will be auto to write.)

    Return to the demand, could you have any good idea or example to scale up the heap space?

  • The only examples I can point you towards are in C2000Ware. There are some for EMIF configuration; for example "emif_dc_cpu" which should be on you hard drive at:
    C:\ti\c2000\C2000Ware_1_00_06_00\device_support\f2837xd\examples\cpu1\emif_dc_cpu

    If you can let me know what is not working and also supply the relevant part of your code I'll be pleased to try to help.

    Regards,

    Richard
  • Just checking in to see if you still need help with this question?
    Regards,
    Richard