| Electronic Components Datasheet Search |
|
AN2038 Datasheet(PDF) 10 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2038 Datasheet(HTML) 10 Page - STMicroelectronics |
|
10 / 23 page ![]() 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; |
|
|
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 |
| 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 |