Blog Posts

Blog Posts

Items per page
1 2 3 ... 7 Previous Next

Lately, I've primarily focused on the architectural details of the RX microcontroller (MCU) series that provide performance advantages to design teams. Today let's go back and look at the development-tool issue. Renesas has a new RX610 Starter Kit that packs a formidable set of capabilities into a $250 package. The Kit includes a development board, a Renesas E1 emulator, and the Renesas High-performance Embedded Workshop (HEW) Integrated Development Environment (IDE).

 

The block diagram pasted below best describes the capabilities of the development board. The design includes an LCD module that is supplied as a detachable daughter card. There is a potentiometer provided for use with the integrated analog-to-digital converters (ADCs). You get a variety of switches and LED indicators for use in evaluation of the architecture.

 

RX610_starter_block_diagram.jpg

 

The kit includes a power supply and all of the cables required to connect the development board to a host PC. You get the option of a RS232 serial connection or linking via USB and the E1 emulator.

 

We should review a couple of the tools included in the Kit such as the emulator. Renesas offers several options of debuggers and an in-circuit emulator for the RX. The E1 is meant as a tool that's sufficiently affordable that every member of a design team can have their own emulator. The E1 has internal trace capabilities for 256 branches or instruction cycles. The emulator alone sells for $150.

 

The Kit also includes an evaluation version of the HEW and the Flash Development Toolkit that offer full functionality for 60 days. After the evaluation period the tools still function, but you are limited to the size of projects that can be developed.

 

In an early post I discussed the capabilities of the HEW and how it's used across Renesas' MCU families. The HEW makes it simple to migrate to the RX from other supported MCUs such as the H8 family. Moreover the IDE includes a complete set of tools such as compilers and a debugger. In addition, many third-party tools integrate seamlessly into the HEW.

 

I'd also be remiss if I didn't remind you once again that Renesas is still offering the RX-Stick Evaluation Platform for free while supplies last. The RX-Stick lacks the robust features found in the Starter Kit but still provides a chance to evaluate the MCU and the HEW. You can register and request and RX-Stick at the Renesas web site.

45 Views 0 Comments Permalink Tags: hew, renesas_rx_mcu, maury_wright, renesas_rx, high_performance_embedded_workshop, renesas_mcu, e1_emulator, rx-stick_evaluation_kit, rx-610_starter_kit

Background


IEC60730-1 and IEC60335-1 describe the requirements for “software-related controls” for “Automatic Electrical Controls for Household and similar use”.


“Software-related controls” are classified in three classes (levels), class A, B or C. where each class demands increased levels of fault detection.

 

Typical product classifications include

  • Class A         - Fridges, Freezers and small kitchen appliances
  • Class B         - Washers and Dryers and Cookers
  • Class C         - Gas Boilers

These class levels are described in the appropriate standards documents, IEC60730 and IEC60335.


Annex H of IEC60730-1 and Annex R of IEC60335-1 list the measures to detect individual fault or errors. Both Annex H and Annex R refer to the same list of test requirements for classes A, B and C.

 

Renesas has developed self test libraries (STL) for V850, 78K0R and 78K0 which cover the above IEC60730 and IEC60335 requirements.

The 78K0 and 78K0R families have been through certification by the VDE Certification Institute. The V850 family library is based on the same concept and certification is planned.

 

API

 

The self test libraries provide a standard interface (API) between the system hardware and the application software, as shown below.

1007_%20System%20Architecture%20and%20API.jpg

The application software executes a function call to the appropriate self test module. Each module provides a “return” value to indicate either the test result or to return a test value such as in the invariable memory (Flash / ROM (CRC)) test. The application software then takes appropriate action based on the result (i.e. Process a Pass or Fail or check the resulting CRC value)


An API example of the Invariable CRC test is shown below.

 

/*========================================================*/
/* DESCRIPTION: stl_78k0r_crc                                                       */
/*    this function calculates the cyclic redundancy check (CRC) of data         */
/*    starting at "*data" with the length of "length”. "crc" is the                */
/*    initial CRC, and stl_crc will return the new CRC of the specified          */
/*    data string.                                                                            */
/* RETURN: CRC over "crc_length" starting at "pStAd"                                */
/*========================================================*/  

unsigned short __far *pMyChecksum;
pMyChecksum = __segment_begin("CHECKSUM");

crc = 0x0000;
checksum_crc.start_address = 0x00000000;
checksum_crc.length        = 0x00020000;
crc_asm = stl_78k0r_crc_asm(crc, &checksum_crc);

crc = crc_asm;
checksum_crc.start_address = 0x00020000;
checksum_crc.length        = 0x0001FFFE;
crc_asm = stl_78k0r_crc_asm(crc, &checksum_crc);

if (crc_asm  != *pMyChecksum) {
resultBool = 1; } else {
resultBool = 0;    }

indicate_test_result( resultBool );

Certified Test Functions

The certified tests cover the following MCU functions

  • CPU Registers
  • On Chip Invariable Memory (Flash/Masked ROM)
  • On chip Variable Memory (RAM)
  • System Clock

A typical class B test cycle could include

 

1.    A full system test before the application is started (All test functions show above)

 

2.    Iterative self tests for

a.    Flash/ROM.
b.    RAM
c.    Possibly System CPU Registers

3.    Final full system tests at the end of the application operation (or during an “idle” period)

CPU Resources Required
The resources required by the certified self test library functions are as shown below

1007_STL%20resources.jpg

Certification Support Information
Supporting documentation and source code files can be provided on request

The following information is available

  • Test Report (78K0 and 78K0R)
  • Detailed Presentation
  • Source Code Libraries for 78K0, 78K0R and V850 families
  • IAR embedded work bench API examples
  • IEC support application notes

The IEC Self Test Application Note for 78K0 and 78K0R includes detailed descriptions of all the certified self test functions and some additional self test function examples. These additional tests are included for guidance as they are application specific in their operation and use. An equivalent V850 application note is in development.

The additional test examples cover the following functions

  • Error correction and detection
  • Redundant Data Storage
  • Checksum calculation
  • Interrupt Testing
  • Alternate Ram tests (checkerboard)

 

Please visit this address for a list of application notes relating to these microcontrollers, as well as the R8C family.

22 Views 0 Comments Permalink Tags: r8c, v850, 78k0r, 78k0

Depending on the application’s requirements, different types of LCD configurations can be selected, but basically, we can identify three main types of these LCD configurations that require different driving interfaces:

 

1.    Simple LCD glass panel without controller/driver.
In this case, an efficient solution is to control the LCD glass using a microcontroller with integrated LCD controller/driver or alternately to emulate the controller/driver using general I/O ports when the number of common and segments lines of the LCD glass is limited. We talk about direct LCD drive for that last solution.

 

