Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

AN2038 Datasheet(PDF) 10 Page - STMicroelectronics

Part # AN2038
Description  I2C emulation with ST7MC in slave mode
PDF  23 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN2038 Datasheet(HTML) 10 Page - STMicroelectronics

Back Button AN2038 Datasheet HTML 6Page - STMicroelectronics AN2038 Datasheet HTML 7Page - STMicroelectronics AN2038 Datasheet HTML 8Page - STMicroelectronics AN2038 Datasheet HTML 9Page - STMicroelectronics AN2038 Datasheet HTML 10Page - STMicroelectronics AN2038 Datasheet HTML 11Page - STMicroelectronics AN2038 Datasheet HTML 12Page - STMicroelectronics AN2038 Datasheet HTML 13Page - STMicroelectronics AN2038 Datasheet HTML 14Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 10 / 23 page
background image
Software modifications
AN2038
10/23
The following steps are required to modify the standard libraries to emulate the I2C using
SPI:
●
First, configure the libraries using the configuration tools AK-ST7FMC Control Panel.
Refer to the related manual.
●
Copy the two provided modules (I2C.c, I2C.h, ProtoSup.c, ProtoSup.h) in the project
folder.
●
Copy the vector.c file provided into the project folder overwriting old vector.c file.
●
Copy the main.c file provided into the project folder overwriting old main.c file.
●
Open the workspace using Softec STVD7 v.3.10 Integrated Development Environment.
●
Add the two files I2C.c and ProtoSup.c in the "Source Files" folder of the workspace
and the two files I2C.h and ProtoSup.c in the "Include Files" folder of the workspace.
●
Inside the I2C.h file select the kind of motor defining the correspondent MOTOR_TYPE
constant PMAC, BLDC or AC:
#define MOTOR_TYPE PMAC
or
#define MOTOR_TYPE BLDC
or
#define MOTOR_TYPE AC
●
Interrupt priority setup:
If the AC (or PMAC) motor has been selected, then modify the
ST7_IntPrioritySetUp function defined in the st7_misc.c file:
ISPR0 = MCES_LVL_3 + MCC_SI_LVL_1 + EXT_IT0_LVL_2 + EXT_IT1_LVL_1;
ISPR1 = EXT_IT2_LVL_2 + MTC_U_CL_SO_LVL_3 + MTC_R_Z_LVL_2 +
MTC_C_D_LVL_2;
ISPR2 = SPI_LVL_2 + TIMER_A_LVL_2 + TIMER_B_LVL_1 + SCI_LVL_1;
If the BLDC motor has been selected, then modify the ST7_IntPrioritySetUp
function defined in the misc.c file:
ITSPR0 = MCES_LVL_3 + MCC_SI_LVL_1 + EXT_IT0_LVL_2 + EXT_IT1_LVL_1;
ITSPR1 = EXT_IT2_LVL_2 + MTC_U_CL_SO_LVL_3 + MTC_R_Z_LVL_3 +
MTC_C_D_LVL_3;
ITSPR2 = SPI_LVL_2 + TIMER_A_LVL_2 + TIMER_B_LVL_3 + SCI_LVL_1;
ITSPR3 = (AVD_LVL_1 + PWMART_LVL_2) | (u8)(0xf0);
Modification related to PMAC Motor
●
Modify the PMACparam.h:
●
Modify the define of target frequency
#define TARGET_FREQ_CL 1500
in
extern u16 TARGET_FREQ_CL;



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


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