AIM2 Stm32 Programming Guide

download AIM2 Stm32 Programming Guide

of 9

Transcript of AIM2 Stm32 Programming Guide

  • 8/18/2019 AIM2 Stm32 Programming Guide

    1/9

    AIM2.0 – STM32L152 Programming Guide

     The AIM 2.0 system consists of several key components and peripherals. This

    include the microcontroller STM32L12!"# i$loo %&'A# (M)S ima$e sensor# 1M*

    S!AM# Micro S"(ard and several sensors +Accelerometer# 'yroscope# analo$

    sensors etc,. (areful con-$uration and optimiation procedures are needed tomaintain a lo/ po/er operation. This document /ill descrie the necessarycon-$uration and pro$rammin$ for the microcontroller to achieve the optimal

    po/er performance.

    1.0 STM32L152 in Low power sleep mode (LPSleep.

     The microcontroller has several lo/ po/er operation mode. Amon$ all the lo/

    po/er modes# lo/ po/er sleep is chosen for a etter tradeo et/een po/er

    consumption and system functionality. eep in mind that# /hile in lo/ po/ermode# some peripherals need to e continuously run. Tale 1.0 sho/s the

    peripherals functionalities in dierent operatin$ mode.

     Tale 1.0

  • 8/18/2019 AIM2 Stm32 Programming Guide

    2/9

     The lo/ po/er sleep mode in the AIM2.0 system is con-$ured /ith the system

    clock +sysclk, runnin$ at 4325. The MSI clock +65, is used as the clocksource and this clock /ill e divided into 2 to $et 325. 7hile in lo/ po/er

    sleep mode# all the not connected '&I)s is con-$ured to e in analo$ mode and

    all other components in the system is s/itched o. To s/itch o the camera# fp$a

    and sram# the 2.89 and 1.29 re$ulators must e disaled. This can e done ycon-$urin$ the '&I) pin &(13 in reset mode. %i$ure 1.0 sho/s the code to putthe microcontroller in the lo/ po/er sleep mode. This should make the total

    current consumed y the AIM2 system to e in aout 6uA.

    %i$ure 1.0

    &lease note that the '&I) pin 13 should e con-$ure in pull do/n mode. This is

    to make sure that the '&I) is in the same direction /ith the output.

    (on-$uration in pullup mode /ill not achieve lo/est current consumption.

     The system /ill e /aken up from the lo/ po/er sleep mode y !T( +!eal Time(lock,. The !T( is con-$ured +!T(:(on-$+, function, to e clocked y LS; clock.

     The lo/ speed e

  • 8/18/2019 AIM2 Stm32 Programming Guide

    3/9

    %i$ure 1.1

  • 8/18/2019 AIM2 Stm32 Programming Guide

    4/9

    %i$ure 1.2

  • 8/18/2019 AIM2 Stm32 Programming Guide

    5/9

    1.2 !a"ing up #rom in$errup$

    "urin$ the ima$e capture mode# the system /ill $o to lo/ po/er sleep mode and

    /akes up at every 4=s +as mentioned in previous section,. )nce the system

    /akes up# the system /ill run the complete routine to capture an ima$e andstore in the S"(ard. This routine is de-ned in the !T( /akeup handler. The

    ee

  • 8/18/2019 AIM2 Stm32 Programming Guide

    6/9

  • 8/18/2019 AIM2 Stm32 Programming Guide

    7/9

    3.0 Main pro$ram

  • 8/18/2019 AIM2 Stm32 Programming Guide

    8/9

  • 8/18/2019 AIM2 Stm32 Programming Guide

    9/9