2.    LCD module (or Chip-On-Glass LCD module) driving by parallel interfaces.
Here the module already incorporates the LCD controller/driver in addition of the LCD glass, and it is just a matter of connecting the parallel ports of the LCD module (usually 8-bit for data and 3-bit for control) to I/O ports.


3.    LCD module (or Chip-on-Glass LCD module) driving by serial interfaces, mainly I2C, SPI or RS232.
This is the easiest solution where the LCD module can be controlled by sending commands through the serial lines. Only a few lines are needed to control the LCD module, depending on the serial interface used.


The above classification considers the interface needed to control the LCD, but in each of these configurations, the LCD display can be a segment LCD or a Dot Matrix LCD. Graphic LCD displays also exist but require a more complex driving method.

 

1. Simple LCD glass panel without controller/driver

 

To control a simple LCD glass panel that doesn’t integrate a controller/driver, microcontrollers with integrated LCD controller/driver are the best option. The interface consists of connecting the common and segment lines of the LCD to the appropriate pins of the microcontroller. This solution allows saving cost and space on the board as the LCD controller/driver is already provided within the microcontroller chip.
Renesas offers such a solution with the L series’ microcontrollers that integrate such an LCD controller/driver, and are available in 8-bit with the 78K0/Lx3 family and 16-bit with the 78K0R/Lx3 family.


Below is an example of the connection diagram between the 78K0/LF3 MCU and an LCD glass with 8 common lines and 30 segment lines.

1009_1.jpg

Figure 1 - Connection diagram between the 78K0/LF3 MCU and an LCD glass panel

The 8-bit 78K0/Lx3 can drive up to 224 LCD while the 16-bit 78K0R/Lx3 can drive up to 400 LCD segments. Also, different display modes can be selected between the following ones:
•    Static
•    1/2 duty (1/2 bias)
•    1/3 duty (1/2 bias)
•    1/3 duty (1/3 bias)
•    1/4 duty (1/3 bias)
•    1/8 duty (1/4 bias)


See It & Sense It! Demonstration kits

Renesas Europe also provides development kits for both of these MCU families, they have been designed to demonstrate and evaluate the 8-bit 78K0/Lx3 and 16-bit 78K0R/Lx3 microcontroller families, but also to support development.

 

1009_2.jpg

Figure 2 – 78K0/Lx3 See it! and 78K0R/Lx3 Sense it Demonstration kits

 

More details on these kits can be found here:

http://www2.renesas.eu/products/micro/065_dev_tools/030_starterkits/index.html

 

When the number of common and segment lines are limited, another possibility to control that type of LCD glass is to emulate the controller/driver using general I/O ports. This method requires emulating the bias voltages using external resistors as shown on the circuit diagram below based on the V850/SA1.

1009_3.jpg

Figure 3 - 10-digit LCD glass panel (1/3 duty, 1/2 bias) controlled by the V850/SA1

 

An Application Note related to that direct LCD drive method with LCD controller emulation is available here:

 

http://www2.renesas.eu/_pdf/U14737EE1V0AN00.PDF

 

2. LCD module driving by parallel interfaces

 

An LCD module provides the LCD glass as well as the controller/driver that are already connected together, so that the control is easier for the user. For this type of interface, all microcontrollers can be used assuming that enough I/O ports are available for that purpose, usually eight for data lines and three for command lines (RS, R/W and E) are needed. In addition of the power supply pins, some of those LCD modules also provide two pins for backlight.


The main constraint regarding this type of interface is to use the same operating voltage for both the microcontroller and the LCD module, in other words VDD = VLCD must be fulfilled. But this can be avoided under some conditions allowing the two sides to operate with different supply voltages.
Below is an example of the hardware interface for the 32-bit V850ES/JJ3 and a standard LCD module with an 8-bit parallel interface for data and three more lines for command.

1009_4(1).jpg

Figure 4 – Parallel interface between an LCD Module and the V850ES/JJ3


The MCU used in this example, the V850ES/JJ3, as well as all other Renesas V850ES based microcontrollers operating on up to 3.3V, has their I/Os that are tolerant to 5V input. Moreover, assuming that the minimum input voltage (VIH) of the LCD module used is less than 3.3V, therefore, the two sides can operate under different voltages, and no level shifter between the microcontroller and the LCD module is required to adapt the level of the voltages.

 

Then the appropriate instructions according to the controller/driver datasheet have to be sent to control the LCD.

 

Renesas provides an Application Note demonstrating this type of interface based on the 32-bit V850ES/Jx3 and Jx3-L MCU families. A software programming example is also available to download as part of the Application Note.


3. LCD module driving by serial interfaces (I2C, SPI or RS232)

 

This type of LCD module uses the same principle than the previous one except that the control is done using serial interfaces, which reduces the number of lines required compared to a parallel interface.


The connection diagram below shows how to interface an LCD module with an I2C interface to the I2C pins of the Renesas V850ES/JJ3 microcontroller.

1009_5.jpg

Figure 5 – I2C serial interface between an LCD Module and the V850ES/JJ3.

The interface only consists of two signal lines for clock and data, and uses pull-up resistors on these two lines.

56 Views 0 Comments Permalink Tags: lcd, v850, 78k0r, 78k0

It's been a while since we discussed software development tools for the Renesas RX family of microcontrollers (MCUs). But I suspect that we'll see a lot of third party activity in development tools with the Renesas DevCon around the corner. IAR Systems, for instance, just announced that the IAR Embedded Workbench integrated development environment (IDE) now supports the Renesas RX Application Binary Interface (ABI).

 

IAR was among the first third parties to support the RX architecture as I chronicled in this post on the Embedded Workbench, IAR's compiler, and PowerPac real-time operating system. Embedded teams can even download the tools for a free 30-day evaluation.

 

The latest news is important because it means that compiled code developed with Renesas and IAR tools can be mixed and matched. Libraries, drivers, and other software developed with Renesas tools can be used seamlessly in the Embedded Workbench.

 

IAR is known for generating an extremely small code footprint and the Embedded Workbench is the IDE of choice for some embedded design teams. Now those developers have full access to software developed by Renesas or other third parties.

 

Having mentioned the Renesas DevCon, I may as well take this opportunity to link to a prior post focused at the developers' event. I highlighted a number of the RX-centric sessions that will be offered at the conference. In fact IAR will present at a session focused on their compiler and the Embedded Workbench.

102 Views 0 Comments Permalink Tags: rtos, ide, renesas_rx_mcu, maury_wright, renesas_rx, integrated_development_environment, renesas_mcu, real_time_operating_system, renesas_electronics_developers_conference, renesas_devcon

I've written several times on the subject of interrupt response time and described how the Renesas RX microcontrollers (MCUs) respond to interrupts. It's also important to exit interrupt service routines (ISRs) quickly. A fast exit time allows the MCU to return quickly to the application at hand and also is important when the MCU must service nested interrupts. So today we will take a look at how the fast interrupt feature of the RX and the ability to dedicated registers to an ISR can speed exit times.

 

