 OK, mae'n rhaid i gydrwg. ac mae'n ddiddordeb i gweithio'r gwyfaint o'r ddraeth fel fyddai'n ddiddordeb i'n gwybosol fel FFM fel now. A now, yn ddiddordeb i'w ddiddordeb, mae'r ddiddordeb i'r ddiddordeb a'r ddiddordeb i'r ddiddordeb o'r ddiddordeb. Mae'n ddiddordeb i'r ddiddordeb i'r ddiddordeb ac ydych yn termitech, mae'n gweithio'r UART yn ystod o'r informacio ar y cerddwyr. Felly mae'n gweithio'r cymdeithas o'r disblwyd. ac mae'n ddysgu'r gwaith o'r gwaith, ac mae'n ddysgu'r gwaith o'r gwaith o'r amlwg, ac mae'n ddysgu'r gwaith o'r amlwg o'r amlwg. So ydych chi yw'ch chi'n siarad o'r mwybod yw'r siarad, a'r siarad i'w'ch chi'n siarad o'r fwg ddaurau i'r dilydd. Ac mae'r rhaid i'r rhaid i'r amlwg arall y rhaid i'r rhaid, am ddysgu'r cysylltio ac amser hynny'n ei ddim. Rhaid i'r siarad arall deithoedd o'r chloes, a yna os i'r mwybod maen nhw'n gwneud hynny yw'n gw immigrant o'r mwybod ddysgu. nid y dyfynnu am ymwysig ti, ac yn gweithio'r ffordd o'r ffordd o'r ffordd o'r unigx pryd wrthивul yn gwheithio pa'r moden stylau mawr, ac mae wedi ddweud o'r peryffyrhys iawn yr aethau yn ei ffathfa i'r moden stylau mwyaf. Dwi'n meddwl yno, mae hynny yn moden stylau moden a moden stylau moden. Moden stylau moden yn hynny yn y moden stylau moden wrth meddwl am y moden stylau moden, but stop mode 1 has more peripherals that are able to wait the device. So, if we now look at stop mode 1, you can see from the screen that the peripheral tree now is a lot more limited. So all the core is switched off, so we've got no activity going on the core. Rwy'r cyfle i'r rhesyp hyn yn ôl am gyfrannu cwr Yunhwyr iawn, mae'r rhesyp hyn yn syniadol gyda hynny. Mae'r llwp o hyn y mae'r cyfle i Llyfr, ardi fod y RTC, ond mae'r cyfle i weld ffordd trwy sydd ffordd. Fy rhesyp hynna i'r mae'r llwys, oedd mae'r cyflyb gwaith yr ingen, Ond y llwyfb yn gweithio, cydweud rwy'n gweithio bod y DAO ychydig i gyrdd i gyfan o'r cyfeidio y dyfael. Ond ydy o'ch creduon cyffredinol mae'r dweudio 7,1 microamps. A bydd y dweudio dweudio 6,6 microamps. Felly mae'r ydych chi'n gweithio'r tîm yn 4-6 microsecwn, ydych chi'n gweithio'r gweithio'r ram o'r fflash, ac mae'n gweithio ar 48 MHz, mae'n gweithio'r gweithio'r gweithio'r gweithio'r gweithio'r gweithio'r gweithio'r gweithio'r gweithio'r gweithio'r 48 MHz. Felly mae'r gweithio'r ram o'r 6.3 microsecwn ar gweithio'r stop mode a lle mae'n gweithio'r gweithio'r ram o'r fflash. Felly mae'n gweithio'r multimeter gan gweithio'r gweithio'r ram o'r fflash. Felly, ydych chi'n gweithio'r eich gweithio'r dynnu, felly, yn y seision 1, yw eich gweithio'r no 4, yw'r gwirio'r gweithio'r stop 1. Yn y termite, rwy'n gweithio'r eich gweithio'r eich gweithio'r eich gweithio. Yn y gweithio'r seision 1, yw'r gweithio'r stop mode 1. Yn y project, yw'r project. If ff7 to build, okay iti is already up to date. Now if I project download and potentinious Download application, press my reset button on my target board. My screen is now showing me that I am down at 0.00. I will need to change my multimeter now to go down into the microamp spectrum so I can actually see a reading. My meter now is showing in the microamps about three and a half microamps so it's actually lower than what we're showing on the slide. I will have to turn it back to the milliamp region when I press a button because when the device goes back into the run mode you will be running up in milliamps. So every time I press the button I can see that the button interrupt is jumping me up to about 100 and 400, anywhere from 100 to 400 milliamps so that I'm simulating the pulse count and then you will get the same increase as you switch between the various modes so that your display will show the serial number and the average flow rate. So you will still see a change on your ammeter at that point. So if I now leave it stable for a bit and don't press any buttons then the RTC interrupt will come along and that will refresh the screen so you will see a jump on your ammeter when the RTC interrupt fires. I think you have to wait about one minute if I remember correctly before the RTC will come round and trigger an interrupt and then you will hopefully see a second interrupt going on apart from the button press that is on the board. So there we go I saw my screen then jump from about so many microamps up to about 140 milliamps then so the RTC triggered the ammeter as it put the device back into its run state so that it can service the volume and update the LCD. So my external button interrupt works and the RTC interrupt works. Through the terminal program we can send a command in which should send again the device through to the run mode from the stop mode. So stop mode number two is the lower current consumption but as you can see on the right hand side we've lost some of the periphery now. So there's less events able to wake us up and on the left hand side of the screen you can see a lot less peripherals that are available to run in the stop mode number two. This means that we can now get down to about 1.7 microamps with the RTC running and about 1.2 microamps without the RTC running. Slight increase in your startup time so rather than four to six we're now at five to eight microseconds but we can still jump straight to 48 megahertz of a processing power within the application. So the next hand's on so this one now is doing pretty much the same as we've just been through. But this time we've only got the RTC and the bottom triggering our water meter for our flow diagram and you can enable or disable the LCD in this mode to reduce the current even further. So it's just the same as exactly the same as before but this time we will be down a lot lower so we were around six and a half microamps. I think my board was showing about three ish microamps so this one now should be down at least two microamps. So if we go and open example number five then we will be able to see a slightly same example but slightly lower current consumption configuration. I'll close my IAR again and go into example number five and open the project EWW. F7 to build the project again mine is already built so now it's project download download active application program the board. There we go. So now when I press my black reset button my display is lighting up and now if I put my meter into the microamp area I'm now down at about 1.9 microamps for when we're in stop mode. As soon as you press the button you will still jump back into run mode so you'll still jump back into the run mode where you're up at the hundreds of milliamps again but now we're down a lot closer to this two microamp area. So my LCD has now automatically switched off and I'm still sat around the 1.99 to two microamps area. So all because we're in stop mode number two you can reduce the current consumption again slightly more from what we had in stop mode number one. So here's the comparison of the two stop modes. Everything's taken at 25 degrees and three volts here so you can see you can save about five microamps without the RTC running just between stop mode one and stop mode two which depending on what you're doing in the application could be significant especially if you're running from a battery. The wake up time that you've got between those two different stop modes is not that significant one two microseconds difference. So again the wake up time isn't really impacted because stop mode is the same it's just the number of peripherals that are there. Your wake up clock is identical so you can instantly jump to 48 megahertz and you have a selection of common peripherals which are always available and then the more complex peripherals are different between the two different versions of the stop mode. So it provides you with a lot of flexibility depending on what you need within your application. So after stop mode we then get into standby mode so this is the lowest power mode that you can use where you still retain some information in your SRAM. So we can now get down to about 150 nanoamps if we're not retaining the SRAM. So again it depends on what you're doing and we've now got five wake up pins that can bring us out of this. So standby mode there's no peripheral registers retained so we are down now to the wake up pins only that we can bring the device out of standby mode. So if we now look at what's available to us so the SRAM as I said is optional you can either have a with or without the SRAM. All the peripherals now are powered down apart from the two peripherals that are running from the low speed clocks if you've enabled them independent watchdog RTC. And now your wake up events are a lot more limited so you've got the wake up pins anything with the RTC or the tamper detect if you've enabled it and then the independent watchdog. But this means without the SRAM and without the RTC we're now down at about 150 nanoamps available to us. So if we have a look at an example on standby so again we're back to a data logging application so we're logging long term temperature information. And what we do here is we enter the application configure all the peripherals service the ADC and the LCD then drop into standby. Every time the RTC wakes us up we come back for the reset reconfigure do our ADC log the information then go back into standby again. So this is all done using a four megahertz clock. And what we will see on our display is what happens every time we wake the device based on the RTC triggering us. So every 10 seconds the MCU wakes up will reform the task and go back to sleep. So you'll see the temperature reading you'll see how many times you've woken up. And this means we can get down to an average current consumption of around 900 nanoamps in this one because we are maintaining the SRAM to keep a track of all our data variables. So if we now open our example number six the long term data logging example I can close my IAR go back into the example. So example number six EWARM project EWW. There's our example. If I build the example F7 my configuration is already up to date. And if I scroll down you can see what we're actually doing in the code. So we enable the SRAM content so that we can retain the information increment our log buffer. Disable all the used wake up sources. Clear all the wake up flags. Enable the wake up pin that we're going to use or the wake up source we're going to use. And then enter the standby mode. So that's all we do. And then we will just come round when we exit standby we'll come back for a reset when we'll come back and re-execute all this information again. So if I now program the board project download download active application. So my board is now programmed. So if I now press my black reset button so it briefly told me the temperature then before it went to sleep I'm now down at 970, 980 nanoamps. 10 seconds came round again. My screen briefly flashed up the cycle count and the current temperature reading. And then it keeps going round that loop. So this is just a very very simple loop using the RTC using the 32K of SRAM to store the information. And it keeps going round standby and then through the reset reconfigure update the log drop back into standby mode. So again a very low powered data logging application. So you'll briefly see on your screen as it cycles round the loops you'll see the cycle count and the current temperature reading that's been logged. And finally the last power mode is the shutdown mode. So again very similar to standby. But now we've removed some of the power monitoring the brown out reset and the switch over to the backed pin. We've got no LSI enabled now in this example and no independent watchdog. So the only backup we have are the 128 bytes of backup registers. And again you wake up sources are the pins or the RTC if you have enabled it. So this is what our picture looks like now. So we only have the RTC running off the LSE if you enable it. And then your wake up events now are the reset, the five wake up pins and RTC and Tampa if you have enabled it. So this means we can get down to with the RTC running to providers regular wake ups about 550 nanoamps. If you just want to use the wake up pin we can get down to about 60 nanoamps on this one. So we've got a very good low power consumption mode here with shutdown. So we now have a look at our example. So we're going back to our water meter example again that we used in stop mode number two. And what we're doing here is the MCU will enter shutdown mode to make sure the battery or the power source on this device lasts as long as possible. Then when the button is held down for at least two seconds, then the MCU will start executing and run example number five as its continuous loop. So this is a very good way of using the a battery powered application that potentially could end up sitting on a shelf for months to years. But there's no way of being able to attach or retrigger the device. So normally a water meter because it's going to get buried underground at manufacturing it'll be sealed so that no moisture can get inside the unit. So at manufacturing this is when we would enter it into shutdown mode. So we've connected the battery but we're not actually doing anything. And then when the installer puts it in the ground for us we're using the button to signify the flow. On this one the impeller and the flow of water will trigger the counter to start moving. And then that will start the application off where we cycle between run and stop for the rest of the lifetime of the product. So what we have here we have to completely discharge the board first and then we will press and hold the button for the two seconds for it to then start executing its example number five again. But right at the start we should be able to see if your ammeter will run that low the nanoamp range. So if we go and open the last example example number seven close the previous example. Go into example number seven project EWW. If I build the project projects built and now if I go project download download active application. So everything's now programmed into my board. So for this one I will now completely disconnect my power source. So I have to disconnect my USB mini cable.