pic16f15244-wdt-wake-up

所属分类:collect
开发工具:C
文件大小:0KB
下载次数:1
上传日期:2023-06-02 02:31:53
上 传 者sh-1993
说明:  该项目演示了使用看门狗计时器(WDT)将设备从睡眠中唤醒。
(This project demonstrates the use of the Watchdog Timer (WDT) to wake up the device from sleep.)

文件列表:
.citd/ (0, 2023-05-30)
.citd/Jenkinsfilek8s (1566, 2023-05-30)
.citd/cloudprovider.yml (386, 2023-05-30)
.main-meta/ (0, 2023-05-30)
.main-meta/main.json (1801, 2023-05-30)
images/ (0, 2023-05-30)
images/MakeAndProgramButton.png (57393, 2023-05-30)
images/NanoHighlights.png (116448, 2023-05-30)
images/OpenProject.png (43099, 2023-05-30)
images/ProgramSuccess.png (15053, 2023-05-30)
images/SelectTool.png (53640, 2023-05-30)
images/WDTConfig.png (14173, 2023-05-30)
images/WDTConfig2.png (38848, 2023-05-30)
images/microchip.png (38143, 2023-05-30)
pic16f15244-wdt-wake-up.X/ (0, 2023-05-30)
pic16f15244-wdt-wake-up.X/Makefile (3381, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/ (0, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/default/ (0, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/default/debug/ (0, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/default/debug/compiler_support.d (121, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/default/debug/compiler_support.i (1649, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/default/debug/compiler_support.p1 (5225, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/default/debug/memoryfile.xml (434, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/default/debug/pic16f15244-wdt-wake-up.X.debug.cmf (30687, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/default/debug/pic16f15244-wdt-wake-up.X.debug.elf (10035, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/default/debug/pic16f15244-wdt-wake-up.X.debug.hxl (2373, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/default/debug/pic16f15244-wdt-wake-up.X.debug.lst (114085, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/default/debug/pic16f15244-wdt-wake-up.X.debug.map (42669, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/default/debug/pic16f15244-wdt-wake-up.X.debug.mum (350, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/default/debug/pic16f15244-wdt-wake-up.X.debug.o (6660, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/default/debug/pic16f15244-wdt-wake-up.X.debug.rlf (124405, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/default/debug/pic16f15244-wdt-wake-up.X.debug.sdb (5488, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/default/debug/pic16f15244-wdt-wake-up.X.debug.sym (10565, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/free/ (0, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/free/debug/ (0, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/free/debug/compiler_support.d (118, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/free/debug/compiler_support.i (1649, 2023-05-30)
pic16f15244-wdt-wake-up.X/dist/free/debug/compiler_support.p1 (5225, 2023-05-30)
... ...

MCHP # Wake-up from Sleep using the Watchdog Timer with PIC16F15244 The 'pic16f15244-wdt-wake-up' code example uses the PIC16F15244 Curiosity Nano Development board to demonstrate how to use the Watchdog Timer (WDT) to wake up the microcontroller when it is in Sleep mode. ##### PIC16F15244 Curiosity Nano Development Board: ![Curiosity Nano Development Board](https://github.com/microchip-pic-avr-examples/pic16f15244-wdt-wake-up/blob/master/images/NanoHighlights.png) ## Related Documentation - [PIC16F15244 Product Page](https://github.com/microchip-pic-avr-examples/pic16f15244-wdt-wake-up/blob/master/https://www.microchip.com/wwwproducts/en/PIC16F15244) ## Software Used - MPLAB X IDE 6.10 or newer [(microchip.com/mplab/mplab-x-ide)](https://github.com/microchip-pic-avr-examples/pic16f15244-wdt-wake-up/blob/master/http://www.microchip.com/mplab/mplab-x-ide) - MPLAB XC8 2.41 or a newer compiler [(microchip.com/mplab/compilers)](https://github.com/microchip-pic-avr-examples/pic16f15244-wdt-wake-up/blob/master/http://www.microchip.com/mplab/compilers) - MPLAB Code Configurator (MCC) 5.3.7 or newer [(microchip.com/mplab/mplab-code-configurator)](https://github.com/microchip-pic-avr-examples/pic16f15244-wdt-wake-up/blob/master/https://www.microchip.com/mplab/mplab-code-configurator) - Microchip PIC16F1xxxx Series Device Support (1.18.352) or newer [(packs.download.microchip.com/)](https://github.com/microchip-pic-avr-examples/pic16f15244-wdt-wake-up/blob/master/https://packs.download.microchip.com/) ## Hardware Used - PIC16F15244 Curiosity Nano [(EV09Z19A)](https://github.com/microchip-pic-avr-examples/pic16f15244-wdt-wake-up/blob/master/https://www.microchip.com/Developmenttools/ProductDetails/EV09Z19A) - Micro-USB to USB 2.0 cable ## Setup 1. Connect the PIC16F15244 Curiosity Nano board to a PC using the Micro-USB to USB 2.0 cable. 2. If the system not ready, download and install MPLABX IDE version 6.10 (or newer). 3. If the system not ready, download and install the XC8 C-Compiler version 2.41 (or newer). 4. Open the 'pic16f15244-wdt-wake-up.X' project as shown in Figure 1. ###### Figure 1: Open Project Window ![Open Project Window](https://github.com/microchip-pic-avr-examples/pic16f15244-wdt-wake-up/blob/master/images/OpenProject.png) 5. Click-> **Project Properties** button to open the Project Properties window. Select the Curiosity tool from the Tools drop-down menu as shown in Figure 2. ###### Figure 2: Select the Nano in Project Properties Window ![Select Tool](https://github.com/microchip-pic-avr-examples/pic16f15244-wdt-wake-up/blob/master/images/SelectTool.png) 6. Click-> **Make and Program Device** button to program the PIC (see Figure 3). Verify that the device was successfully programmed (see Figure 4). ###### Figure 3: 'Make and Program Device' Button ![Program Device Button](https://github.com/microchip-pic-avr-examples/pic16f15244-wdt-wake-up/blob/master/images/MakeAndProgramButton.png) ###### Figure 4: Program Complete ![Program Complete](https://github.com/microchip-pic-avr-examples/pic16f15244-wdt-wake-up/blob/master/images/ProgramSuccess.png) ## Operation After the Nano board is programmed, the Watchdog Timer is enabled, and LED0 will be in its 'ON' state. After a one second delay, the `SLEEP()` command is issued, which puts the microcontroller into its Sleep state. If the WDT reaches its maximum time period before a Clear WDT (`CLRWDT()`) command is issued, the WDT will wake up the device. The WDT can be used to reset a program, if the program stops executing code for a certain amount of time, or as a way to wake up the device after a period of time. In this example, the WDT is configured to time-out after approximately four seconds (see Figure 5). When the time-out occurs, the microcontroller wakes up, and begins to toggle LED0 every 500 ms. Example 1 shows the `main()` loop, which executes the `SLEEP()` command, and begins to toggle LED0 after the WDT wakes up the device. ###### Figure 5: WDT Configuration in MCC ![WDT Configuration](https://github.com/microchip-pic-avr-examples/pic16f15244-wdt-wake-up/blob/master/images/WDTConfig.png) ###### Example 1: Main() Code Snippet int main(void) { SYSTEM_Initialize(); CLRWDT(); // Clear WDT LED0_SetLow(); // Turn ON LED __delay_ms(1000); //Delay 1 Second SLEEP(); //Issue Sleep Command while(1) { LED0_Toggle(); //Toggle LED __delay_ms(500); // Delay 500 Milli Second CLRWDT(); // Clear WDT } } ## Summary The 'pic16f15244-wdt-wake-up' code example uses the PIC16F15244 Curiosity Nano Development board to demonstrate how to use the Watchdog Timer (WDT) to wake up the microcontroller when it is in Sleep mode.

近期下载者

相关文件


收藏者