element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
RoadTests & Reviews
  • Products
  • More
RoadTests & Reviews
Blog Renesas Envision Kit RX65N Roadtest Part Four A - Brief note on Smart Configurator
  • Blog
  • RoadTest Forum
  • Documents
  • RoadTests
  • Reviews
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join RoadTests & Reviews to participate - click to join for free!
  • Share
  • More
  • Cancel
  • Author Author: Andrew J
  • Date Created: 2 Dec 2019 5:37 PM Date Created
  • Views 1293 views
  • Likes 6 likes
  • Comments 5 comments
Related
Recommended
  • rpbrx65n
  • envision kit
  • renesas

Renesas Envision Kit RX65N Roadtest Part Four A - Brief note on Smart Configurator

Andrew J
Andrew J
2 Dec 2019

I want to get another simple program working that requires more effort on my part in utilising the tools available.  In this brief note, it is to create a Blinky app (similar to the tutorial that failed in part 3) whilst utilising the Smart Configurator.  I know Blinky is boring, but the idea is that the LED will blink under a timer interrupt OR under a user switch press.  I’m not so much interested in that per-se, but very interested in how the Smart Configurator works within the e2Studio IDE as it promises a gui-based tool for setting pins and writing code.  These are all building blocks to developing applications for the MCU.

 

Summary of steps:

  • Create a project ensuring it is associated with the Smart Configurator
  • Open the Smart Configurator file (.scfg) or the Smart Configurator Perspective, which does the same
    image
  • I want the Compare Match Timer and selecting it will allow me to configure it and have the relevant code created: specifically, to have the timer count to 5000 and use an interrupt.  The CMT is typically used to measure incoming digital waveforms allowing characteristics such as frequency to be determined.  In my case, I will be using it as a simple counter but timing is possible.
    image
  • Repeat for Ports which will allow me to configure port usage (reading/writing/direction/pins and so on) on the MCU.  I need Port0 and Port7 because from the board schematic I see:
    • LED: Port P70, Pin 104
  • Configure the Pins - essentially, make sure the ports are enabled and the correct pin assigned to it

From here, the Smart Configurator can generate the necessary code for the selections made.
image

Source code can then be modified - like all good generators, delimiters are used to tell you where you can enter your own code

image

To give an example of what this means, the code I have to add to blink the LED (without the switch operation as yet, I’m building up to that) on the Compare and Match Timer interrupt is (extracted from the 3 source files I had to change):

  /* define the LED .  Bit 0 because the LED is assigned to PORT70 */
  #define LED2 (PORT7.PODR.BIT.B0)
…
  /* Toggle LED */
  LED2 ^= 1U;
…
/* Start Compare & Match Timer operation and loop forever */
  R_Config_CMTW0_Start();
  while (1U) {
  nop();
  }

 

And indeed, LED2 blinks.  Having got this far, I realise that Jan Cumps Jan Cumps has done essentially the same thing in a slightly different way in two of his review posts and it’s worth reading through those as well:  here and here.

 

Adding the switch will require some additional Smart Configuration changes and a small bit of additional code.  I’m actually basing the app on the sample program that I couldn’t get working in Part three because it was for a different board as I now understand enough to work out how it is doing it.  So as well as the LED configuration in Smart Configurator, I’m adding the Interrupt_Controller with configuration for IRQ13.  Although the SW2 can use Port5, that’s not needed as it will generate input signal on IRQ13 and I can hook off that.

 

Right, so after about 9 hours of trying to figure this out with the switch not working, I managed to sort it out.  Whilst SW2 should interrupt on IRQ13, it is necessary to hook it up to do so which I hadn't figured out!  I couldn't work out why it wouldn't fire off interrupt 13 when pressing the button but it is all there in Smart Configuration and now I know, I know.

 

I’m a bit frustrated with it but also myself because it's obvious once you know.  Like a lot of things I suppose.

 

So if anyone is interested, I’ve attached the project.  When it is run, don’t press the user switch and the LED should blink rapidly unaffected by the user switch which you can press away as much as you like once it has started;  press the Restart button on the debugger whilst pressing the user switch and the LED should light; it will alternate on and off with every subsequent user switch.  This is all happening on interrupts, configured through Smart Configuration, rather than with realms of hand-written code.  in order to do that, this is the handwritten code necessary:

 

