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.

TMS570LS20216 GIO pins

Other Parts Discussed in Thread: TMS570LS20216, HALCOGEN, MSP430F169

Hello, 

At the moment I am getting started with TMS570LS20216 microcontroller. The question is about GIO ports for PGE package. It has up to 68 Total Peripheral I/Os and 8 of them are dedicated GIO Pins with interrupt capability. I can not find pin designation for pins when GIO function is selected. For example, I would like to configure NHET[7] (pin 109) for GIO (output direction) and so on. Or how 8-bit GIO bus is managed?

Or can I find examples in files supplied with TMDX570LS20SUSB development kit?

Best regards, Vitalij

  • There are GIOA0-7 (interrupt capabile) and GIOB0-7 pins controlled by the GIO module (SPNU489 chapter 12 ).

    The other pins are controlled by each module itself, for example NHET[7] is controlled by the NHET module (SPNU489 chapter 18.4.5.13 I/O Pull Control Feature)

    If you want to set NHET[7] to output high:

    *((volatile unsigned int *)0xFFF7B84C) |= 1<<7; //Set to output

    *((volatile unsigned int *)0xFFF7B858) = 1<<7; //atomic set bit 7.

    The examples with development kit:

    After you install the development kit, you should be able to find it under:

    C:\ti\TMS570 Safety MCU Demos\Demo_Software_Ver1_1

    The name might be slightly different because what installed in my PC is a very old one (a few years ago).

    Regards,

    Haixiao

     

  • Hello Haixiao,

    Thank you very much for information. I will keep it in mind. Development kit was delivered yesterday. I will start working with it in several days. Possibly futher questions will appear again.

    Regards,

    Vitalij

  • Hello Haixiao,

    I am trying to get started with TMDX570LS20SUSB. I hope that CCS project is attached to this message.

    1513.Example_HET.zip 

    The screenshot of the CCS project is shown below too:

    The code should turn ON the HET0 LED in the way you showed. I suppose that it corresponds to the NHET [0] pin. The problem is so that HET0 LED is off after the code is downloaded to the microcontroller. HalCoGen was not used for this project. 

    The JTAG LED blinks constantly.

    Should any additional initialization be performed additionally? For example clock, watchdog timer.... Should I also periodically reset WDT counter or is it inactive after reset.

    What is default clock source? Microcontroller initialization for safety operation is not required at the moment.

    Regards,

    Vitalij

     

  • This project did not initialize the peripherals (such as enable them, select the clock source, configure the pll and flash waitstate, ECC, etc..). You need those initialization files to go to main. 

    Try this:

    Open HalCoGen, choose the device, and the default configuration, click generate code. now what you get is a bunch of file help you init the MCU and finally call the main function.

    Next, in the CCS, generate the project and edit the sys_main.c with those lines of code.

    Regards,

    Haixiao

  • Hello Haixiao,

    1) HET

    The project for driving HET LED outputs is working normally now. HalCoGen was used to enable only GIO driver. I have also changed pull-up and pull-down settings for another HET inputs. It is OK too.

    The only problem is so that physical addresses are not convenient to write the code. For example, it would be much easier to use HETDIR  |= (1 << PIN_HET_0); instead of 

    *((volatile unsigned int *) 0xFFF7B84C) |= (1 << PIN_HET_0); to set NHET[0] direction to output. Is it possible? Are the registers already predefined?

    2) SCI

    I have also tried to establish UART communication for the next example project. For this purpose SCI2 was selected. At first this module was configured to operate without interrupts. So, polling mode was used. This also worked normally.

    Now I am trying to use interrupts for data transmission. The first byte is sent from main (), but the next bytes should be transmitted from TX IRQ. For this purpose TX INT (high level) for SCI2 is enabled from HalCoGen. VIM channel 49 (LIN2 high) is enabled too. Is it right?  I see that microcontroller sends only one first byte. So, TX interrupt does not operate correctly. Where is it necessary to handle interrupts? I found out from several examples that all interrupts should be handled in Notifications. You will see in the attached project, that sciNotification is modified in the notification.c file. Only 1 command is added to send single byte. Is it correct?

    I do not really understand how different interrupts will be distinguished. For example, our final project will have 2 SCIs. Each of them will have RX and TX interrupts. Can you show me an example for handling RX and TX interrupts.  

    6683.SCI.zip

    Best regards,

    Vitalij

  • P.S.

    The purpose of our activities is to switch from MSP430 to TMS570 microcontrollers because they are suitable for safety critical applications. I have attached an example where initialization of 2 USART modules is shown for MSP430F169 microcontroller. RX and TX interrupts are used for each USART module to send and receive bytes. So, 4 different IRQ routines are included. In general I expected that TMS570 interrupts are handled in a very similar way. Aren't they? How do IRQ routines look for TMS570 microcontrollers?   

    7674.USART_MSP430.c

  • Vitaly Stepin said:

    Hello Haixiao,

    1) HET

    The project for driving HET LED outputs is working normally now. HalCoGen was used to enable only GIO driver. I have also changed pull-up and pull-down settings for another HET inputs. It is OK too.

    The only problem is so that physical addresses are not convenient to write the code. For example, it would be much easier to use HETDIR  |= (1 << PIN_HET_0); instead of 

    *((volatile unsigned int *) 0xFFF7B84C) |= (1 << PIN_HET_0); to set NHET[0] direction to output. Is it possible? Are the registers already predefined?

    HW: If you indude "het.h", you can use 

    hetREG1->DIR |=xxxxxx

    or call the function: (you have to include 'gio.h' too)

    gioSetDirection(hetPORT1, uint32_t dir);

    2) SCI

    I have also tried to establish UART communication for the next example project. For this purpose SCI2 was selected. At first this module was configured to operate without interrupts. So, polling mode was used. This also worked normally.

    Now I am trying to use interrupts for data transmission. The first byte is sent from main (), but the next bytes should be transmitted from TX IRQ. For this purpose TX INT (high level) for SCI2 is enabled from HalCoGen. VIM channel 49 (LIN2 high) is enabled too. Is it right?  I see that microcontroller sends only one first byte. So, TX interrupt does not operate correctly. Where is it necessary to handle interrupts? I found out from several examples that all interrupts should be handled in Notifications. You will see in the attached project, that sciNotification is modified in the notification.c file. Only 1 command is added to send single byte. Is it correct?

    HW: I think it is LIN1 interrupt. Inside the module, if you configure it to high level it is no 13, if you configure it to low level ,it is no 27.

    Did you enable the IRQ in the CPU? if not, in the sys_main.c please add, (if you only want to enable the IRQ, it is "cpsie i")

    asm(" cpsie if");

    I do not really understand how different interrupts will be distinguished. For example, our final project will have 2 SCIs. Each of them will have RX and TX interrupts. Can you show me an example for handling RX and TX interrupts.  

    HW: Read the SCIFLR or SCIINTVECT0/SCIINTVECT1 register, and then switch....case..

    If you can not get it working, post the project in the forum.

    6683.SCI.zip

    Best regards,

    Vitalij