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.

TMS320F28379D: TMS320F28379D

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

HELLO

While trying to code for TMS320F28379D in assembly, i find that CCS is not being able to access most of the memory locations. for example  was trying to disable the watchdog and hence had to move some values to the WDCR register. i was unable to do so. While trying to solve the issue i found out that in page 178 of the datasheet, word length for all the memory locations is 16 bit. but in the technical reference manual, GPIO and other various registers are 32 bits. how could 32 bit registers be placed in 16bit length memory locations ? could anyone please explain my confusion?

i am providing my code here to pass some values to the GPIO. the value 068 is not moving into WDCR register.  The GPIO control and data registers also cannot be accessed. i have tried in several ways. Accumulator and Data page pointer can be accessed fine though.  kindly help

.global _c_int00
.def UNUSED
.text

_c_int00: 




MOV ACC,#0068h
C28OBJ
.c28_amode
C28MAP 



EALLOW 
MOV @WDCR,ACC 
MOVW DP, #7029h>>6 


MOV @7029h, #0068h 

CLRC DBGM 
C28ADDR 

EALLOW 



MOVW DP, #07C00h
ZAPA
MOVL @GPALOCK,ACC
MOVL @GPAGMUX1,ACC
MOVL @GPAGMUX2,ACC
MOVL @GPAMUX1,ACC
MOVL @GPAMUX2,ACC
OR ACC,#0FFFFh<<16
OR ACC,#0FFFFh
MOV @GPADIR,ACC
MOV @GPASET,ACC

CLRC INTM 

inf_loop


NOP
b inf_loop,unc

UNUSED
CLRC DBGM
NOP
B UNUSED,UNC

  • Hi Rupak,

    how could 32 bit registers be placed in 16bit length memory locations ? could anyone please explain my confusion?

    C28x core is 16bit machine which means minimum word length is 16 bit (not 8 bit). That does not mean it can not access 32bit register. For 32bit register, 2 16bit location will be used.

    Any reason why are you using assembly and not writing code in 'C'. You can refer examples in C2000Ware for better understanding on this. 

    How do you know that value is not getting written. If you are expecting to see value 0x68 after write then that's not correct. Some of the fields in this registers are R=0 (CHK field) hence value will not be same.

    Regards,

    Vivek Singh 

  • Thanks for the help VIVEK. I understand that WDCR register on read will not show 068. 

    I am writing the code in assembly because for my application involves time critical calculations. hence Assembly will give me much faster computation and enable better debug options. 

    Can you plz extend your help such that if i send you a working assembly code that was written for 2812, could you kindly let me know the necessary changes to be made for using a similar assembly logic in 28379? I dont mind to use the existing C libraries which is present in the control suite examples. but for that i need to switch from the C to assembly in the main code body, as i need to write the main body in assembly only. could you help me with any information in this regard?\

    thank you

  • Rupak,

    Here is the assembly example which does what you are trying to achieve. Hope this helps.

    //Disabling watch dog using assembly//
    EALLOW
    MOVZ DP, #7029h>>6 ;Set data page for WDCR register
    MOV @7029h, #0068h ;Set WDDIS bit in WDCR to disable WD

    // Configure GPIO1 as GPIO (default on reset)
    MOV AR3, #0x6F86 ; point to GPAMUX1 register
    MOV AL, *AR3 ;Store contents of GPAMUX1 in AL register
    AND AL, #0xFFF3 ; clear bits 3 & 2 (GPIO1) of GPAMUX1 to select per0, GPIO
    MOV *AR3, AL ;Store AL contents back into GPAMUX1 register

    Regards,
    Manoj
  • thanks Manoj.

    Could you please elaborate how

     MOV AR3, #0x6F86 ; point to GPAMUX1 register

    is pointing to the GPAMUX1 register ? any explanation would be of great help to me.

  • Rupak,

    Sorry, I missed to update the address of GPAMUX1 register for F28379D. Corrected below.

    // Configure GPIO1 as GPIO (default on reset)
    MOV AR3, #0x7C06; point to GPAMUX1 register
    MOV AL, *AR3 ;Store contents of GPAMUX1 in AL register
    AND AL, #0xFFF3 ; clear bits 3 & 2 (GPIO1) of GPAMUX1 to select per0, GPIO
    MOV *AR3, AL ;Store AL contents back into GPAMUX1 register
  • Rupak,

    Can you please close this thread if your issue is resolved?

    Regards,
    Mnaoj
  • Thanks a lot Manoj. The code you sent actually did not work as the CPU is not being able to access any of the registers other than the core registers. I have now shifted to C and it is now working fine.