for learning

Dependencies:   mbed FastPWM

Revision:
2:a1c0a37df760
Parent:
0:51c43836c1d7
Child:
11:82d8768d7351
diff -r e04e563be5ce -r a1c0a37df760 INIT_HW/INIT_HW.cpp
--- a/INIT_HW/INIT_HW.cpp	Mon Aug 19 08:05:09 2019 +0000
+++ b/INIT_HW/INIT_HW.cpp	Tue Aug 20 07:38:55 2019 +0000
@@ -21,14 +21,12 @@
      GPIOC->MODER |= 0b1100001100;             //each channel   // PC_4, PC_1 are analog inputs 
      GPIOB->MODER |= 0x3;                                       // PB_0 as analog input
      
-     ADC1->SMPR1 |= 0x1000;                                     // 15 cycles on CH_14, 0b 001000000000000
-     ADC2->SMPR1 |= 0x1000000;                                  // 15 cycles on CH_8, 2^24 = 16^6
-     ADC3->SMPR2 |= 0b1000;                                        // 15 cycles on CH_11, 0b 001000;
+     ADC1->SMPR1 |= 0x00001000;                                     // 15 cycles on CH_14, 0b0001000000000000
+     ADC2->SMPR2 |= 0x01000000;                                     // 15 cycles on CH_8,  0b0000000100000000<<16
+     ADC3->SMPR1 |= 0x00000008;                                     // 15 cycles on CH_11, 0b0000000000001000
 
     }
     
-    
-
 void Init_PWM(){
 
     RCC->APB1ENR |= RCC_APB1ENR_TIM4EN;                         // enable TIM4 clock