The example I'll use here will build on the scenario that I described in a recent post on response to nested interrupts. Renesas application engineers had developed a test in which a timer integrated on the MCU generated an interrupt. Subsequently, a higher-priority external interrupt forces the MCU to exit the timer ISR so that it can service the external interrupt.

 

The code for the nested interrupt also provided an opportunity to measure the relative advantage of the fast interrupt feature and the use of dedicated registers. I've written previously and described the savings in CPU cycles attributable to the fast-interrupt function and dedicated registers. The fast-interrupt function can be assigned to one high-priority interrupt. It relies on dedicated PC (program counter) and PSW (processor status word) backup registers that eliminate the need to store the RC and PSW to memory. And the dedicated registers eliminate PUSH and POP instructions in the ISR.

 

The test of how these features speed exit time relied on the use of a scope to measure the time that an I/O signal is in a low state. The timer ISR sets the signal low. And the external interrupt drives the signal back high. The measurement is relative because the timer ISR had to include a delay loop to insure that the external interrupt triggered before the exits from the timer ISR.

 

First the engineers measured the exit time without the use of the features described above. Next the engineers repeated the test with the timer ISR set to use the fast-interrupt function. The exit required 20.42 nsecs less time with the fast-interrupt function applied to the ISR.

 

Next the engineers repeated the test with registers R10-R13 dedicated to the timer ISR. That allows the timer ISR to exit without POP operations to restore register values. With both the fast-interrupt function and the dedicated registers applied, the test revealed 80.3 nsecs faster exit time relative to the first test.

 

Embedded designs often require deterministic and speedy response to interrupts. The RX provides an additional value in lettering design teams cut response times even further for key interrupts.

110 Views 0 Comments Permalink Tags: renesas_rx_mcu, renesas_rx, renesas_mcu, zero_wait_state, interrupt_response_time, interrupt_service_routine, interrupt_handler, isr, fast_interrupt_function, interrupt_exit_time, maury, wright

The 78K0RIX3 Motor Control ASSP is featured on two different development platforms for evaluating both sensored and sensorless 3 phase BLDC motor control applications. The Renesas Europe 78K0RIX3-SPINIT single board development kit comes complete with an 8 pole 15v BLDC motor capable of speeds up to 8000rpm, and the MC-CPU-78K0RIE3 is a daughter card for use with the Renesas low voltage motor control starter kit. The current sample software that is provided in the software download for both platforms is the HALL120_BLDC_78K0RIX3 project. This project drives the motor using a 6 step trapezoidal technique where the HALL input indicates the rotor position and the rpm is controlled with the high side phase voltage. This drive technique only ever has two phases in use at any one time and one phase is the high side, which is using a PWM output, and one phase is the low side or return and does not require chopping so the direct connection to the low side rail via the MOSFET is sufficient.

The charts below show the 6 step pattern for the BLDC motor. The HALL input is read on sensor inputs 01 to 03 and the appropriate pattern is output on the inverter bridge drive lines T02 to T07.

1004_%20Excitation%20Table(2).jpg

The 78K0RIX3 Control Frequency is set to 20kHz or every 50uS and this is referred to as the Carrier interrupt. During this Carrier Interrupt processing the HALL inputs are read and this reading is translated to the output drive pattern as indicated in the above charts.

 

The 78K0RIX3 Timer Array Unit (TAU) supports the PWM outputs and is configured as a Master PWM channel and seven slave channels for the PWM outputs with extra channels for ADC trigger synchronisation, interrupt thinning, dead time generation, and real time port synchronisation. The PWM is centre aligned as shown in the diagram below which allows the carrier interrupt to occur at the centre point of the PWM pulse. The other option is to set the PWM for edge alignment in which case the carrier interrupt would always occur on the leading edge of the PWM pulse.

 

1004_3%20Carrier%20Interrupt(1).jpg

 

Another area to consider is the speed estimator which in the 78K0RIX3 sensored 3 phase BLDC demonstration software is done using one of the HALL input signals connected to an interrupt so that the signal pulse can be measured and an accurate speed can be calculated. See below. The Hall sensored approach has a direct connection to the starter kit’s interrupt pins however the use of sensorless techniques is becoming more popular and this relies on back EMF voltage measurements in order to determine both rotor position and speed.

 

1004_5%20Speed%20Estimation.jpg

Now that the rotor position and speed can be determined, and the motor can be commutated with the correct drive pattern, and the PWM duty cycle can be varied which in fact varies the voltage amplitude, then the final consideration is the PID loop. The PID is used as the control mechanism to calculate the PWM value for the high side phase drive. This Proportional Integral and Derivative elements of this control can be clearly seen from the source code available in the HALL120_BLDC_78K0RIX3 project.

62 Views 0 Comments Permalink Tags: motor, bldc, 78k0r, inverter

The Art of V850 in V850

Posted by Steve Norman Aug 26, 2010

Some pieces of art are never considered complete; take Gaudi’s Sagrada Familia cathedral in Barcelona – started almost 150 years ago and still under construction despite universal artistic acclaim in the outside world today.

sagrada-familia.jpg

You are probably now wondering if I am really going compare one of the most extravagant pieces of architecture in the world to a microcontroller…

Maybe it’s a step too far, but I believe there are parallels. V850 is acknowledged as the world most popular 32-bit microcontroller, being the world’s top seller for several years in succession now, but as its creators we are still striving to complete the picture; like Gaudi’s cathedral, this picture is not going to be completed any time soon but we are also working to a long-term vision and I would like to share the next step in that vision with you now.

With the introduction of new smaller packages and many more memory options to our existing family, V850 can truly be considered a complete microcontroller platform.

Now spanning from 40-pins up to 144-pins, our V850 J_Series offers a complete platform line-up whilst maintaining flexibility of choice in terms of performance, features such as ultra low power consumption, memory sizes up to 1MB of embedded highly secure Flash, and peripherals such as USB2.0 Host & Function and Ethernet.

V850LPC_Roadmap.jpg

Based on a well established 3V high performance microcontroller core, three new flavours have been added to this single family concept:

V850ES/Jx3-L offers market leading power consumption at low voltages, and as well as extending our package line-up, I am pleased to announce that we have also added some new features, including up to 512KB Flash memory, a real time clock with independent power pin and an 11-channel serial array unit.

V850LPC_Performance_Current.jpg

www.renesas.eu/v850

 

V850ES/Jx3-U and V850ES/Jx3-H both support 12Mbps Full Speed USB2.0, with either Host and Function or Function only alternatives, plus the added benefit of a CAN interface. We also provide free of charge driver software.

