Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

generate 40KHz square wave:

Status
Not open for further replies.
The Ultrasonic transmitter (transducer) is effectively a capacitor and when you supply a voltage in one direction, it gets charged.
You must now supply a voltage in the opposite direction to fully discharge it and charge it in the opposite direction. This is how you will get the greatest output. If you drive it with a transistor, you need a resistor across the device to discharge it. That's why push-pull is the best method.
 
Last edited:
40khz using ATMEGA16

load the 16-bit timer1 with below values and you will get 40khz pwm.
frequency may be slightly more or less then 40khz. to get exact 40khz just adjust Icr1l......................Thats it.:)
Tccr1a = &B10100010
Tccr1b = &B00011001
Icr1h = &H00
Icr1l = &HC7

Ocr1bh = &H00
Ocr1bl = &H50
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top