Don't ad-block us - support your favorite websites. We have safe, unobstrusive, robotics related ads that you actually want to see - see here for more.
0 Members and 1 Guest are viewing this topic.
snt phase and frequency correct mode better than fast pwm
phase and frequency correct mode is better than fast pwm
// Timer/Counter 1 initialization// Clock source: System Clock// Clock value: 1000.000 kHz// Mode: Fast PWM top=ICR1// OC1A output: Non-Inv.// OC1B output: Discon.// OC1C output: Discon.// Noise Canceler: Off// Input Capture on Falling Edge// Timer 1 Overflow Interrupt: Off// Input Capture Interrupt: Off// Compare A Match Interrupt: Off// Compare B Match Interrupt: Off// Compare C Match Interrupt: OffTCCR1A=0x82;TCCR1B=0x1A;TCNT1H=0x00;TCNT1L=0x00;ICR1H=0x4E;ICR1L=0x20;OCR1AH=0x00;OCR1AL=0x00;OCR1BH=0x00;OCR1BL=0x00;OCR1CH=0x00;OCR1CL=0x00;
OCR1A=1500; //DECIMAL
OCR1A=2400;
while( OCR1A < 2400){OCR1A++;delay_ms(55);}
I wish I knew more about C language. The university I'm going to had us start becoming familiar with assembly language, so C is a little different,
I'm using Timer 3 and C code, but this may give you some ideas, I'm also running it at 16Mhz.
Started by anilg Mechanics and Construction
Started by ibot Electronics
Started by Janizary Mechanics and Construction
Started by joystick Electronics