V850ES/Jx3-E offers an IEEE802.3-compliant Ethernet controller as well as USB2.0 and CAN interfaces. To enable designers to take full advantage of all these communication interfaces without restriction, it also includes up to 124K RAM and runs at an impressive 103DMIPS.

And it’s not just pin counts that we’ve considered when introducing smaller packages. We can also offer packages down to 5mm2, with standard LQFP plus very low profile WQFN and FBGA packages also offered across the range.

Because we are simply extending a family in full production already, designers are also benefitting from being able to develop early using existing tools whilst the new variants are introduced throughout 2010, so if the one you need isn't quite ready yet, don't panic!

Combined with our existing V850ES/Jx3 family, offering up to 1MB Flash memory embedded, this gives you almost 80 products in a single, upwardly (or downwardly) compatible family, truly enabling you to take advantage of the features you need, be they performance, low power or loads of communications, and break the traditional boundaries of 32-bit microcontrollers with whole new concepts based on one microcontroller platform.

V850 J_Series, now with smaller packages and more features – a complete platform and a piece of art waiting to be held in your hands.

 

 

111 Views 2 Comments Permalink Tags: v850

With the complexity of modern microcontrollers configuring the basic system can be a daunting task, using modern device configuration software and code generators can greatly reduce the development cycle and increase software reliability.


Applilet 3 is a device configuration software developed by Renesas for the broad range of its microcontrollers, in this walkthrough of the Applilet 3 software we shall demonstrate the planning and processes required to generate reliable and concise peripheral driver code for one of the complex Renesas 32-bit microcontrollers.
Like all development projects the key to any success is the planning, ensuring that all the relevant information about the system architecture is clearly documented and available will significantly reduce the possibility of mistakes.


The key elements that should always be understood and documented are outlined below:

  • Clock and oscillator configurations.
  • Definition of pin functions.
  • Serial port requirements.
  • Interrupt definitions.
  • Clear definition of input, output and unused pins, identify the types if possible eg open drain etc.
  • Timer requirements.
  • External device interfaces, memory etc.


The above only indicate the minimum requirements and as a general rule clearer documentation reduces the number of errors that may occur during code generation. A very good guideline would be to develop a table showing all of the definitions that are used.

 

1005_table.jpg

Table 1

The above table snippet shows a sample of a configuration used on one of the Renesas references designs currently under development.
When you have developed a clear understanding of the device configuration you can now start and create your device configuration software, at Renesas we would always recommend that you also have a copy of the latest user manual for the relevant device.


For the purpose of this demonstration we shall use a member of the V850ES/JJ3 family, a series of high performance, low power 32 risc architecture microcontrollers. The V850ES/JJ3 series also has an extensive range of peripherals including timers, serial ports, external bus interface and ADC.

 

The Applilet 3 software can be freely downloaded from the Renesas Website.

 

Upon starting a new project you will first need to configure the working directories, set the device type and the compiler that will be used. Applilet 3 provides full support for IAR and Greenhills systems as well as the Renesas compiler, at this stage you should also configure the main system core parameters.

 

1005_1.jpg

Figure 1

 

In Figure 1 you can see the default screen for setting up the various system clocks, security settings, on chip debug features and power management. The key settings are the main CPU clock frequency and associated registers, a drop list box provided and only valid selections are allowed. In the demo example the system clock is programmed to be 32 MHz using the internal PLL and providing a *8 multiplication of the 4MHz external crystal.

 

Other options that have been set in the demo example are:

  • 32.768 KHz sub clock
  • 220 KHz internal clock
  • Clock monitor
  • On chip debug using minicube 2 and UARTA0
  • Watchdog timer 2

 

Upon completion of the main clock configuration you can now go and configure the rest of the system, for the purpose of this demonstration we shall only show examples of external bus, standard port and serial port configuration. Clearly in a complete system initialisation you would undertake to configure all of the peripherals prior to commencing code development.

 

1005_%202.jpg

Figure 2

In figure 2 you can see the system screen, each peripheral configuration block can be initialised and configured independently, however the software will automatically check for configuration inconsistencies to ensure that a particular function is not duplicated on any of the device ports. In our demo program we have decided to use the external bus to demonstrate how this can be easily configured and how automatic conflict checking is performed.

 

1005_3.jpg

Figure 3

 

After selecting the external bus icon the above screen is selected, enabling any of the external memory area chip select boxes will then allow the relevant area to be configured. You can also select multiplexed or separate bus mode, note! The same bus mode must apply to all of the used chip select areas, you cannot mix the bus modes. When the bus modes have been selected you can know configure the bus sizes and wait states on an individual CS line setting. You can also configure the appropriate control signals. After the above has been configured all of the relevant device port pins will automatically be configured for the external bus mode function.

 

1005_4.jpg

Figure 4

In Table 1 we could see that port 0 was used to control the external SD card so the port has now been configured to reflect this, however P06 is used as an alternate function, in this case external interrupt 3 and as can be seen the software prevents this port now being used as a standard port pin. Each port pin can be individually configured as input, output with a default state or even N-channel open drain output. Procedures can also be created to allow software to change operation mode of the I/O pins easily.

As can be seen in table 1 we have also 2 serial ports to configure, a UART enabled as an RTOS monitor and a CSI port for communicating to the RF interface module.

1005_5(1).jpg

Figure 5

The above shows the configuration of the RTOS monitor port but will also generate the relevant interrupt handler code outline and callback functions. As can be seen the default baudrate has been set at 38400 with 8 data bits, 1 stop bit and no parity.

1005_%207.jpg

Figure 6

Figure 6 shows the CSI0 configuration for RF interface communications port, as can be seen port initialisation and interrupt handlers are all created.
For this demonstration we have only configured a limited number of the peripherals available on the V850ES/JJ3, the next process is to generate the code and review the output in the pre-configured IAR project.

 

Code Generation

 

1005_8.jpg

Figure 7

By selecting code generation you can create all of the peripheral driver code that has been configured using the Applilet 3 code generator, IAR was selected as the default compiler so an active IAR project will also be created. Applilet 3 is fully aware of the different compiler keywords and directives and the code is generated to support these.

 

Loading the newly created project in to the IAR Embedded workbench platform you will see a complete system initialisation has been created along with place markers and initialisation code.

 

void  SystemInit(void)
{
    DI();    /* disable interrupt */
    /*Process of reset*/
    CG_ReadResetSource();
    /*Initialize the I/O ports*/
    PORT_Init();
    /*Initialize the external interrupts*/
    INTP_Init();
    /*Initialize UARTA channel 3*/
    UARTA3_Init();
    /*Initialize CSIB channel 0*/
    CSIB0_Init();
    EI();    /* enable interrupt */
}

 

