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.

TMS570LS3137: Issue with turning off periferals

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Hello! My name is Leandro
In my current project, I'm working with a TMS570LS3137 microcontroller, and I need to turn off some
peripherals to save power (I mean, disable the peripheral clock). I found this aplication report that
informs how to do that: www.ti.com/.../spna173.pdf
ts=1681316353136&ref_url=https%253A%252F%252Fwww.google.com%252F . It's named "Reduction
of power consumtion for TMS570LS3137".
The report suggests using the Peripheral Power-Down Set Register 0 (PSPWRDWNSET0) and
Peripheral Power-Down Set Register 1 (PSPWRDWNSET1) to disable the clocks of a given peripheral.
Those 32 bit register represent a "Peripheral Select" every 4 bits, and these 4 bits represent quadrants of
the whole peripheral. Fortunately, the aplication report presents a table (table 5) that explains which bits
of those registers one must set to effectively disable the clock of certain peripheral.
The report also gives an example:
"Example Disabling MibSPI1
The corresponding PS decodes all addresses between 0xFFF7F400 and 0xFFF7F7FF. MIBSPI1 and
SPI2 are mapped to this PS2 as following:
• PS2 quadrant 0 and quadrant 1 are for MibSPI1 for a total of 512 bytes
• PS2 quadrant 2 and quadrant 3 are for SPI2 for a total of 512 bytes
To disable the MibSPI1, bits 8 and 9 of the Peripheral Power-Down Set Register 0 (PSPWRDWNSET0)
have to be set."
The problem I'm having is that I'm not being able to set those bits. In fact, not only those, but a lot more.
For a simple example, I tried setting all bits in the register, and only a few did respond.
This is what I can read of the PSPWRDWNSET0 register after tryng to set all bits:
01010000000100010000000100000101b
We can see that bits 8 and 9 did not get setted, so the example of turning off MibSPI1 failed for me.
I was in supervisor mode when I tried to set all of those bits.
So the question is, why doesn't all the bits get setted? How can I know if a peripheral clock indeed got
disabled or not?
Regarding the project I used, I just did the following:
1- Created a new Compose Studio Code project with the TMS570LS3137 as target.
2-Created a new HalCoGen project (associated with the CSS project) and disabled all available drivers
of peripherals. I generated the code with those settings. I tried with and without FreeRTOS.
3- The only thing that I added to the main function was to set all bits in the Peripheral Power-Down Set
Register 1 (PSPWRDWNSET1) and Peripheral Power-Down Set Register 0 (PSPWRDWNSET0)
Can you help me realizing what am I doing wrong?

Thanks a lot in advance!

  • The PSPWRDWNSET0 register controls PS0-PS7. So the PS[0] is controlled by the lower 4 bits of the PSPWRDWNSET0[3:0] while the PS[2] is controlled  by PSPWRDWNSET0[11:8]. Each PS is controlled by 4 bits. 

    MibSPI1 -- PS[2] -- PSPWRDWNSET0[10] should be set, bit 11 is not set.

  • Hi QJWang!!


    Let me see if I understand. I think there's a little mistake in your answer but it made me realize the possible solution.
    So MibSPI1 is between 0xFFF7F400 and 0xFFF7F5FF (512B) and SPI2 is right after, between 0xFFF7F600 and 0xFFF7FFF (again 512B). Both belong to PS[2] (PSPWRDWNSET0[11:8]), but because MibSPI1 comes first, MibSPI1 is controlled by bits 8 and 9, and SPI2 by bits 10 and 11. (this is the little mistake I think). If I'm correct, then the application report is also correct in the example disabling MibSPI1.
    So bits 8 and 9 have to be set, but thanks to that image you posted in your answer, I know that only the first bit (bit 8) will respond and effectively get set, am I correct?
    That would be why if I try to set the entire register, only bit 8 responds for this peripheral. The same would apply to the rest of peripherals, maybe also only 1 responds for each peripheral. As a reminder, here is what the read of the entire register PSPWRDWNSET0 looks like after trying to set all 32 bits:
    01010000000100010000000100000101b


    Let me know if you agree with me in this reasoning.


    Thanks a lot!

  • Yes, The MibSPI1 -- PSPWRDWNSET0[9:8] = [0, 1]

    I know that only the first bit (bit 8) will respond and effectively get set, am I correct?

    your understanding is correct.

    The unimplemented bit  for example bit 9 is not set.