Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

[51] how to code a program to generate 10khz squar wave using microcontroller-8051 crystal

Status
Not open for further replies.

Murugappan.pl

Newbie level 2
Joined
Apr 30, 2015
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
12
how to code a program to generate 10khz squar wave using microcontroller-8051 crystal?as i am beignner help me
 

allsey87

Member level 4
Joined
Sep 27, 2010
Messages
70
Helped
17
Reputation
34
Reaction score
17
Trophy points
1,288
Activity points
1,902
Assuming you have your compiler and linker already set up to compile/build and upload the code and you don't need much. Once you are in the main function, set up the output pin (i.e. via the direction register) and toggle it after a delay of 100us.

A much better way is to use hardware timers, which allow you to configure a couple registers to generate the square wave without using CPU resources.
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top