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.

Urgent help plzzz...8051F330...C Code

Status
Not open for further replies.

figo11

Newbie level 2
Newbie level 2
Joined
Jul 11, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,296
hi everyone..

i using a a 8051F330 to do a frequency counter using timer 0..

but i don't how to write the c codes can anyone help me with it by sending me the codes or post it in here.. thank a lot
 

We dont do home work here... you post whatever you have done and tell where you are struck.... everyone will help you....

i using 8051F330 to do a frequency counter

first i have a pwm frequency input into INT 0 .
using timer 0 to count the number of pulse in 1sec and display it in a lcd.
But i cant display it. So i dont whether it my counting of pulse wrong or is my way of displaying the value in lcd worng..
Can anyone help me
Below is the program i wrote..
============================

unsigned int count;
void tmr0PulsesInit(void){
TR0 =0;
TMOD =(TMOD & 0xf0)|0x01; // set timer 0 to mode 1
TH0 =0;
TL =0;
count = 0;
TR0=1;
ET0 = 1;
EA =1;
}

void tmr0PulseISR(void) interrupt 1 using 1{
TF0 = 0;
TR0 = 0;
count = TH0TL0;
TR0 =1;
}

void main (void){
Init_Device();

tmr0PulseInit()

while(1)
{
lcdPutStr("Fequency Counter :");
lcdSeXY(0,1);
lcdPutDecU8(counter);
}
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top