420 views|0 replies

109

Posts

3

Resources
The OP
 

[Renesas RA8D1 Review] Part 2: I/O Operation [Copy link]

This post was last edited by eew_cT3H5d on 2024-7-8 12:56

Renesas chips support a wide range of compilation environments, including mainstream KEIL, IAR, ARDUINO, RTOS, etc. This evaluation uses Renesas' self-developed e2 for the following reasons: official recommendation, rich functions, strong adaptability, standardized management, and ease of use in later projects.

e2 studio installation:

e2 studio download link: https://www.renesas.cn/cn/zh/software-tool/e2studio-information-ra-family

Flexible Software Package FSP (Flexible Software Package) installation link: https://www.renesas.cn/cn/zh/software-tool/flexible-software-package-fsp

Step 1: Install the compiler software

1. Install e2 studio first, and follow the recommended method to install it step by step. After the installation is complete, open e2 studio and create a new project. It will prompt that you need to install FSP to select the corresponding chip

2. Install FSP again

3. Create a new project and select R7FA8D1BHECBD. For the reason why you choose this, please refer to the schematic diagram in the previous article (the chip model is noted in U1 of the schematic diagram)

4. The new project is completed, the interface

Step 2: FSP initialization configuration I/O pins

1. As can be seen from the schematic diagram, the development board has a built-in User LED, and the pin that controls the LED is PA01

But it seems a bit complicated to configure PA01 from e2 studio. I can't find the relevant functions for PA configuration. Does PA correspond to P10 ?

2. Configure I/O pin characteristics

Step 3: Compile program to control I/O output

1. Register controls the output of PA01

    R_PMISC->PWPR = 0;                               ///< Clear BOWI bit - writing to PFSWE bit enabled
    R_PMISC->PWPR = 1U << BSP_IO_PWPR_PFSWE_OFFSET;  ///< Set PFSWE bit - writing to PFS register enabled

    /* LED:配置引脚 PA01 对应的PFS寄存器 */
    R_PFS->PORT[BSP_IO_PORT_10_PIN_01>>8].PIN[BSP_IO_PORT_10_PIN_01 & 0xFF].PmnPFS =
        IOPORT_CFG_PORT_DIRECTION_OUTPUT | IOPORT_CFG_PORT_OUTPUT_LOW;



    while(1)
    {

       /* 或者也可以这样用位异或操作来翻转LED1 */
       R_PORT10->PODR ^= 1<<(BSP_IO_PORT_01_PIN_00 & 0xFF);
       R_BSP_SoftwareDelay(1000, BSP_DELAY_UNITS_MILLISECONDS);
    }

2. Call the FSP library to control the output of PA01

  while(1)
    {
      
      
    R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_10_PIN_01, BSP_IO_LEVEL_LOW); //LED1 亮
    R_BSP_SoftwareDelay(1, BSP_DELAY_UNITS_SECONDS); //延时1秒

    R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_10_PIN_01, BSP_IO_LEVEL_HIGH); //LED1 灭
    R_BSP_SoftwareDelay(1, BSP_DELAY_UNITS_SECONDS); //延时1秒

    }

Step 4: Observe the display effect

1. No program development board is burned:

2. Burn the program development board:

This post is from Renesas Electronics MCUs

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Featured Posts
Research on the difference between left and right channel signals of audio

This post was last edited by bqgup on 2020-9-18 14:31 # Exploration of the difference between left and right channel s ...

[Raspberry Pi 4B Review] Installing NAS system OpenMediaVault on Raspberry Pi 4

1. Introduction to OpenMediaVault OpenMediaVault is an open source next-generation network attached storage (NAS) solut ...

A very interesting experiment about KVL and Faraday's law of electromagnetic induction

This post was last edited by Buyixin on 2020-11-8 17:49 Question : https://www.bilibili.com/video/BV1ht411U7q7 Resp ...

Some knowledge about optical splitters

This post was last edited by qwqwqw2088 on 2021-1-20 08:42 The optical splitter is a component of the PON network. It ...

Number of Cycles At 60Hz

How to understand this sentence about the forward impulse current of the diode?

【Top Micro Intelligent Display Module】IV: Serial port interaction and application of curve, drawing board and animation controls

This post was last edited by Digital Leaf on 2021-11-21 12:00 In the previous article, SGTools was used to generate a s ...

[HPM-DIY] HPM6750 peripheral LCDC driver RGB screen high frame rate video playback

The LCD peripheral functions of HPM6750 are relatively complete, and the underlying interfaces of the SDK are mostly com ...

Some use cases of MicroPython mpremote tool, chat

# Some use cases for the MicroPython mpremote tool, I've tried a lot of different third-party micropython tools, some ar ...

ADIShijian Industrial Carnival——Industrial Application Cloud Exhibition Event Starts

ADIShijian Industrial Carnival——Industrial Application Cloud Exhibition Event Starts >>Go to the event homepage ...

The DC-DC feedback pin level is abnormal

789812 789813 789816 The normal output level of this chip is 0.8V, but for some reason, when measuring several chips, it ...

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list