Electronic Components Datasheet Search
  English  ▼

X  

STPS1L60 Datasheet(PDF) 17 Page - STMicroelectronics

Part # STPS1L60
Description  Digital constant-current controller
PDF  34 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

STPS1L60 Datasheet(HTML) 17 Page - STMicroelectronics

Back Button STPS1L60 Datasheet HTML 13Page - STMicroelectronics STPS1L60 Datasheet HTML 14Page - STMicroelectronics STPS1L60 Datasheet HTML 15Page - STMicroelectronics STPS1L60 Datasheet HTML 16Page - STMicroelectronics STPS1L60 Datasheet HTML 17Page - STMicroelectronics STPS1L60 Datasheet HTML 18Page - STMicroelectronics STPS1L60 Datasheet HTML 19Page - STMicroelectronics STPS1L60 Datasheet HTML 20Page - STMicroelectronics STPS1L60 Datasheet HTML 21Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 17 / 34 page
background image
AN3151
Firmware implementation
Doc ID 17051 Rev 1
17/34
5
Firmware implementation
Below are some details of firmware implementation.
It's not an exhaustive firmware implementation description but it mainly focuses on some
important microcontroller settings: TIM1, ADC and PI controller implementation.
The firmware developed for the LED Streetlight application is based on STM8S firmware
library release 1.1 and entirely downloadable from the internet.
The firmware described in this application note is entirely available; to obtain a copy please
contact your closest ST office.
5.1
Basic initialization of peripherals and I/O pins
At the beginning of the main program, all the peripherals and I/O pins are configured as
described below:
The Clock source is selected in order to have the maximum frequency by means of an
external 24 MHz oscillator.
GPIO PINs are configured for: ADC channels (floating input) and I/Os.
TIMER (TIM1) configuration: Ch1, Ch2, Ch3, and Ch4 are configured in center aligned
mode and provide an AD triggering signal to ADC for conversion by TRGO.
ADC Configuration: AIN8, AIN9, AIN10, AIN11, and AIN12 are converted one by one
during the “update” event forced by TIM1. Single shot conversion has been set.
Other firmware settings are for interrupt and joystick/pushbutton management. The joystick,
soldered onto the control section, is useful in debug phase to change the PI gains.
This feature is implemented on a low priority interrupt.
5.2
Peripheral settings
The main peripheral settings are:
Clock configuration
TIM1 configuration
ADC configuration
The clock configuration is related to the PRESCALER by means of the function:
/* Configure the Fcpu to DIV1*/
CLK_SYSCLKConfig(CLK_PRESCALER_CPUDIV1);
The TIM1 configuration is:
TIM1_DeInit();
TIM1_TimeBaseInit(0,TIM1_COUNTERMODE_CENTERALIGNED1, PWM_PERIOD,5);



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com