8月15号收到RL78/G13开发板了,先感谢一下EEPW,RENESAS!
共5条
1/1 1 跳转至页

定时器的使用程序:
void main(void)
{
/* Start user code. Do not edit comment generated here */
R_TAU0_Channel0_Start();
while (1U)
{
};
}
timer代码如下:
__interrupt static void r_tau0_channel0_interrupt(void)
{
/* Start user code. Do not edit comment generated here */
tinernum++;
if(tinernum==5) P7.7=0;
if(tinernum>=10)
{
P7.7=1;
tinernum=0;
}
void main(void)
{
/* Start user code. Do not edit comment generated here */
R_TAU0_Channel0_Start();
while (1U)
{
};
}
timer代码如下:
__interrupt static void r_tau0_channel0_interrupt(void)
{
/* Start user code. Do not edit comment generated here */
tinernum++;
if(tinernum==5) P7.7=0;
if(tinernum>=10)
{
P7.7=1;
tinernum=0;
}

使用Applilet完成定时D2 LED闪烁。
1,使用Applilet3建立一个工程。
2,设置Watchdog timer operation setting 为 Unused.
3,设置Timer-> General setting->functions->channel 0 为 Interval timer.
4,设置Channel0 -> Interval value (16bit) 值为 500ms.
5,设置Port-> port7-> P77 为 out ,选中 1, 选中 Change I/O by software.
6,设置 Options菜单-> compiler type-> IAR compiler.
7,点击Generate code ,生成IAR工程。
8,用IAR打开工程文件
9,修改CG_main.c文件main函数。
void main(void)
{
/* Start user code. Do not edit comment generated here */
TAU0_Channel0_Start(); //启动定时计数器
while (1U)
{
;
}
/* End user code. Do not edit comment generated here */
}
10,修改 CG_timer_user.c文件 MD_INTTM00函数。
__interrupt void MD_INTTM00(void)
{
/* Start user code. Do not edit comment generated here */
P7_bit.no7 = ~ P7_bit.no7;
/* End user code. Do not edit comment generated here */
}
11, 设置Project -> Options->Debugger->Driver 为TK。
12,将开发板J6-9四跳线帽搠1-2.
13,点击Download and Debug。完成
1,使用Applilet3建立一个工程。
2,设置Watchdog timer operation setting 为 Unused.
3,设置Timer-> General setting->functions->channel 0 为 Interval timer.
4,设置Channel0 -> Interval value (16bit) 值为 500ms.
5,设置Port-> port7-> P77 为 out ,选中 1, 选中 Change I/O by software.
6,设置 Options菜单-> compiler type-> IAR compiler.
7,点击Generate code ,生成IAR工程。
8,用IAR打开工程文件
9,修改CG_main.c文件main函数。
void main(void)
{
/* Start user code. Do not edit comment generated here */
TAU0_Channel0_Start(); //启动定时计数器
while (1U)
{
;
}
/* End user code. Do not edit comment generated here */
}
10,修改 CG_timer_user.c文件 MD_INTTM00函数。
__interrupt void MD_INTTM00(void)
{
/* Start user code. Do not edit comment generated here */
P7_bit.no7 = ~ P7_bit.no7;
/* End user code. Do not edit comment generated here */
}
11, 设置Project -> Options->Debugger->Driver 为TK。
12,将开发板J6-9四跳线帽搠1-2.
13,点击Download and Debug。完成
共5条
1/1 1 跳转至页
回复
打赏帖 | |
---|---|
【Zephyr】使用Zephyr外设初始化过程解析被打赏30分 | |
【S32K146】S32DS watchdog 配置使用被打赏20分 | |
【Zephyr】使用 IAR 调试 Zephyr 镜像被打赏20分 | |
赚取电动螺丝刀+电源电路理论知识分享1被打赏5分 | |
我想要一部加热台+分享常见运算放大器电路的应用被打赏5分 | |
【Zephyr】MCXN947 Zephyr 开发入门适配shell被打赏20分 | |
我想要一部加热台+常见的MOS管驱动电路被打赏5分 | |
【我要开发板】6.联合MATLAB记录数据被打赏50分 | |
【换取手持数字示波器】MicrochipMPLABHarmony框架下串口调试printf输出记录被打赏29分 | |
【瑞萨RA2E1开发板】:使用ADC功能实现位移传感器采集方案被打赏20分 |