/*
**-----------------------------------------------------------------------------
**
**    Abstract:
**        This function  initializes hardware setting.
**
**    Parameters:
**        None
**
**    Returns:
**        None
**
**-----------------------------------------------------------------------------
*/
unsigned char __low_level_init(void)
{
    PRCMD = 0x00;
    OCDM = 0x00;
    VSWC = 0x11;
    CLOCK_Init();    /* call Clock_Init function */
    BUS_Init();    /* call BUS_Init function */
    SystemInit();
   
    return MD_TRUE;
}

 

The full project workspace is shown below:

1005_9(2).jpg

 

Place holders are marked in all of the files to allow users to modify the files and add user developed code, as long as the new code is placed in between the place holders then the Applilet 3 tool can be reused to generate and update the peripheral drivers.

96 Views 0 Comments Permalink Tags: v850, applilet

Constant-current drive is a critical part of an LED driver design, since a poorly developed driver can significantly affect the lifetime and color shifting of LED components. Systems that cannot provide a sufficient amount of current will not produce the maximum lighting output, in the same way, driving LEDs with too much current will significantly reduce their duration of service. To use LEDs efficiently, the power source must be able to provide constant current to best match the LED characteristics, where the guidance for optimum currents is provided by LED manufacturers.

 

World’s First Multi-channel High Current LED Driver MCU

To support the rapidly growing LED market, Renesas offers a unique, highly integrated and intelligent solution for efficiently driving high power LEDs. The uPD78F802x is the world’s first MCU with a 4-channel high current constant driver in a single chip. Each of the channels is capable to drive up to 1.5A using external MOSFETs, which covers the majority of high power LEDs in the market. Additionally, each channel is capable to deliver up to 1MHz switching frequency using an additional internal oscillator, allowing using small size external inductors for each LED channel, thus saving PCB space and system cost. The chip benefits from the wide supply voltage range from 9 to 42V.

Up to 10 high current LEDs can be connected to each channel of the device, which gives a total of 40 LEDs that the device can drive. A designer can leverage the 4 channels for redundancy and drive a high number of LEDs which is beneficial in the lighting applications such as display backlighting or street lighting. And if for one reason or another there is an LED failure in the system, there are 3 other channels which can still take care of that.

To obtain the best match of the light output with the daylight conditions, the dimming capabilities of an LED driver system are becoming essential. Dimming also allows color mixing, which is mandatory in many lighting applications. The uPD78F8024 integrates 4 channels of 8-bit PWM which is capable of generating 256 brightness levels for each channel.

Picture3.gif

A data sheet for the uPD78F802x family is available here:

http://www2.renesas.eu/applications/industrial/02_building_management/050_lighting/050_led_lighting/020_products/index.html

 

Shine It! Demonstration kit

Picture4.jpg

The evaluation board included in Shine It! has been designed to demonstrate and evaluate the uPD78F8024 microcontroller and provide a good reference for HB-LED driver system design.


The board is configured in buck topology to drive up to 300mA of constant current for each of the 4 channels.
The board also benefits from flexible LED configurations offering to work with on board 4 tiny RGBW Luxeon Rebel LEDs or utilize the available on board connectors for connecting various external “off the shelf” LED modules.


RS232, DMX512 and ZigBee™ communication interfaces are also supported with relevant connectors allowing remote control of each LED channel independently or as a combination of all the 4 channels. Download the User’s manual for Shine It! here:

http://www2.renesas.eu/docuweb/index.php?fld_keyword=78K0-SHINEIT&fld_issue_date=&fld_type=&submit=Search

 

Applilet EZ


Shine It! contains the free lighting dedicated Applilet EZ software tool which allows making system configurations using a friendly GUI and automatically generating software for uPD78F802x microcontroller.


It generates pre-compiled IAR code and then program the target device on Shine It! Board using a USB connection. This tool also generates code for DALI and DMX512 lighting specific communications.

Picture7.emf

 

The Applilet EZ tool can also be downloaded here:

http://www.renesas.eu/updates?oc=APEZ-HCD

 

And its user manual is here:

http://www2.renesas.eu/_pdf/U19178EJ5V0UM00.PDF

117 Views 0 Comments Permalink Tags: led, 78k0, applilet, lighting, hcd, shine_it

The Dhrystone benchmark is widely used by microprocessor and microcontroller (MCU) vendors to specify performance and design teams have few other ways to quickly compare processor performance. So today let's take a bit deeper look at how you can run your own Dhrystone benchmarks guided by a new application (app) note. Moreover we'll review some performance numbers from prior Doctor Micro blog posts covering the Renesas RX MCU.

 

One of the first Doctor Micro blog post on the RX zero-wait-state Flash memory discussed the Dhrystone benchmark and the DMIPs (Dhrystone MIPs) per MHz figure of merit. The RX is specified by Renesas to deliver 165 DMIPs when operating at 100 MHz or 1.65 DMIPs/MHz.

 

As you consider different MCUs for projects, you might want to run you own Dhrystone tests and evaluate processors in what you know to be an apples-to-apples comparison. The new application note "How to Setup and Run Dhrystone on a MCU" from Renesas' application engineers can guide you through the process. The note uses the RX MCU as the example target, but the techniques described can be easily applied to other MCUs.

 

The app note lists the files you need to run the benchmark along with identifying one place on the Internet where you can find the files. The notes takes you step by step through the process of modifying the files where required. For example, one of the files uses a TIME function call to actually measure the benchmark time. The OS used by the author lacked a TIME function so the authors commented out the references to that function and inserted code to toggle an output pin instead. They used a scope connected to that output pen to capture the test time.

 

The app note provides instruction on interpreting the results. The tests are run repeatedly to ensure a reliable result. In the app note, the test is run for 10,000 iterations. So the result must be averaged to get an accurate DMIPs/MHz score.

 

Engineers that have requested an RX-Stick development platform will also find help in terms of the Dhrystone benchmark. Renesas is offering the kits free for a limited time, and the kits are now shipping to those that have registered. The kit comes with Dhrystone code.

 

In a recent post, I linked to a video of Renesas applications engineer John Breitenbach working with the RX stick. The video included a Dhrystone run that actually yielded a measurement of 1.75 DMIPs/MHz.

 

I also described, in a prior post, some real-world applications that Renesas applications engineers used to test the RX against an ARM processor. Those results don't rely on Dhrystones but do show a performance advantage as great as 75% for the RX.

176 Views 0 Comments Permalink Tags: renesas_rx_mcu, maury_wright, flash_memory, dmips_per_mhz, renesas_rx, arm, renesas_mcu, zero_wait_state, rx-stick_evaluation_kit, arm_cortex_m3, rx-stick, dhrystone_benchmark

Introduction

The 78K0/Kx2-L is a low power 8-Bit MCU series designed to target small battery–powered systems and other applications where low power is needed. 78K0/Kx2-L family has onboard OP_AMP with all I/Os available to the user, which makes it possible to implement capacitive touch solution. There are other devices that have the same OP_AMP configuration like the 78K0/Ix2 and 16-Bit 78K0R/Lx3 (-L) which can be found on our website .

 

