Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Generating a pulse with variable Frequency.

Status
Not open for further replies.

fateme91

Member level 2
Joined
Nov 18, 2014
Messages
48
Helped
2
Reputation
4
Reaction score
2
Trophy points
18
Location
Iran,Mashad
Activity points
349
Hi every body
i have an atmega128A and i need to generate a pulse with duty cycle 50% and i need to change it's frequence from 5kHz to 10 Khz.
I need this pulse to give it to an optocoupler. and measure the output frequency.
And which mode is better ? does timer1 is ok? which parameters do i need?
 

does timer1 is ok?

In AVR, PWM Mode is available in all timers. TIMER0 and TIMER2 provide 8bit accuracy whereas TIMER1 provides 16bit accuracy. In 8bit accuracy, you have 256 individual steps, whereas in 16bit accuracy, you have 65536 steps.

which mode is better ?

If you want to control the speed of DC motors or brightness of LEDs, go for any one of them. But if you are using it for telecommunication purposes, or for signal sampling, fast PWM would be better. For general applications, phase correct PWM would do.

measure the output frequency

measuring the output with same controller which is generating the PWM?
 
Thank u so much...
i used CTC mode on Timer1 .I want to measure and change frequency. i found it I think OCR1 is the register that should change..


In AVR, PWM Mode is available in all timers. TIMER0 and TIMER2 provide 8bit accuracy whereas TIMER1 provides 16bit accuracy. In 8bit accuracy, you have 256 individual steps, whereas in 16bit accuracy, you have 65536 steps.



If you want to control the speed of DC motors or brightness of LEDs, go for any one of them. But if you are using it for telecommunication purposes, or for signal sampling, fast PWM would be better. For general applications, phase correct PWM would do.



measuring the output with same controller which is generating the PWM?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top