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 跳转至页
回复
我要赚赏金打赏帖 |
|
|---|---|
| 在K230DBOX上实现多时段语音提示功能被打赏¥14元 | |
| 使K230DBOX实现相机持续拍照功能被打赏¥12元 | |
| 基于K230DBOX的文本管理器设计被打赏¥14元 | |
| 基于K230DBOX的彩色画板功能实现被打赏¥15元 | |
| 在K230DBOX上实现音乐播放器功能被打赏¥15元 | |
| NXP MCU系列开发板MCULink固件升级方法【VSCode】被打赏¥28元 | |
| 三分钟快速搭建NXP MCU开发环境(VSCode)被打赏¥22元 | |
| 为遥控小车巧添功能被打赏¥26元 | |
| 【S32K3XX】FlexCAN 模块配置使用被打赏¥30元 | |
| 【S32K3XX】FlexCAN RAM 资源分配整理被打赏¥25元 | |
我要赚赏金