Principle of Capacitive Touch


2-1 Theory:
The theory behind capacitive touch can be simply seen from the construction of the two parallel plate capacitor where in free space two conductors separated by a dielectric form a capacitor. Given the fact that the human body is conductive, inspired engineers to use this biological property that uses the effect of body capacitance to alter other conductor’s self capacitance.

 

2-2 Capacitance Measurement:
When we measure the capacitance in touch system we need to take into consideration the capacitance to ground of the conductive objects. The equivalent circuit can be seen as illustrated in fig-3- where the human finger and the electrode under measurement form a capacitor which lies in parallel to the other capacitors. Therefore the total capacitance is calculated from the following equation:

1006_0F1.jpg

Equation -2-


C1: Body capacitance in order of 100pF
C2: Sensor capacitance in order of few pF
C3: Detection system capacitance to ground in the order of 100pF

 

The main influence on the measured capacitance comes therefore from C2.

1006_1.jpg

Fig-1-

 

2-3 Renesas Capacitance measurement Solution
There are many techniques to measure capacitance including direct measurement of the RC time constant, relaxation oscillator capacitance based, switched capacitors, charge transfer and many more. Renesas uses the onboard OPAMP to create astable multi-vibrator with the sensing element capacitance as the tuning element for the oscillator.

1006_2.jpg

Fig-2-

The circuit above as the name indicates swings between the rails and therefore the OPAMP output is either Vcc or 0V. The resistor network sets the positive input to the

OPAMP to either 1/3Vcc or 2/3VCC respectively. The capacitor then charges and discharges between 1/3 and 2/3 of Vcc.

 

1006_Vcc.jpg

 

The voltage across a capacitor at any time can be formulated as:

 

Equation-3-
1006_0F3.jpg
Let’s consider the charging cycle: V∞ = Vcc and Vin = 1/3Vcc
Substitute the initial values in Equation-3-:
1006_0F3a.jpg
At half cycle when t =T/2
1006_0F3b.jpg
With some manipulation the oscillation frequency can be obtained as:
1006_0F4.jpg
Equation-4-


The oscillator frequency obtained using the onboard oscillator can be seen in fig-3 below.

1006_3.jpg

Fig-3-

AMP0 MIN: OPAMP negative input
AMP0 PLUS: OPAMP positive input
AMP0 OUT : OPAMP output


3- Hardware interfacing example:

The 78K0/Kx2-L has a maximum of 2 OPAMPs therefore to interface more than 2 capacitive sensors external multiplexers can be used.

1006_4.jpg

Fig-4-


The solution uses 7 I/Os in total to interface up to 8 capacitive switches and then 1 extra I/O for every additional 8 capacitive switches mainly for the enable input of the additional multiplexer. The selection bits and the common pins of the multiplexers are shared between all the multiplexers as it is illustrated in fig-5-:

1006_5.jpg

Fig-5-

4- Programming example

The effect of a finger approaching the capacitive sensor is to change the oscillation frequency. As the human body adds capacitance the frequency is reduced and the software needs to measure this frequency change. There are mainly two methods to measure this frequency either by measuring the number of periods in a fixed amount of time or measure the time it takes for a fixed number of periods. This Renesas solution uses the second approach by measuring the pulses using an 8-Bit Timer as external event counter and the time is measured using 16-Bit Timer. The number of periods is set as the compare register for the 8-Bit Timer and when the interrupt occurs the measurement is taken.

1006_PE1.jpg

The total number of sensors supported can be changed by changing the define derivative.

1006_PE2.jpg

 

The measured values are processed after every complete scan to detect if any capacitive sensor was touched. For capacitive switches the software compared the measurement change to a preset threshold.  More information and complete source code is available from:

 

http://www2.renesas.eu/_pdf/U19788EE1V0AN00.PDF

 

1006_PE3.jpg

Capacitive touch systems can implement switches, sliders, wheels and even touch screen. The algorithms for each of the above are different. Except for buttons algorithm the measured values might need some sort of filtering to remove the jitter from the measured values and allow smooth derivation of the position of touch.

 

91 Views 0 Comments Permalink Tags: 78k0, capacitive_touch

The 78K0R/Lx3 is a highly integrated 16-bit microcontroller with built in LCD driver including boost control. The microcontroller has been designed for applications where high performance and low power are essential. At 20MHz the 78K0R/Lx3 has 25.4 DMIPS performance and power consumption of 1.5mW/DMIPs.


To greatly reduce external component count, the 78K0R/Lx3 has:

  • Integrated internal oscillators: 8MHz,  1MHz and   30KHz
  • Power On Reset (POR)
  • Low supply Voltage Indication (LVI)
  • Real Time Counter (RTC)
  • Voltage Reference (VREF)
  • Operational Amplifiers (Op Amp)
  • 12-bit ADC and 12-bit DAC

 

All the peripherals not being used can be deselected to reduce the microcontroller’s power consumption. The 78K0R/Lx3 is available in 80pin, 100pin and 128pin versions with 128Kbyte FLASH and 7Kbyte RAM , 96Kbyte FLASH and 6Kbyte RAM or 64Kbyte FLASH and 4Kbyte RAM.

Picture9.jpg

For the user documentation of the 78K0R/Lx3 click here!

 

Supply current in different modes and frequencies

1003_2.jpg

The voltage reference can be switched between +2.0V and +2.5V and is available to the ADC, DAC and Op. Amps.
As well as the internal voltage reference, an external voltage reference can be selected using the VRSEL bit in register ADVRC


For low power consumption the reference can be deselected or powered down.

1003_int_ref_volt(1).jpg

Fig. 1 Internal Voltage Reference

 

Up to three Op. Amps. are available depending on the package. The amplifiers are fully configurable and their outputs are connected to ADC channels. In low power applications the amplifiers not being used can be switched OFF.

1003_opamp.jpg

Fig. 2 Operational Amplifiers

 

The Analogue to Digital Converter (ADC) is a successive approximation register (SAR) type and has 12bit resolution. The ADC can work in continuous or single conversion mode and can be triggered by the timers or by software. The reference voltage can be internal or external.  The 80 pin package has 8 channels for analogue inputs and the 100pin and 128pin package devices have 12 channels for analogue inputs. In low power applications, when the ADC is not being used, the reference voltage can be disconnected from the R-2R ladder network and the chip enable ADCEN can be reset stopping the clock to the ADC.

 

1003_ADC(2).jpg

Fig. 3 Analogue to Digital Converter

 

2 channels of digital to analogue converter (DAC) with 12bits resolution are available. The voltage reference for the DACs can be external or the internal reference. In low power applications, when the DAC is not being used, the voltage reference can be switched OFF and the chip enables for DAC0 and DAC1 can be reset, disabling the clock to the DACs.

