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
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Blog Renesas RX65 Envision Kit - part 5: DAC
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 30 Nov 2019 3:01 PM Date Created
  • Views 780 views
  • Likes 4 likes
  • Comments 1 comment
  • RoadTest
  • dac
  • rt
  • renesas
Related
Recommended

Renesas RX65 Envision Kit - part 5: DAC

Jan Cumps
Jan Cumps
30 Nov 2019

I'm evaluating the Renesas RX65N MCU EV Kit.

In this post,  I'm reviewing the Digital Analog Converter

image

 

Adapt the Envision Kit

 

The RX65N has two DAC channels. On the controller, they are PO3 and P05.

 

image

source: Renesas datasheet

 

These pins are both in use in the Envision kit. P03 is joystick pin 5, P05 is used for SW2, the user button.

These aren't broken out to any of the connectors, so some modification is needed.

The easiest is to tap DA1 off from the joystick. That isn't populated and the pcb pad is big enough to solder something to.

 

 

 

 

image

The 10nF capacitor C52 will slightly influence the edges and speed of the DAC.

The pull-up influences the lowest measurement. I'm going to remove the 2 components.

Edit: I did the original measurements with the pull-up and cap in place. You'll find the measurements without these components at the end of the blog.

 

I've cut off one position of a female pin header with long lead.

I bent the lead so that it touches the pad with little force.

I glued down the connector with Loctite to avoid any mechanical stress. These pads rip off easily.

 

image

 

DAC Firmware

 

I used the Renesas dac_demo_rskrx65n_2m example as base.

 

    /* The RX65N_2MB has a 12-bit DAC so initiate low/med/high data value accordingly. */
    uint16_t data_low  = 0x0;
    uint16_t data_med  = 0x7FF;
    uint16_t data_high = 0xFFF;

 

I didn't change any DAC functionality. I only simplified the LED animation scheme.

The original code uses 3 LEDs to indicate the ADC levels.

The Envision board has a single led, so I used that to change state after each level change.

 

    while (1)
    {
        R_DAC_Write (DAC_CH0, data_low);
        LED2 = LED_ON;
        R_BSP_SoftwareDelay (1, BSP_DELAY_SECS);

        R_DAC_Write (DAC_CH0, data_med);
        LED2 = LED_OFF;
        R_BSP_SoftwareDelay (1, BSP_DELAY_SECS);

        R_DAC_Write (DAC_CH0, data_high);
        LED2 = LED_ON;
        R_BSP_SoftwareDelay (1, BSP_DELAY_SECS);
        LED2 = LED_OFF;
    }

 

In  rskrx65n_2mb.h, I changed the definition of LED2 to match the board:

 

#define LED2                PORT7.PODR.BIT.B0
// ...
#define LED2_PDR            PORT7.PDR.BIT.B0

 

The e2 studio project is attached.

 

Measurements

 

These measurements were done when the 22K joystick pull-up resistor R50 was still in place.

This resistor has a significant impact on the measurements. See the last section for measurements with an unloaded DAC output.

 

 

The 3 first captures show the DAC output on a DMM.

image

 

image

 

image

 

I've captured 1000s of samples on a digitising meter and saved them to a spreadsheet (attached).

You can download it and validate the stability.

 

image

 

Ramp Behaviour

 

The first image shows a rising edge as measured by a digitising meter. The same data as above is used.

image

 

The 2 scaptures below are a rising and falling edge.

image

image

 

Edit: After Removing the Joystick Pull-up Resistor and Debounce Capacitor

 

Removing these two is slightly tricky. They are very close to the touch screen flatflex and C38.

Be very careful not to heat the flatflex connector. It's easy to deform it with a hot air gun. Don't blow away C38 (although no harm done when it flies).

image

image

 

The DAC works as expected now:

image

image

image

 

I measure 0V at 0x00, half scale at 0x7FF, full scale when all twelve bits are set, 0xFFF.

 

Related blog
part 1: Create an Empty Project
part 2a: Blinky with GCC Toolchain
part 2b: Blinky with Timer and Interrupt
part 3: Port an example from Renesas toolchain to GCC
part 4a: Low Power - Sleep
part 4b: Low Power - Software Standby
4c todo: power mode 3
4d todo: power mode 4
part 5: DAC
part 6: Software SHA
part 7: Blinky with FreeRTOS
part 8: DMA
part 9: UART
part 10: Reserve LCD Frame Buffer in Expansion RAM with GCC
part 11: port emWIN to GCC and run an LCD Widget
Renesas RX65N MCU EV Kit - Review
Andrew Johnson's blog series
Renesas Envision Kit RPBRX65N Roadtest
Attachments:
defbuffer1_1130_144010.zip
dac_demo_rskrx65n_2m.zip
  • Sign in to reply

Top Comments

  • Jan Cumps
    Jan Cumps over 5 years ago +2
    After removing the Joystick pull-up/debounce components, the DAC performs as expected. I've added a section to the post.
  • Jan Cumps
    Jan Cumps over 5 years ago

    After removing the Joystick pull-up/debounce components, the DAC performs as expected.

    I've added a section to the post.

    • Cancel
    • Vote Up +2 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