This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] EK-LM4F120XL:一段时间后不会发生重复休眠

Guru**** 657870 points
Other Parts Discussed in Thread: EK-TM4C123GXL
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/761394/ek-lm4f120xl-repeated-hibernation-does-not-take-place-after-a-while

器件型号:EK-LM4F120XL
Thread 中讨论的其他器件: EK-TM4C123GXL

您好!

我正在尝试在 EK-LM4F120XL 上实现简单的功能 。 基本上、该器件必须进入休眠回路、在唤醒时、它应点亮蓝色红色、并将当前温度值从处理器的传感器传递到 UART。 使用下面的代码、我描述的功能会在不确定的时间内工作、但会暂停。 无 LED 照明或 UART 侧无输出。 如果您能查看我的代码并告诉我缺少什么、我会非常高兴。 谢谢!

#include 
#include 
include "utils/ustdlib.h"
#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "inc/hw_gpio.h"
#include "driverlib/syssctl.h"
#include "driverlib/pin_map.h"
#include "driverlib/debug.idio"




#include "driverlib.idio.idio"



#include "driverlib.idio.h #include "#driverlib"#driverlib.idio.ide"#include "driver.h"#include "driverlib.udio.idio.ide"#include "driverlib.idio.ide"#include "#include "#include "#driverlib.ude.h.udio.ide"#include "#.idio.ide"#include "#

//
//启用 UART 使用的 GPIO 外设。
//
SysCtlPeripheralEnable (SYSCTL_Periph_GPIOA);

//
//启用 UART0
//
SysCtlPeripheralEnable (SYSCTL_Periph_UART0);

//
//为 UART 模式配置 GPIO 引脚。
//
GPIOPinConfigure (GPIO_PA0_U0RX);
GPIOPinConfigure (GPIO_PA1_U0TX);
GPIOPinTypeUART (GPIO_Porta_base、GPIO_PIN_0 | GPIO_PIN_1);

//
//使用内部16MHz 振荡器作为 UART 时钟源。
//
UARTClockSourceSet (UART0_BASE、UART_CLOCK_PIOSC);

//
//初始化控制台 I/O 的 UART
//
UARTStdioConfig (0、115200、16000000);
}

int main (void)
{
uint32_t ui32ADC0Value[4];
volatile uint32_t ui32TempAvg;
volatile uint32_t ui32TempValueC;
易失性 uint32_t ui32TempValueF;

SysCtlPeripheralEnable (SYSCTL_Periph_HIBERNATE);

if (HibernateIsActive()){
HibernateGPIORetentionDisable ();
}
FPULazyStackingEnable ();

ExpCtlClockSet (SYSCTL_5|SYSCTAL_USE_PLL|SYSCTL_XMHZ);

SysCtl_SysClockett (SysCltl);SysClocket_Ontl (SysClet_Ontl)(SysClet_Ontl)


HibernateGPIORetentionEnable();
HibernateRTCEnable();
HibernateRTCSet (0);
HibernateRTCMatchSet (0,5);
HibernateWakeSet (HIBERNATE_WAKE_PIN| HIBERNATE_WAKE_RTC);

GPIOPinTypeGPIOOutput (GPIO_PORTF_BASE、GPIO_PIN_2);

//添加
了 SysCtlPeripheralEnable (SYSCTL_Periph_ADC0);

ADCSequenceConfigure (ADC0_BASE、1、ADC_TRIGGER_PROCESSOR、0);
ADCSequenceStepConfigure (ADC0_BASE、1、0、ADC_CTL_TS);
ADCSequenceStepConfigure (ADC0_BASE、1、1、ADC_CTL_TS);
ADCSequenceStepConfigure (ADC0_BASE、1、2、ADC_CTL_TS);
ADCSequenceStepConfigure (ADC0_BASE、1、3、ADC_CTL_TS|ADC_CTL_IE|ADC_CTL_END);
ADCSequenceEnable (ADC0_BASE、1);
//结束添加

//
//初始化 UART。
//
ConfigureUART();

//
//您好!
//
//UARTprintf ("Hello、world!\n");

GPIOPinWrite (GPIO_PORTF_BASE、GPIO_PIN_2、GPIO_PIN_2);

//
//延迟一位。
//
//SysCtlDelay (SysCtlClockGet ()/ 10 / 3);

//
//关闭蓝色 LED。
//
//GPIOPinWrite (GPIO_PORTF_BASE、GPIO_PIN_2、0);

//
//延迟一位。
//
//SysCtlDelay (SysCtlClockGet ()/ 10 / 3);

//添加
了 ADCIntClear (ADC0_BASE、1);
ADC26ProcessorTrigger (ADC0_BASE、1);

while (!ADCIntStatus (ADC0_BASE、1、false)
{
}

ADCSequenceDataGet (ADC0_BASE、1、ui32ADC0Value);
ui32Avg =(u32ADC0Ctl[0]+ u324096
)


+ UART3220C (u32UART3+ U32UUUUUUUUU406U406U406U406U406U406U406U406Ut)(UART32U32U32U406U406U406U406U406U405+ U32C)+ U32U32U32U406U32U32U406U406U406U406U32U406U406U32U32U406U406U406U406U406U406U406U406U406U405+U405+U402U405

GPIOPinWrite (GPIO_PORTF_BASE、GPIO_PIN_2、0);
//添加了 End

HibernateRequest ();
while (1)
{
}