1003_DAC.jpg

Fig. 4 Digital to Analogue Converter

 

Temperature Sensor using an Instrumentation Amplifier made with Internal Operational Amplifiers:

1003_Tempsensor.jpg

The example above shows a Wheatstone bridge with two negative temperature coefficient (NTC) thermisters in opposite arms. The instrumentation amplifier provides very high input impedance and CMRR. The only components required external to the microcontroller to build the instrumentation amplifier are the resistors R1 to R4, RF and RG.

 

The output of the amplifier is given by:

 

VOUT = [(sig+) – (sig-)] x [R4/R2[2RF/RG + 1]] 


If R1 = R2 and R3 = R4 the gain can be set with RG.

This example shows that a high performance, low power system can be built with a few external low cost components.

173 Views 0 Comments Permalink Tags: lcd, low_power, 78k0r

By using various functions integrated in the 78K0/Ix2 microcontroller, this device can be used to control high brightness LEDs.  Therefore, the 78K0/Ix2 microcontroller offers a very low cost approach to drive HB-LEDs without an external IC driver.

 

As part of this low cost approach, the PWM output and internal analog peripherals of the 78K0/Ix2 microcontroller are used for driving constant current and dimming LEDs. These different methods will be explained in details in this post.

 

1. 78K0/Ix2 Features for HB LED Control

 

The following 78K0/Ix2 features enables control of high brightness LEDs:

 

LED constant current drive can be controlled using PWM timers and analog peripherals (comparators and A/D converters). This approach contributes to remove the need of an external LED-dedicated driver IC.

The constant current feedback can be implemented with two different methods:

Comparator feedback

 

Fig1.jpg

Figure 1 - Block Diagram of 3-channel LED Control using 78K0/Ix2 (feedback by comparators)

 

 

 

10-bit A/D converter feedback

Fig2.jpg

#Figure 2 - Block Diagram of 3-channel LED Control using 78K0/Ix2 (feedback by A/D converter)

 

 

LED dimming is controlled using a comparator or PWM timer.

Again, two different LED dimming methods are available for the 78K0/Ix2 microcontroller:

1. DC dimming by changing the internal programmable reference voltage for the comparator

2. PWM dimming by using the 8-bit PWM timer (TMH1)

 

Three control interfaces for the HB-LEDs are offered using the A/D converter or serial interfaces:

1. Volume control by using the 10-bit A/D converter

2. DMX512 protocol communication control by using UART

3. DALI protocol communication control by using UART in DALI mode

 

In order to evaluate this low cost control method just introduced, Renesas Electronics Europe offers two demonstration kits, the 78K0/Ix2 LED Control kit which comes with an evaluation board fitted with the 78K0/IB2 to drive three channels of RGB high brightness LEDs, and the Lighting Communications kit for DMX512 and DALI communications, including two easy-to-use GUI tools for each aforementioned lighting protocol.

Fig3.jpg

 

Figure 3 – New Lighting Demonstration Kits for low cost LED Control

 

Where can you get more information about these new demonstration kits?

http://www2.renesas.eu/applications/industrial/02_building_management/050_lighting/050_led_lighting/030_resources/index.html

 

2. Constant Current Control Method

 

In order to perform control at a constant current, it is necessary to keep the sense voltage through the sense resistors the same as the target reference. The sense voltage is compared to the reference voltage and adjusted accordingly by controlling the PWM output (using an appropriate duty cycle).

 

The PWM outputs for Power MOSFET switching are generated using the enhanced 16-bit timers X0 and X1. A switching frequency up to 156.25 kHz is available because the timers use a 40 MHz clock  as counting source with an 8-bit resolution (40 MHz / 28).

 

To perform this comparison, 78K0/Ix2 can use two different methods based either on the internal comparators or on the A/D converter.

 

 

2.1 Internal Comparator Feedback

 

Thanks to its three internal comparators with programmable internal voltage references, the 78K0/Ix2 microcontroller can drive three channels of LEDs independently.

 

The valid edge of the comparator interrupt has to be specified to be both edges. Then, the comparator interrupt occurs while the sense voltage is higher or lower than the reference voltage. When this interrupt occurs, the constant current control is executed by adjusting the PWM duty cycle, according to the comparator output.

 

- When sense voltage > reference voltage => Comparator output = “high” => PWM duty cycle is reduced

- When sense voltage < reference voltage => Comparator output = “low” => PWM duty cycle is increased

Fig4.jpg

#Figure 4 – Example of Internal Comparator Feedback

 

 

The higher duty and lower duty parameters are stored beforehand.

 

This method contributes to reduce the software load because the CPU is not accessed before comparator interrupts occur.

 

 

2.2 Internal A/D Converter Feedback

 

The other method employs the 10-bit A/D converter that consists of up to 9 channels so that several LEDs can be driven independently using this feedback method.

 

The maximum and minimum target values of the A/D conversion results (the reference value for the sense voltage) can be decided based on the detection accuracy of the target current. If the input voltage Vi = VDD = 5 V, the sense voltage Vs = 1.4 V, and the ratio to define is 2%, the target range of A/D conversion result is supposed to approximately be equal to the target level ±5 LSB.

 

- When the A/D conversion result is over the maximum while increasing compared with the last result, the PWM duty cycle has to be stepped down.

- On the contrary, when the A/D conversion result becomes smaller than the minimum while decreasing compared with the last result, the PWM duty cycle has to be stepped up.

 

To speed up the startup period of LEDs, the duty cycle of PWM output has to be set to the target duty value related to the target A/D converter level before starting the timer X and the A/D converter (the target duty related to each target level can be determined by experimenting).

 

Fig5.jpg

Figure 5 – Example of Internal A/D Converter Feedback

 

 

Because converted values are immediately compared, the ripple of current is smaller and the dimming resolution can be higher using this feedback method. However, the CPU is used to perform all channel switching and comparison for A/D converter.

 

 

3. Dimming Control

 

Changing the brightness of LED, which is usually called dimming, can be achieved by varying the LED forward current. To do so with the 78K0/Ix2 microcontroller, two dimming methods are available: DC dimming and PWM dimming.

 

 

3.1 DC Dimming

 

By changing the internal reference voltage

 

As expressed earlier, when using the comparator feedback method, the 78K0/Ix2 microcontroller monitors the sense voltage and compares it to a stable reference voltage to keep the current constant. Therefore, changing this reference voltage contributes to modify the constant current to a different level, and the brightness of the LEDs reacts accordingly.

 

In that case, the internal reference voltage of each comparator has to be changed, as well as the higher duty and lower duty parameters.

 

The internal reference voltage can be changed in 32 steps in the range from 0.05 V (typ.) to 1.6 V (typ.). To increase the dimming resolution, the sense voltage when driving current at the maximum brightness must be set to as high a value as possible in the range of the internal reference voltage.

 

 