main function

/* Start Compare & Match Timer operation */
    LED2 = LED_OFF;

    if (SW2_PUSH == SW2) /* SW2_PUSH = Manual Mode,  Other = Auto Mode*/
    {
    R_Config_ICU_IRQ13_Start();
    }
    else
    {
        R_Config_CMTW0_Start();
    }

  while (1U) {
  nop();
  }

Interrupt Handler code for the switch (the interrupt handler for the Compare Match Timer above on line 05 hasn't changed, but I should change it to the same as below for consistency.):

LED2 = ~LED2;

 

And a definition for SW2:

#define SW2 (PORT0.PIDR.BIT.B5)

 

Everything else is generated.

 

Summary Thoughts

As I go through the features of the development toolset, I remain impressed with the support Renesas has provided to help.  So far I’ve tried out a Quick and Effective tool (in part 3) for on-the-fly changes to managing the display and here, the Smart Configurator to get access to the Ports, Pins and built-in timers that the MCU has.  Incidentally, using the QE tool really is effective: as you make adjustments on-the-fly to the display, in my case, when you have it set up correctly, the tool can be used to create a Header file with the set parameters to include in your application.

 

I'm still struggling a bit with the structure of information from their website but it is becoming easier.

 

Further Entries

I will update this entry to provide links to further instalments as I create them:

Part One: Introduction

Part Two: Getting Going

Part Three: Development Software

Part Four A: Smart Configuration (this post)

Part Four B: User Fit Parts

Part Four C: Segger emWin Introduction

Part Four D: Removal of the LCD

Part Four E: Analog to Digital Conversion

Part Five: Static Setup of the GUI

Part Six: Getting the Display Working

Part Seven: USB/Serial Interface

 

Roadtest review

 

Also, worth reading Jan Cumps' road test as he's taking a more technical approach.

Attachments:
Blinky.zip
  • Sign in to reply

Top Comments

  • maheshmg123
    maheshmg123 over 4 years ago in reply to Andrew J +1
    Thanks Andrew. Me too tried lot for getting switch interrupt working. but failed. Finally came across your post and code. it was life-saving...!!!!!. Thanks again for the post and code.
Parents
  • maheshmg123
    maheshmg123 over 4 years ago

    Dear Andrew J,

     

    Can you help me in understanding " How to configure button interrupt using smart configurator??".

    Thanks in advance.

     

    - Maheshwar

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Andrew J
    Andrew J over 4 years ago in reply to maheshmg123

    I'm afraid it's been a long time since I looked at this board - over a year!  IIRC, SW2 is an on-board button and so needs attaching to an interrupt to register.  This must be described in an example application or app note somewhere from Renesas.  The code in the zip file is for what was developed here: you could load that and examine it for what I set up; also check out what Jan did in his posts.  It doesn't require a lot of code as a lot is done in the smart configurator.  Sorry, not very helpful but I really can't remember how I did it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • maheshmg123
    maheshmg123 over 4 years ago in reply to Andrew J

    Thanks Andrew.

    Me too tried lot for getting switch interrupt working. but failed. Finally came across your post and code. it was life-saving...!!!!!. Thanks again for the post and code.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • maheshmg123
    maheshmg123 over 4 years ago in reply to Andrew J

    Thanks Andrew.

    Me too tried lot for getting switch interrupt working. but failed. Finally came across your post and code. it was life-saving...!!!!!. Thanks again for the post and code.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • Andrew J
    Andrew J over 4 years ago in reply to maheshmg123

    It was actually a reasonably good board apart from the user-fit components.  I'm not (or certainly wasn't then) a C++ programmer and I picked it up quite quickly by using the example apps and reading through the App Notes - they were really useful.  My complete set of posts and Jan's complete set are a good means to get up to speed with the board.  Good luck - why not post back on Element 14 your experience with it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • maheshmg123
    maheshmg123 over 4 years ago in reply to Andrew J

    Sure, Andrew. Will post the same once done with the evaluation.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube