Did you test the example power management from the SDK? Could you tell me if you are using an evaluation board? and Could you tell me the full name part of your MCU? I will check if the I2C has capability to do a wake up.
I confirm in the Reference Manual chapter [ 7.3 Power modes] you can use this modes, Normal Wait - via WFI, VLPW (Very Low-Power Wait) -via WFI, this mode supports the interrupt recovery. Only need to configurate the I2C with the interrupt, in the SDK you can find an example of I2C and you can try to add to the other example and test it.
Actually I gone through the example code and I see the power manager.c file. In this file we have one function SMC_SetPowerModeWait(SMC) this will put the micro in Normal Wait mode. But my doubt is How I2C will wake up micro from sleep.
will you please share me the configuration/ steps for wakeup using I2C.
Actually, I try with the power_manager.c from SDK file, we have functions for different sleep modes like,
SMC_SetPowerModeWait(SMC);
SMC_SetPowerModeVlpw(SMC);
SMC_SetPowerModeVlps(SMC); etc..
I am using these functions one by one and testing the current drawn while sleep mode and its drawn 10mA -12mA. Before sleep mode its like 15-17 mA, So its reduced only 5mA. But In datasheet mentioned its should be in uA.
will you please tell me what is the mistake I have done.
And in the functions using the below register to change the power mode but I couldn't find in the register related to power mode. will you please tell me where is the register in the data sheet
Actually I used power_manager demo code from SDK-FRDM-KL27Z and I tested with all the power mode options present in the code. by using UART to send the character like below shows A,B,C etc..
Press A for enter: RUN - Normal RUN mode Press B for enter: Wait - Wait mode Press C for enter: Stop - Stop mode Press D for enter: VLPR - Very Low Power Run mode Press E for enter: VLPW - Very Low Power Wait mode Press F for enter: VLPS - Very Low Power Stop mode Press G for enter: LLS - Low Leakage Stop mode Press H for enter: VLLS0 - Very Low Leakage Stop 0 mode Press I for enter: VLLS1 - Very Low Leakage Stop 1 mode Press J for enter: VLLS3 - Very Low Leakage Stop 3 mode
I connected FRDM-KL27Z board with UART pins (J1-2 for UART0-Rx, J1-4 for UART0-Tx) and Power supply pins (J3-8 for 3.3V ang J3-12 for GND). In between power supply I connected ammeter/ multimeter with series. I got current drawn results like shown below,
RUN - Normal RUN mode ------> 16.98 mA Wait - Wait mode -----> 12.81 mA Stop - Stop mode -----> 9.99 mA VLPR - Very Low Power Run mode -------> 10.65 mA VLPW - Very Low Power Wait mode ------> 9.90 mA VLPS - Very Low Power Stop mode -------> 9.88 mA LLS - Low Leakage Stop mode -------------> 9.89mA VLLS0 - Very Low Leakage Stop 0 mode ---->Not support LPTMR Wakeup VLLS1 - Very Low Leakage Stop 1 mode ---->9.88 mA VLLS3 - Very Low Leakage Stop 3 mode ---->9.80 mA
Actually expected results in micro amps but we got in milli amps, could you please tell me the reason and help me to resolve this issue.
And you mentioned that you got good result, how much current drawn did you get.
Thanks for being clear, I think you are misunderstanding the power saver mode, this mode only affects the MCU part, I only do not understand how you are measuring the amp with the pins [J3-8 for 3.3V and J3-12 for GND], the best way to get the data corresponding to the Datasheet.
In the schematic of the KL27 you can use the J17, but you need to remove the resistor R2 and R1.
But maybe other components are connected to the same rail and the Amp values could be near to the datasheet. If you need more information please let me know.
Actually now I am enter DEEP_SLEEP mode (Normal Stop mode) and wake up by I2C slave interrupt. after I2C interrupt I can see only 1 byte instead of 2 bytes. After/ 2nd time I can see 2 bytes.
here, 36 77-- I am using for sleep_cmd and
41 B4 using for wakeup_cmd from I2C
And also If I want put micro again in sleep mode It will not go to Sleep mode. It will go only one time to sleep mode. Could you please tell me what I missed.
I suggest reviewing the state of the register from I2C after and before for if something is missing in the configuration in the IDE with help of the peripherals view.
For get in again to the power save mode needs repeat the same steps at the first time, there are some applications notes maybe could help you. Power Management for Kinetis L Family (nxp.com) AN5088 Using Low Power modes on Kinetis family - AN4470 [you can find this in google].
Now I can put micro in sleep and it will wakeup when I2C interrupt occurred.
Here the micro will wakeup both write and read interrupt is occurred. But I want to wake up only when write event / interrupt.
But here I found both cases (write and read) the status register set write bit only, not set for read bit will you please tell me the reason for this and give me some solution.
I think this is not possible because the I2C NVIC will detect the start, I suggest in your code send the device to low power if the R/W bit is R, I do not know how is your final application.
Unfortunately, that interrupt flag is not available, I apologize if this information is not helpful.
Actually after entering the sleep I send read/ write through I2C. But I got only "status 0", means I can wakeup when I2Cslave address matched but read/ write status is always come with write (0) only even if I send read event also.
So is there any pre configuration do I need to set before entering sleep mode for getting read/ write status.
Yes, the matching address is the only wakeup method, I tried that way only however,
we can wakeup from sleep 2 ways like write some data (cmd) to slave or read some data from slave.
And it will wakeup when I2Cslave address matched but read/write status is always come with write (0), even if I send read event. So how will we find the read or write status.
means After sleep first read/ write, can we get status of read/ write along with address. because I can wake up the micro when matching the slave address but not get status bit of read/write it always give "0" only.
Is there any pre configuration do I need to set before entering sleep mode for getting read/ write status ?
Could you share the project? What kind of power saver are you finally using?
Is there any pre-configuration do I need to set before entering sleep mode for getting read/ write status? Let me review more information and when I have more details I will contact you.
Actually I read the KL27 Sub-Family Reference Manual and in this document pg no: 642 & 643
session 36.5.8 Address matching wake-up there is one note is like:
For the SRW bit to function properly, it only supports Address +Write to wake up by I2C address matching. Before entering the next low power mode, Address+Write must be sent to change the SRW status.
In the above note what is the meaning for below line,
Before entering the next low power mode, Address+Write must be sent to change the SRW status.
Means do I need to do any configuration before entering to the next power mode, actually I configure I2C as a slave.
I share the reference document for your reference:
Thanks for sending your information, I apologize for not understanding you, so the reference you sent from the reference manual is on page 642 mention.
After I2C address matching wake-up, the master must wait a time long enough for the slave ISR to finish running and resend start or repeat start signals
This suggests you need to send a command to get out of the Low power mode then the master must wait for the slave to recover then the master needs to send again a command or repeat the start, so that means you do not need any additional configuration.
Edit: I forgot the other part...
Before entering the next low power mode, Address+Write must be sent to change the SRW status.
That's for the MCU when the wake-up recovery from the last state, the last state is waiting or sleep not reset, and the register has the last status.
Best regards, Pavel
0
Kudos
Reply
'
var data = div.getElementsByClassName("video-js");
var script = document.createElement('script');
script.src = "https://players.brightcove.net/" + data_account + "/" + data_palyer + "_default/index.min.js";
for(var i=0;i< data.length;i++){
videodata.push(data[i]);
}
}
}
for(var i=0;i< videodata.length;i++){
document.getElementsByClassName('lia-vid-container')[i].innerHTML = videodata[i].outerHTML;
document.body.appendChild(script);
}
}
catch(e){
}
/* Re compile html */
$compile(rootElement.querySelectorAll('div.lia-message-body-content')[0])($scope);
}
if (code_l.toLowerCase() != newBody.getAttribute("slang").toLowerCase()) {
/* Adding Translation flag */
var tr_obj = $filter('filter')($scope.sourceLangList, function (obj_l) {
return obj_l.code.toLowerCase() === newBody.getAttribute("slang").toLowerCase()
});
if (tr_obj.length > 0) {
tr_text = "This content was translated from lilicon-trans-text using AI-assisted tools.".replace(/lilicon-trans-text/g, tr_obj[0].title);
tr_text +='View original';
try {
if ($scope.wootMessages[$rootScope.profLang] != undefined) {
tr_text = $scope.wootMessages[$rootScope.profLang].replace(/lilicon-trans-text/g, tr_obj[0].title);
tr_text +='View original';
}
} catch (e) {
}
} else {
//tr_text = "This message was translated for your convenience!";
tr_text = "lilicon-trans.your.convenience";
}
try {
if (!document.getElementById("tr-msz-" + value)) {
var tr_para = document.createElement("P");
tr_para.setAttribute("id", "tr-msz-" + value);
tr_para.setAttribute("class", "tr-msz");
tr_para.style.textAlign = 'justify';
var tr_fTag = document.createElement("IMG");
tr_fTag.setAttribute("class", "tFlag");
tr_fTag.setAttribute("alt", "Translate icon");
// tr_fTag.setAttribute("title", "Disclaimer for Translate icon");
tr_fTag.setAttribute("src", "/html/assets/translate-icon.svg");
tr_para.appendChild(tr_fTag);
var container = document.createElement('span');
container.innerHTML = tr_text;
//var tr_textNode = document.createTextNode(container);
tr_para.appendChild(container);
/* Woot message only for multi source */
if(rootElement.querySelector(".lia-message-body-content").previousElementSibling != null && rootElement.querySelector(".lia-message-body-content").previousElementSibling.getAttributeNames().includes("data-generation-timestamp")){
rootElement.querySelector(".lia-message-body-content").previousElementSibling.remove()
}
if(rootElement.querySelector(".lia-quilt-forum-message")){
rootElement.querySelector(".lia-quilt-forum-message .lia-message-body").insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content"));
} else if(rootElement.querySelector(".lia-message-view-blog-topic-message")) {
rootElement.querySelector(".lia-message-view-blog-topic-message .lia-message-body").insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content"));
} else if(rootElement.querySelector(".lia-quilt-blog-reply-message")){
rootElement.querySelector(".lia-quilt-blog-reply-message .lia-message-body").insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content"));
} else if(rootElement.querySelector(".lia-quilt-tkb-message")){
rootElement.querySelectorAll(".lia-quilt-tkb-message .lia-message-body")[0].insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content"));
} else if(rootElement.querySelector(".lia-quilt-tkb-reply-message")){
rootElement.querySelectorAll(".lia-quilt-tkb-reply-message .lia-message-body")[0].insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content"));
} else if(rootElement.querySelector(".lia-quilt-idea-message")){
rootElement.querySelector(".lia-quilt-idea-message .lia-message-body").insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content"));
} else if(rootElement.querySelector(".lia-quilt-idea-reply-message")){
rootElement.querySelector(".lia-quilt-idea-reply-message .lia-message-body").insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content"));
} else if(rootElement.querySelector('.lia-quilt-occasion-message')){
rootElement.querySelector('.lia-quilt-occasion-message .lia-message-body').insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content"));
}
else {
if (rootElement.querySelectorAll('div.lia-quilt-row-footer').length > 0) {
rootElement.querySelectorAll('div.lia-quilt-row-footer')[0].appendChild(tr_para);
} else {
rootElement.querySelectorAll('div.lia-quilt-column-message-footer')[0].appendChild(tr_para);
}
}
}
} catch (e) {
}
}
} else {
/* Do not display button for same language */
// syncList.remove(value);
var index = $scope.syncList.indexOf(value);
if (index > -1) {
$scope.syncList.splice(index, 1);
}
}
}
}
}
}
/*if(mszList_l.length <= 0){
setTimeout(()=>{
var mszListl = [];
angular.forEach(document.querySelectorAll("[class*='lia-js-data-messageUid']"), function(element) {
var mszId = element.getAttribute("data-lia-message-uid");
if (mszId != null) {
mszListl.push(mszId);
}
});
var mszListid = mszListl;
console.log("mszListl:",mszListl);
},2000)
}else{
var mszListid = mszList_l;
}*/
console.log("mszList_l:",mszList_l.length);
angular.forEach(mszList_l, function (value) {
if (document.querySelectorAll('div.lia-js-data-messageUid-' + value).length > 0) {
var rootElements = document.querySelectorAll('div.lia-js-data-messageUid-' + value);
}else if(document.querySelectorAll('.lia-occasion-message-view .lia-component-occasion-message-view').length >0){
var rootElements = document.querySelectorAll('.lia-occasion-message-view .lia-component-occasion-message-view')[0].querySelectorAll('.lia-occasion-description')[0];
}else {
var rootElements = document.querySelectorAll('div.message-uid-' + value);
}
angular.forEach(rootElements, function (rootElement) {
if (value == '1509873' && "ForumTopicPage" == "TkbArticlePage") {
rootElement = document.querySelector('.lia-thread-topic');
}
/* V1.1 Remove from UI */
if (document.getElementById("tr-msz-" + value)) {
document.getElementById("tr-msz-" + value).remove();
}
if (document.getElementById("tr-sync-" + value)) {
document.getElementById("tr-sync-" + value).remove();
}
/* XPath expression for subject and Body */
var lingoRBExp = "//lingo-body[@id = "+"'lingo-body-"+value+"'"+"]";
lingoRSExp = "//lingo-sub[@id = "+"'lingo-sub-"+value+"'"+"]";
/* Get translated subject of the message */
lingoRSXML = doc.evaluate(lingoRSExp, doc, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for(var i=0;i 0){
angular.forEach(document.querySelectorAll(".PageTitle"), function(subEle) {
subEle.textContent = sub_L;
});
}
}
}
// Label translation
try{
var labelEle = document.querySelector("#labelsForMessage");
if(!labelEle){
labelEle = document.querySelector(".LabelsList");
}
if(labelEle) {
var listContains = labelEle.querySelector('.label');
if (listContains) {
/* Commenting this code as bussiness want to point search with source language label */
// var tagHLink = labelEle.querySelectorAll(".label")[0].querySelector(".label-link").href.split("label-name")[0];
var lingoLabelExp = "//lingo-label/text()";
trLabels = [];
trLabelsHtml = "";
/* Get translated labels of the message */
lingoLXML = doc.evaluate(lingoLabelExp, doc, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
var labelsLength = document.querySelector(".LabelsList").querySelectorAll(".label").length;
var labelSnapshotLength = lingoLXML.snapshotLength;
if (labelsLength == labelSnapshotLength){
for (var k = 0; k < lingoLXML.snapshotLength; k++) {
//trLabels.push(lingoLXML.snapshotItem(i).textContent);
if (k != 0) {
//trLabelsHtml = trLabelsHtml + '