By changing the target level for the A/D conversion  result

 

For the A/D converter feedback method, dimming consists in changing the target level, as well as the target duty.

 

The reference voltage for the maximum brightness is selected by considering the hardware design and the limit of the A/D converter reference voltage. The dimming step number is decided by using maximum reference voltage and error margin for the target level.

 

To increase the dimming resolution, the sense voltage when driving current at the maximum brightness must be set to as high a value as possible within the range of voltages for which A/D conversion is possible (AVREF or less).

 

 

3.2 PWM Dimming

 

The 78K0/Ix2 microcontroller includes a function that performs gate control for the signals output by the 16-bit timers X0 and X1 (TMXn) by using the output of the 8-bit timer H1 (TMH1).

 

Keeping the reference voltage at the maximum level, LEDs can be dimmed in 255 steps by using the TMXn output gate function via the TMH1 output. A square PWM wave output by the 8-bit timer H1 can be set to control all four TMXn outputs. If TOH1 is combined with the outputs of 16-bit timers X0 and X1, the TMXn output is only enabled when the TOH1 output is at high level or low level.

Fig6.jpg

Figure 6 – Timing Chart for PWM Dimming

 

 

While using PWM dimming via TMH1, all TMX outputs will start or stop at the same time. Therefore, this method can be used to dim the LEDs of all channels at the same time.

 

Where can you get the related Application Note?

http://www2.renesas.eu/_pdf/U19666EJ1V0AN00.PDF

 

Author: Philippe Miquel, Graduate Engineer, Renesas Electronics Europe.

 

 

#

227 Views 0 Comments Permalink Tags: led, 78k0, ix2, lighting, 78k0/ix2

Let's wrap up our recent discussion of how to get accurate real-time measurements from a thermocouple or other sensor. I first discussed the problem and the fact that the relationship between temperature and voltage is nonlinear with a thermocouple, and described the polynomial that could deliver accurate results. I followed that post with a look at the brute-force approach to reading accurate temperatures with an ADC integrated on a microcontroller (MCU) such as the Renesas RX. A pre-calculated conversion table stored in memory may be a good choice in some applications. But for a minimum memory footprint, and therefore minimum system cost, your design must calculate the polynomial in real-time and a floating-point unit (FPU) can greatly accelerate that task.


You can certainly calculate a polynomial expression with a fixed-point MCU. The programmer must take care in coding the algorithm. First the constants or coefficients for each degree or order of the polynomial must be converted into a format conducive to integer math. Typically a portion of a 32-bit representation is the integer part of the constant and another portion is the fractional component. One such format would use a sign bit, 11 bits to represent the integer, and 20 bits to represent the fraction.

 

The algorithm would have to calculate each term of the polynomial. And each term would have be precisely shifted before the terms can be added. The integer approach can certainly work in some applications.

 

Alternatively, a programmer working with a fixed-point MCU could rely on a floating point library. The library handles the complex formatting and shifting operations. But the library approach won't likely yield compact code or optimal performance.

 

A programmer using a floating point MCU such as the RX has a relatively simple task. In the case of the RX MCU, floating point add instructions execute in four to five clock cycles and multiply instructions can take one cycle less.

 

Renesas application engineers performed some benchmarks to accurately project both the code size and execution time associated with the different approaches that we've discussed to deriving accurate temperature readings. The tests included both the pre-calculated table stored in memory, and the three approaches that we've discussed here today to calculate the polynomial in real time

 

The tests were based on evaluating a 5th order polynomial. And the test were run on an MCU operating at 32 MHz. The table below summarizes the results. The table-look-up approach is the fastest, but has a huge impact on code size. The library approach is clearly a poor choice. Fixed-point math could work in some applications, but the clear winner is using an FPU. The MCU with FPU handles the task in 7 µsecs using only 38 bytes of code.

 

thermo_table_550.jpg

234 Views 0 Comments Permalink Tags: renesas_rx, renesas_rx_mcu, renesas_mcu, thermocouple, polynomial, nonlinear_equation, floating_point_unit, fpu, analog_to_digital_converter, adc, maury_wright

Today I'd like to discuss interrupt response again relative to the Renesas RX microcontroller (MCU) architecture. We'll add an external interrupt into the mix and prepare for a later examination of how to minimize the exit time for interrupts.

 

Let's first take a look at the type of response that you can get from nested interrupts. We'll rely on the scenario that I described in the first post that I did on measuring interrupt response time. The test described measuring the interrupt response when an integrated timer was used to generate an interrupt upon overflow. The interrupt service routine (ISR) then read the value of the timer, and that value was the measure of the interrupt response time because the timer resets itself to zero upon overflow in addition to generating an interrupt.

 

Application engineers changed the test code bringing an external interrupt into the equation. The new test relies on the timer ISR to drive a signal on the RX610 prototype board low that in turn triggers an external interrupt on IRQ14. In the test code, IRQ14 was configured as a falling-edge interrupt with a priority that's higher than that of the timer interrupt. So the external interrupt causes the RX to stop the timer ISR and service IRQ14.

 

The IRQ14 ISR does little more than drive the triggering signal back to a high state. The application engineers used a scope to measure the time the triggering signal was low, to measure the response to the external IRQ14 interrupt. And remember that servicing that interrupt required that the RX first exit the timer ISR.

 

The external interrupt response was measured to be 320 nsecs or 32 CPU clock cycles. Of that 32 cycles, 6 cycles were spent in the IRQ14 ISR. So the time it took to exit the timer ISR and dispatch the first instruction in the IRQ14 ISR is 26 CPU cycles.

 

We can take a brief look at what happened during the 26 CPU cycles. The RX must POP the registers used by the timer ISR and restore the program counter (PC) and processor status word (PSW). The interrupt control unit (ICU) must process the new external interrupt, load a new interrupt vector from memory, and transfer control to the new address.

 

I've described the nested interrupt scenario for a couple of reasons. First the 26-cycle response is really good for servicing a nested interrupt. Moreover it could be made faster using the same techniques that I described in the post on the fast interrupt function and dedicated interrupt registers. If IRQ14 was deemed the most critical interrupt in the system, the backup PC and PSW could have shaved a couple of clock ticks off the interrupt response time, and dedicating registers to the ISR could save additional cycles in the IRQ14 ISR.

 

I also described this example to set the stage for another post on how the fast interrupt function accelerates the exit from an ISR – coming soon.

272 Views 0 Comments Permalink Tags: renesas_rx_mcu, maury_wright, renesas_rx, renesas_mcu, interrupt_response_time, interrupt_service_routine, interrupt_handler, isr, fast_interrupt_function, external_interrupt
RSS feed of this list 1 2 3 ... 7 Previous Next