AnsweredAssumed Answered

STM32L1xx performance question

Question asked by p.klemen on Jan 4, 2014
Latest reply on Jan 9, 2014 by p.klemen
Dear Sir/Madam,

In the past I have been using 8-bit AVR (Atmega328p) for my application. The application uses the following peripherals:

- I2C peripheral and
- USART peripheral

The data is read form the I2C device (slave) using fast mode (400 kHz), then some calculations are performed and the results are transferred to the PC using the serial communication.

The described chip was mounted on a custom board, and uses an external oscillator with 16 MHz.

I wanted to improve the performance of my application and decided to use the STM32L1xx chip (because of the low-power consumption), which can achieve a core clock of 32 MHz. I have transferred my application to the STM32L152 discovery board successfully, but have observed that the program cannot achieve the same speed as the AVR chip. I have tested the I2C communication with the oscilloscope and the clock frequency is indeed 400 kHz. My duty cycle is 50%.

And the core clock setting of the ARM are:

*=============================================================================
  *                         System Clock Configuration
  *=============================================================================
  *        System Clock source          | PLL(HSI)
  *-----------------------------------------------------------------------------
  *        SYSCLK                       | 32000000 Hz
  *-----------------------------------------------------------------------------
  *        HCLK                         | 32000000 Hz
  *-----------------------------------------------------------------------------
  *        AHB Prescaler                | 1
  *-----------------------------------------------------------------------------
  *        APB1 Prescaler               | 1
  *-----------------------------------------------------------------------------
  *        APB2 Prescaler               | 1
  *-----------------------------------------------------------------------------
  *        HSE Frequency                | 8000000 Hz
  *-----------------------------------------------------------------------------
  *        PLL DIV                      | 2
  *-----------------------------------------------------------------------------
  *        PLL MUL                      | 4
  *-----------------------------------------------------------------------------
  *        VDD                          | 3.3 V
  *-----------------------------------------------------------------------------
  *        Vcore                        | 1.8 V (Range 1)
  *-----------------------------------------------------------------------------
  *        Flash Latency                | 1 WS
  *-----------------------------------------------------------------------------
  *        Require 48MHz for USB clock  | Disabled
  *-----------------------------------------------------------------------------
  *=============================================================================

Does anybody have any similar experiences? I do not understand how the execution is slower with the ARM processor (faster clock + 32-bit)? Please tell me if you need any more information regarding this?

Thank you very much for any help/suggestions and best regards.

K

Outcomes