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 跳转至页
回复
我要赚赏金打赏帖 |
|
|---|---|
| PCF8574功能模块及其使用被打赏¥20元 | |
| 传感器LSM6DSO及LIS3MDL的功能检测被打赏¥18元 | |
| LPS25HB气压传感器及其检测被打赏¥18元 | |
| HTS221温湿度传感器及其检测被打赏¥18元 | |
| 【S32K3XX】HSE FW 版本更新被打赏¥21元 | |
| 基于ArduinoUNO开发板的AT24C02读写测试被打赏¥16元 | |
| TCS3472S传感器及其色彩检测被打赏¥19元 | |
| 【S32DS】S32K3 RTD7.0.1 HSE 组件配置报错问题解决被打赏¥27元 | |
| 【S32K3XX】MCME 启动 CORE1被打赏¥23元 | |
| AG32VH407下温度大气压传感器及其检测被打赏¥20元 | |
我要赚赏金
