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] i want a square waveform with f=7mhz by bascom avr

Status
Not open for further replies.

hamid.abbaszadeh

Member level 3
Joined
Jan 26, 2012
Messages
63
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
iran
Activity points
1,666
HI ALL
i want a square waveform with f=7mhz by bascom avr
plz help me
expecting your comments
 

There is no way to produce such high frequency even if your AVR runs at 20MHz

---------- Post added at 11:47 ---------- Previous post was at 11:44 ----------

Just to clarify things, I assume that by 7mhz you meant MHz (7000000Hz), is this correct?
 

hi alexan
i generat high frequence to 6mhz ,but thats minor than 7mhz
help me
 

Sort out your mHz and MHz - it makes a difference of 1,000,000,000 times so affects the answer you will get.

Keith
 

I would be very interested to see the way you have used to generate a frequency of 6MHz (as you said), I say it's impossible.

The max frequency you can get from a AVR pin is about 500KHz, the only exception is the SPI clock which can go up to CPU/4 but you can't have a constant square wave using it, you will have small pauses between each byte transmission.

Alex
 

now i generat 10Mhz with avr by ctc mode in timer1
setting:

Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: 14000.000 kHz
// Mode: CTC top=OCR1A
// OC1A output: Toggle
// OC1B output: Toggle
// 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
TCCR1A=0x50;
TCCR1B=0x09;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00

hope this clarifies
 

I stand corrected, yes CTC is another way that can be used for pulse generation.
Your code should be able to give an output very close to 7MHZ with a 14MHz crystal so what is the problem?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top