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/TMS570LS0714: TMS570 MCAL EB tresos configuration question

Part Number: TMS570LS0714

Tool/software: Code Composer Studio

 I encountered two MCAL code problems when configuring the TMS570 chip. I would like to ask you.
           Problem 1: When integrating the code, we found that after the program call PORT initialization, we call PWM and ICU initialization. The IO ports related to N2HET can not be used normally. Now the reason is found because there is a N2HET module in the PWM initialization. The registers are directly overwritten, causing the IO ports on the N2HET to be inoperable.

Problem 2: When debugging the ADC interrupt, it is found that the Adc_StopGroupConversion() function in Adc.c will execute the /* Disable group notification */ operation, while the Adc_StartGroupConversion() function does not continue to enable group notification, causing the program to eventually enter the default An empty callback function, Adc_AvoidNotification(), causes the program to behave unexpectedly.
      Do you know if there are any good solutions to these two problems?
      Thank you!

  • Hi,

    First issue is already addressed in our latest release 05.40.00 EA2. We have removed lines to write to PDR, PULLDIS, PSL and DIR registers from ICU and PWM. You can comment out the lines.

    On second issue, did commenting the line 1162 solve your problem?
  • Hi

    The method you mentioned has solved part of the problem, but now there is still a problem that there is a PIN PIN N2HET1_27. As shown in the picture, I should set the level to high and input mode, but now I use the oscilloscope to detect that it is low.Why is that?

  • Hi,

    We will do some  tests and provide feedback.

  • Hi,
    We annotated the code for HET1 operation in the two files Pwm_Het. C and Icu_Het. C, resulting in the failure of PWM function. Do you have a better solution?
    Thank you!
  • Hi Yangjian,


    > "We annotated the code for HET1 operation in the two files Pwm_Het. C and Icu_Het. C, resulting in the failure of PWM function."

    Please confirm if you have done changes in these two files as per Viswanath's suggestion: "We have removed lines to write to PDR, PULLDIS, PSL and DIR registers from ICU and PWM. You can comment out the lines."
    Please attach the updated files once you confirm the changes.


    > Unexpected LOW level on N2HET1[27] pin.

    We're doing some tests on our side to see how this pin value is effected with similar configurations.

    A small point. The value given in PortPinLevelValue (HIGH/LOW) setting will take effect on the corresponding pin ONLY IF the PortPinDirection field is set to PORT_PIN_OUT. So from your configuration snapshot, in which PortPinDirection is set to PORT_PIN_IN. we could see that setting PortPinLevelValue as HIGH or LOW doesn't effect actual pin level.

    We would like to know the way this pin is required to function on your board for better understanding.

    Regards,
    ChetaN
  • Hi!

    I have annotated the lines from the PDR, PULLDIS, PSL, and DIR registers in the ICU and PWM.

    However, PWM and ICU still cannot operate normally. Could you explain it in detail?

  • Hi
    As for the problem of N2HET1[27], the code I burned with HCG has proved that there is no problem with the hardware. Could you please help us check whether there are other problems?Can be in the input state, high level, use oscilloscope measurement can be measured high level?
  • Hi Yangjian,

    We tried configuration on our setup here on N2HET1[27] with direction as PORT_PIN_IN, and PULL settings ENABLED and used PORT_PULL_UP as done in your configuration. Observed the pin was initially LOW before Port_Init. And once the N2HET1 registers were updated, the pin switched to HIGH level and stays HIGH after INIT is done.

    Can you confirm if the PortUse field in PortConfigSet->PortConfigSet0->PortContainer->N2HET1 is enabled in the checkbox?

    Attached the snapshots of N2HET1 pin registers before and after port-initialization.

    Before Port_Init:

    After Port_Init:

    Note that, after INIT is done, 27th bit in PSel and Dir are set as required for N2HET1[27] pin for: OUT-direction and PULL_UP. And 27th bit in DIn shows 1 for HIGH. Verified the same in oscilloscope.

    Please compare and let us know if the register values before and after Port_Init differ from observations at your end.

  • Hi,Chetan Sanga

    My current configuration is as follows:

    Before Port_Init:

    After Port_Init:

    However, it did not give me the answer I wanted. I used an oscilloscope to measure the PIN and it still showed a low level.We have confirmed that there is no problem with the hardware. Could you help me analyze and figure out what problems have not been dealt with?

    Second question: you have not solved the conflict between PWM module and PORT module, could you please inform us?

  • Hi Yangjian,

    Issue N2HET1_27:
    Thanks for the register dump. We could see N2HET1_27 pin is configured properly and DIn bit-27 is HIGH, from the software level this seems right. We need to know which pin N2HET1_27 is connected to? Because, there's a chance the pin which N2HET1_27 is connected to might not have been configured properly in MCAL setup and it was done properly with HCG setup. Please share that pin information/functionality if possible. That'd help us better.

    Issue PWM/ICU:
    Please share the following:
    1. Configuration files for Port, PWM and ICU (both C and H files).
    2. A full register dump of Port, PWM and ICU before and after Init. We want to compare these with our setup.
  • Hi Sanga 

    Issue N2HET1_27:

    The following two graphs are chip diagrams of N2HET1 27 pin

    Issue PWM/ICU:

    Now we have got the new MCAL code, but now the PORT module under test is normal, but the PWM is not running normally, and the ICU can also work normally.Attached is the configuration file configured by EB tool. Could you please help us to check if there is any problem?1307.CFG.rar

  • Hi Yangjian,

    You say you got new MCAL code. Please paste this new MCAL release/installer name.

    "but the PWM is not running normally, and the ICU can also work normally."

    You mean ICU is working?

    I require the Port Configuration C and H files as well, to check the pin configuration values. Please share the files.

  • 2330.PORT_cfg.rarHi,Sanga

    The right PWM is not working properly and the ICU is working properly.The attachment will give you the PORT configuration file.

  • Hi Yangjian,

    I see that the Port pin configuration for N2HET1[7] and N2HET1[9] are configured as INPUT (from NHET1_INITIAL_VALUE definition in your Port_PBcfg.c). Please configure them as output in EB (PortConfigSet_0->PortContainer->N2HET1->PortPin). Then the PWM signals can be output on the pins.

    Attached Port_PBcfg.c with updates for some Port-Mux configurations to appy properly, and that change includes PINMUX configuration for N2HET1[27] pin. This will configure the pin correctly. These changes should be in latest 5.04.00 release. Is the new MCAL you received is the same version?

    7002.Port_PBcfg.c

  • Hi,Sanga

    Thank you very much. The conflict between PWM module and PORT module has been solved.Now there is still the problem of N2HET1[27], what we need to realize now is to raise the level and output mode, but the port_pbcfg.c you provided is the input mode and lower the level, can you help us continue to see the cause of the problem?The attachment is port_pbcfg.c that we configured ourselves.6406.Port_PBcfg.c

    The attachment is port_pbcfg.c that we configured ourselves

  • Hi Yangjian,

    The Port-cfg file I had shared earlier was with N2HET1[27] configured as input and PULLED UP, because your previous posts in thread were stressing on having INPUT mode and PULLED UP.

    So, I want to confirm about the configuring N2HET1[27] once more. The pin as per your requirement is to be OUT-pin with PULL-UP, isn't it?

    Anyway, the changes in Port-cfg, as per the configuration snapshot from your latest post, would be a follows, with pin 27 direction as OUT and level as HIGH Please compare the corresponding lines in Port_PBcfg.c.

    @ line ~174
    #define NHET1_INITIAL_VALUE  ((uint32)( (PORT_PIN_IN<<0U)|(PORT_PIN_IN<<1U)|(PORT_PIN_IN<<2U)|(PORT_PIN_IN<<3U)|(PORT_PIN_IN<<4U)|(PORT_PIN_IN<<5U)|(PORT_PIN_IN<<6U)|(PORT_PIN_IN<<7U)|(PORT_PIN_IN<<8U)|(PORT_PIN_IN<<9U)|(PORT_PIN_IN<<10U)|(PORT_PIN_IN<<11U)|(PORT_PIN_IN<<12U)|(PORT_PIN_IN<<13U)|(PORT_PIN_IN<<14U)|(PORT_PIN_IN<<15U)|(PORT_PIN_IN<<16U)|(PORT_PIN_IN<<17U)|(PORT_PIN_IN<<18U)|(PORT_PIN_IN<<19U)|(PORT_PIN_IN<<20U)|(PORT_PIN_IN<<21U)|(PORT_PIN_IN<<22U)|(PORT_PIN_IN<<23U)|(PORT_PIN_IN<<24U)|(PORT_PIN_IN<<25U)|(PORT_PIN_IN<<26U)|(PORT_PIN_OUT<<27U)|(PORT_PIN_IN<<28U)|(PORT_PIN_IN<<29U)|(PORT_PIN_IN<<30U)|(PORT_PIN_IN<<31U)))
    
    
    @ line ~1162
        PORT_BASE_ADDR_NHET1->Reg.DataOut_u32 = (uint32)( (PORT_PIN_LEVEL_LOW<<0)|(PORT_PIN_LEVEL_LOW<<1)|(PORT_PIN_LEVEL_LOW<<2)|(PORT_PIN_LEVEL_LOW<<3)|(PORT_PIN_LEVEL_LOW<<4)|(PORT_PIN_LEVEL_LOW<<5)|(PORT_PIN_LEVEL_LOW<<6)|(PORT_PIN_LEVEL_LOW<<7)|(PORT_PIN_LEVEL_LOW<<8)|(PORT_PIN_LEVEL_LOW<<9)|(PORT_PIN_LEVEL_LOW<<10)|(PORT_PIN_LEVEL_LOW<<11)|(PORT_PIN_LEVEL_LOW<<12)|(PORT_PIN_LEVEL_LOW<<13)|(PORT_PIN_LEVEL_LOW<<14)|(PORT_PIN_LEVEL_LOW<<15)|(PORT_PIN_LEVEL_LOW<<16)|(PORT_PIN_LEVEL_LOW<<17)|(PORT_PIN_LEVEL_LOW<<18)|(PORT_PIN_LEVEL_LOW<<19)|(PORT_PIN_LEVEL_LOW<<20)|(PORT_PIN_LEVEL_LOW<<21)|(PORT_PIN_LEVEL_LOW<<22)|(PORT_PIN_LEVEL_LOW<<23)|(PORT_PIN_LEVEL_LOW<<24)|(PORT_PIN_LEVEL_LOW<<25)|(PORT_PIN_LEVEL_LOW<<26)|(PORT_PIN_LEVEL_HIGH<<27)|(PORT_PIN_LEVEL_LOW<<28)|(PORT_PIN_LEVEL_LOW<<29)|(PORT_PIN_LEVEL_LOW<<30)|(PORT_PIN_LEVEL_LOW<<31));

  •  Hi,Sanga

    Sorry, I want to confirm that what we need is the input mode, which is to raise the level. The port_pbcfg. cN2HET1[27] you gave me before is the input mode, which is to lower the level. Please help us confirm it again.

  • Hi Yangjian,

    So you need the pin as INPUT and you should be able to see it's level as high after the MCAL initialisation is complete.

    Taking the Configuration file I shared before, it doesn't matter what level we set in PortPinLevelValue (HIGH/LOW) in Configuration Tool because the PortPinDirection is set as INPUT and if the pin is set as INPUT, the pin level doesn't get effected even if we update the pin register for changing pin-level.

    If we configure the pin in PUSH-PULL mode and select PULL-UP, as we both did in our configurations, the pin should go high normally. That's what I found previously while testing this on my setup.

    In HCG, you say the pin level goes high after init with INPUT and PULL_UP mode.

    Now, I need the register snapshots before and after init for both HCG setup, and MCAL setup with the Port configuration file I shared. We'll then verify if the registers are programmed and reflecting pin mode/values as expected in both setups.
  • Hi  Sanga

    The picture shows our current configuration of HET[27].

    PORT_Init ago: PORT_Init  later:

    The attachment is the configuration file.6327.Port_PBcfg.c

    Is there anything else we need to provide?Please help us find out the problem as soon as possible, thank you.

  • Yangjian,

    In my previous post, I asked you to run MCAL with the configuration file I shared. Because that is from latest MCAL software  for 05.40.00.

    Pasting the same line from my previous post:

    Now, I need the register snapshots before and after init for both HCG setup, and MCAL setup with the Port configuration file I shared. We'll then verify if the registers are programmed and reflecting pin mode/values as expected in both setups.

  • Hi  Sanga

    We used the 05.40.00 MCAL code.

    Now we are using port_pbcfg.c provided by you. The experimental results are shown in the figure below:

    PORT_Init ago:

    PORT_Init behind:

    Please help us to find out the problem, thank you

  • Thanks Yangjian.

    I was asking about latest MCAL sw because there's an update in Port-Multiplexing configuration for some specific pins. N2HET1[27] is one of them. Only my file has these latest updates.

    Attached new cfg file with Pin mode set as INPUT and PULLED_UP. Please try this and check the 27th bit in DIn register should have '1'.

    5751.Port_PBcfg.c

  • Hi Sanga

    PORT_Init behind:

    Do you mean that only your files have these latest updates?What other pins have been updated?Could the problem we are facing now be due to the lack of updates?

  • Hi Yangjian,

    Yes, from the configuration files you shared especially Port-cfg, I saw that latest updates are not available in your MCAL 05.40.00 software. The updates in this case are for multiplexing configuration correction of some special pins Please refer Table 4-22 for TRM for TMS570LS 09x or 07x 'BitX and not(Bity)' logic for the relevant pins.

    Looking at the register snapshot, we can see that Dir-27 is set to 0 (INPUT), DIn-27 is set to 1. This shows the pin level is HIGH as you configured pull up on this input pin.

  • Hi Sanga

    This is me on my oscilloscope testing, showing N2Het1_27 as low.This phenomenon is consistent with my previous test. Now I need to measure the high level of N2Het1_27 on the oscilloscope.What we need to do to make it happen.

    The MCAL code version we are using now is AUTOSAR MCAL 05.40.00. Do we need to update the updated code to solve this problem?

  • Hi Yangjian,

    About MCAL 05.40.00, for using some peripherals without issues, we should use latest updates on this version.

    I hope this test is with my Port-cfg file.

    Regarding the n2het1-27, is the board customised or is it TI HDK? If it's custom board, we need to know if the pin is connected on board such that it is pulled-down.

    Please try the following test.
    Configure the pin as OUTPUT (with no other configuration changed). In Debug session, set the bit 27 in registers DSet and DClr of N2HET1 alternatively to have toggling of pin level and if the Dout register is showing expected values but the scope is missing the pin toggling, this pin is somehow pulled low on your board.

  • Hi Sanga

    The following is the value of the register when configured to output:

    This is the customized version, not the development board of TI. The circuit board has been confirmed to have no problem before. The code generated by HCG can be normally pulled up and down regardless of the output or input, and the oscilloscope can also read the data normally.When we use the MCAL code, we find that only the output mode is normal, which is configured as high level in the input mode, and the level measured by the oscilloscope is low level.You mentioned earlier that we need the latest MCAL code, so the MCAL 05.40.00 code we are using now can't realize this function?

  • Hi  Sanga

    The current problem is the HET27 pin. The data of the function return value is inconsistent with the data tested using the oscilloscope. The outer circuit of the HET27 is connected to the ground. We are now set to input mode, low level, pull-up resistor, the Dio_ReadChannel function returns a value of 1, the oscilloscope test is 0;
    Input mode, high level, pull-down resistor, the Dio_ReadChannel function returns a value of 0, and the oscilloscope test is 0. Can you tell us the reason or solution?

  • Hi Yangjian,

    We've already confirmed the pin levels reflecting in registers as expected from software perspective. We forwarded the details on the N2HET1-27 pin issue to another team member to look at it from hardware perspective as well. We'll get back to you immediately after we get an update.

  • Ok, looking forward to your reply

  • Hi YangJian,

    Sorry for the late response. I will read the whole thread, then come back to you soon.
  • Hi

    Can you reply as soon as possible? We have been waiting for a long time.

  • Hi QJ Wang

    No solution yet?Why?Could you let us know as soon as possible?

  • Hi QJ Wang

    Hello, we have been waiting for a long time. Can you answer our questions?

  • Hello YangJian,

    My apologies. In this device, the N2HET1[27] is connected to more than 1 terminal, and the input for N2HET1[27] can come from any of the terminals. The multiplexers (PINMMR0[26] and PINMMR25[24]) are used to choose the terminal to be used.

    Please configure PINMMR0 and PINMMR25 as:

    PINMMR0[26] =1 and PINMMR25[24] = 0
  • Hi QJ Wang

    I haven't found the PINMMR0 and PINMMR25 you mentioned. Could you tell me where they are configured?

  • Hello,

    I don't know where it is located in EB tool. The input pin mux is listed in Table 4-21 of TMS570LS0714 TRM: SPNU607.pdf
  • Hi Yangjian,

    For your reference for the setting QJ suggested (PINMMR0[26] =1 and PINMMR25[24] = 0), please check the Port_PBCfg.c file you're using and see if you find the following lines in the file.

    uint32 temp;
    if(PORT_BASE_ADDR_PINMUX_0->Mux.GnrlRg_u32 & (uint32)(1U << 26U))
    {
    /* N2HET1[27] was the chosen functionality on this pin */
    temp = PORT_BASE_ADDR_PINMUX_25->Mux.GnrlRg_u32;
    temp &= ~(uint32)(1U << 24U);
    PORT_BASE_ADDR_PINMUX_25->Mux.GnrlRg_u32 = (uint32)temp;
    }

    Please reply to QJ to proceed further.
  • Hi Chetan,

    Are those code generated by the tool automatically if PINMUX0 and PINMUX25 are configured correctly? Can you tell Yangjian how to configure the input pinmux? If the input pinmux0 or pinmux25 are not in the list (Yangjian pasted the list as an example), how to add those to the list manually?
  • Hi Chetan 

    I did not find what you said in Port_PBcfg.c, the attachment is my Port_PBcfg.c. Can you tell me how to configure it in EB?4251.Port_PBcfg.c

  • Hello YangJian,

    Please copy Chetan's code to your Port_PBCfg.c file, then check if your problem is solved.
  •  Hi 

    The problem has been solved, but can it be configured in EB tool?Will it not affect the other pins?

  • Yangjian,

    Thanks for the update.

    So it's solved after you pasted my code in your Port_PBCfg.c file. That code should have been already present if you're using 05.40.00 release.
    So w.r.t 05.40.00, the EB generator will take care of updating correct bits in relevant MUX registers for N2HET1[27] without disturbing other PINMUX for that release. No manual code is needed in that case.
  • Chetan Sanga

    Hello, I am using version 05.40.00.So what you mean by configuration is configuration.There was something wrong with my configuration.

  • Hi Yangjian,

    Nice to know that the problem has been resolved. I will close this thread. If you have any other question, please open a new thread which makes tracking easier. Thanks