cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 6 MCU

Contributor

Measuring the MCU die temperate is relatively straight forward in other PSOC versions because the top level deign provides a die temperature block that can be directly connected to one of the channels on the SAR. But since the die temperature block is not available in PSOC 6, at least some of the configuration work has to be done in code. I have studied the CE220974 code example for measuring die temperature, but did not find it particularly illuminating. Also, my current A-to-D code is fairly mature. I want to add die temperature measurement while keeping as much of the existing code intact.  It didn't look like I could easily cut-and-paste big chunks of CE220974 into my current code without some significant rework to my code. So I've thought up a possible work-around that looks like it should be fairly clean and simple.. Here is my current A/D configuration:

pastedImage_0.png

I have to do both differential and single-ended conversions. So when it comes time to measure the die temperature, I want to select Config1 /channel 0 and then temporarily highjack the auto-generated routing already in place for my single-ended measurements by directly opening the analog multiplexer switch (using code) that connects the Analog0 pin to the ADC and then directly connect (using code) the die temperature sensor in its place. Then the next A/D conversion will return the MCU temperature. Now, if I understand Figure 40-1 in the PSOC 63 Technical Reference Manual (002-18176), the I/O pins are connected the analog bus via the "gpio switches" and the MCU die temperature via the AMUX splitter switches.

Now, the rub is that these two terms do not seem to map directly to any specific registers in the Registers Technical Manual (002-18270).  Can anybody point me to the specific registers I need to access to override the analog multiplexer switches the way I want to? Also if anybody can point out any flaws in my thinking, I would be most appreciative.

Ed H.

0 Likes
Reply
1 Solution
Moderator
Moderator

Hi,

You can check the registers SAR_MUX_SWITCH0 and SAR_MUX_SWITCH_SQ_CTRL. These control the initial connection and further control using SAR Sequencer. If you go to CYDWR-> Analog tab, you can see the completing routing. There if you hover over the switches connecting the resources you could see which register to control to close switches.

pastedImage_0.png

One solution to your requirement is to reuse the code example config structure. You can modify the Config1 structure according to the code example so that the Die Temp measurement can be taken without any error.

Best Regards,
Vasanth

View solution in original post

0 Likes
Reply
1 Reply
Moderator
Moderator

Hi,

You can check the registers SAR_MUX_SWITCH0 and SAR_MUX_SWITCH_SQ_CTRL. These control the initial connection and further control using SAR Sequencer. If you go to CYDWR-> Analog tab, you can see the completing routing. There if you hover over the switches connecting the resources you could see which register to control to close switches.

pastedImage_0.png

One solution to your requirement is to reuse the code example config structure. You can modify the Config1 structure according to the code example so that the Die Temp measurement can be taken without any error.

Best Regards,
Vasanth

View solution in original post

0 Likes
Reply
Top labels