TM4C123GH6PM | Hibernation mode | Hibernation mode in TM4C Launch Pad | hibernate | Power saving mode
- Get link
- X
- Other Apps
Hibernation mode in TM4C Launch Pad
Program
#include <stdint.h>
#include <stdbool.h>
#include "utils/ustdlib.h"
#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "driverlib/sysctl.h"
#include "driverlib/pin_map.h"
#include "driverlib/debug.h"
#include "driverlib/hibernate.h"
#include "driverlib/gpio.h"
int main(void)
{
SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x08);
SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);
HibernateEnableExpClk(SysCtlClockGet());
HibernateGPIORetentionEnable();
SysCtlDelay(64000000);
HibernateRTCSet(0);
HibernateRTCEnable();
HibernateRTCMatchSet(0,5);
HibernateWakeSet(HIBERNATE_WAKE_PIN | HIBERNATE_WAKE_RTC);
GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_3, 0x00);
HibernateRequest();
while(1)
{
}
}
#include "utils/ustdlib.h"
#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "driverlib/sysctl.h"
#include "driverlib/pin_map.h"
#include "driverlib/debug.h"
#include "driverlib/hibernate.h"
#include "driverlib/gpio.h"
int main(void)
{
SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x08);
SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);
HibernateEnableExpClk(SysCtlClockGet());
HibernateGPIORetentionEnable();
SysCtlDelay(64000000);
HibernateRTCSet(0);
HibernateRTCEnable();
HibernateRTCMatchSet(0,5);
HibernateWakeSet(HIBERNATE_WAKE_PIN | HIBERNATE_WAKE_RTC);
GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_3, 0x00);
HibernateRequest();
while(1)
{
}
}
Procedure
1. Create a new folder on desktop location.
2.
Open ccstudio on desktop.
3.
Browse the workspace location
Click on browseàdesktopàselect created folderàok button.
4.
ccs wizard is opened
Click on projectànew ccs projectàtarget [select Tiva c series].
5. Select microcontroller “Tiva TM4C123GH6PM”, click on connection and select “Stellaris in-circuit debug interface”.
6. Name the project in project name bar and click on finish button.
7.
Click on restore button on left side
and then enter the programà save button.
8.
Now unfold the project and right click on project and select properties.
9. Select include optionsàaddàbrowseàmy computeràlocal disc càtià Tivaware_c_series_2.1.2.111àok. Now directory path is added to project then click on ok button.
10. Select projectà Right click on
project à add files à select local disc cà
select tià
Tivaware_c_series_2.1.2.111 àselect driverlib
à ccs à debug à driverlib.lib à open button.
11.
Select copy files and click ok button. Now driver library file is added to the project.
12.
To build the project click on Build
button.
13. After building the project is finished. Connect TM4C launch pad to pc using USB cable.
14. Before debugging set the launch pad in debug mode by pushing wake up pin and click on debug button in
ccstudio and then click on Resume button.
TM4C123GH6PM Overall Documentation in video description
Video 👇
Comments
Post a Comment