接上文【RA-Eco-RA0E1-32PIN-V1.0开发板试用】开箱+环境搭建
Systick定时器就是系统一个简单的24位的倒计数定时器
寄存器 |
地址(相差4个字节) |
功能 |
---|
CTRL |
0xE000E010 |
SysTick 控制和状态寄存器 |
LOAD |
0xE000E014 |
SysTick 自动重装载除值寄存器 |
VAL |
0xE000E018 |
SysTick 当前值寄存器 |
CALIB |
0xE000E01C |
SysTick 校准值寄存器 |
开发板软件mdk5调试时可显示运行时寄存器的状态:
while(1){
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_01_PIN_03, 0);
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_01_PIN_12, 0);
Systick1();
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_01_PIN_03, 1);
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_01_PIN_12, 0);
Systick1();
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_01_PIN_03, 1);
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_01_PIN_12, 1);
Systick1();
}
* 在void hal_entry(void)程序前加入Systick1()
void Systick1()
{SysTick ->CTRL = 0;
SysTick-> LOAD =0xFFFFFF; //???? 255~(256 ???)
SysTick -> VAL =0; //??????????
SysTick ->CTRL= 5; //?? SysTick ???????????
while((SysTick->CTRL&0x00010000)==0); //????????
SysTick->CTRL = 0;}
Program Size: Code=1736 RO-data=232 RW-data=0 ZI-data=1652
FromELF: creating hex file...
After Build - User command #1: cmd /c "start "Renesas" /w cmd /c ""E:\lst\ra0e1-20240827154516\123\FSP_Projectnew\rasc_launcher.bat" "E:\lst\ra0e1-20240827154516\123\FSP_Projectnew\rasc_version.txt" -nosplash --launcher.suppressErrors --gensmartbundle --compiler ARMv6 --devicefamily ra "E:\lst\ra0e1-20240827154516\123\FSP_Projectnew\configuration.xml" "E:\lst\ra0e1-20240827154516\123\FSP_Projectnew\Objects\FSP_Project.axf" 2> "%TEMP%\rasc_stderr.out"""
".\Objects\FSP_Project.axf" - 0 Error(s), 44 Warning(s).
Build Time Elapsed: 00:00:29```
VID_20241005_075940
|