| Electronic Components Datasheet Search |
|
AN2388 Datasheet(PDF) 33 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2388 Datasheet(HTML) 33 Page - STMicroelectronics |
|
33 / 54 page ![]() AN2388 Software design 33/54 Figure 30. Time diagram Initialization routine ************************************************************************************ **************************INIT ROUTINE* ************************************************************************************ ************************* void Configure_PWM(void)// PWM module configuration { Set Direction Port PWM CHANNEL 1,2,3 : Outputs Set PWM MODE : CENTER ALIGNED MODE Set PWM FREQUENCY ;//16 kHz @ 64MHz Enable PWM INTERRUPT Enable Channels; } void Configure_ADC(void)// Configure AD module { Set AD Conversion Mode: Single Conversion; Set Channel : channel1, channel2 ; } void Configure_Encoder(void) { Configure Timer T3: Timer for encoder reading sets for any transition counting Enable Timer; } void Configure_TIMERS(void) { T01CON = 0x0206 ; // Timer 1 enabled, T1M=0(Timer Mode) T1I=011 --//>prescaler=32 ,Tres=0.5uS with 64MHz // Timer 0 enabled, T1M=0(Timer Mode) T1I=111 -->prescaler=1024 // Tres=16uS with 64MHz T1IC=0x0007 // T1 interrupt priority levelxxx , group level x T1IE = 1 // Enable interrupts T1 = 0 ; // T1 starts from 0 T1R = 1; //Timer 1 for speed sensing T0IC=0x0009 // T1 interrupt priority levelxxx , group level x T0IE = 1 // Enable interrupts T0 = 0 // T1 starts from 0 T0R = 1; //Timer 1 for speed sensing } |
|
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 |