Rpm meter using at89c2051 ! Help me
Discussion in "8051 Discussion Forum" started by vudiepdh1 Jan 8, 2010.
Fri Jan 08 2010, 08:14 pm
Hi every body ! I'm new in microcontroler field . I'm trying to apply frequency counter code from Ajay Bhargave in my project ! I connect a button to pin p1.4 to start measure rpm and some Led to p3.0,p3.1,p3.2! Ajay 's code work fine but mine is not ! Please help me code in assem ! I'm really need it !
Fri Jan 08 2010, 11:25 pm
Please post your code so we can have a look at it. Also, please include many comments, so we can understand what you are trying to accomplish.
Also, please use the formatted block commands so we can read the code easliy, like this:
Also, please use the formatted block commands so we can read the code easliy, like this:
CSEG AT 0500H ; init software ; Program BUSCON register... STARTUP1: MOV BUSCON, #SYSTEM_SPEED ; Enable Debug Interrupt MOV IE, #0C0H ; Program Port-A Mode register... ; ------------------------------- ; bits 0-1 are control lines for the USB port... ; bits 2-3 are inputs /USB_WR_RDY and /USB_RD_RDY ; bits 4-7 are as follows: ; 4: /FIRE_LASER ; 5: /DISABLE_PK_DET ; 6: /HVPS_ENABLE ; 7: /OUTPUTS_ENABLE MOV A, #0F0H ; set 4-7 high... MOV DPTR,#PSD_REG_ADDR+04H ; DATAOUT_A register MOVX @DPTR,A ; program... ; Program Port-A Drive-Select register... ; --------------------------------------- ; bits 0-3 are set for slew-rate... ; bits 4-7 are set for open-drain... ; all off = standard CMOS push/pull CLR A ; all off... MOV DPTR,#PSD_REG_ADDR+08H ; DRIVE_A register MOVX @DPTR,A ; program...
vudiepdh1 like this.
Sat Jan 09 2010, 08:14 am
Here is my code and file proteus to simulate ! Now i don't use microcontroller 89c2051 ! I am using 8952 Please show me what wrong ! Correct it help me ! =.=
Tue Jan 12 2010, 10:24 pm
what changes have you made?
coz if you are going to count pulses then you can do that by simply giving pulses input to freq i/p pin in project. just change text on LCD.
coz if you are going to count pulses then you can do that by simply giving pulses input to freq i/p pin in project. just change text on LCD.
Thu Jan 14 2010, 07:56 am
No, your project is count pulses per second => frequency . But in my project i want to count rounds per minute . So you can see i multiply number of pulses with 60 to display Rpm , is that right ? But my problem is i can't recompile your code into hex file. Thus i can't do it with my project ! I added #include<sfr51.inc> too ! What's wrong ? Do u are using read51 program ?
Sat Jan 16 2010, 01:34 pm
Yes, you are correct
The main equation for frequency: Time = 1 / frequency,
because the frequency comes from cycles per time.
so, you want to know how many cycles in 60 seconds
Try this
RPM = T * 60
when
T = (1 / F)
where :
T = Time (in s)
F = Frequency (in Hz)
edit: fixed spelling.
The main equation for frequency: Time = 1 / frequency,
because the frequency comes from cycles per time.
so, you want to know how many cycles in 60 seconds
Try this
RPM = T * 60
when
T = (1 / F)
where :
T = Time (in s)
F = Frequency (in Hz)
edit: fixed spelling.
[ Edited Sat Jan 16 2010, 01:39 pm ]
Wed Aug 29 2012, 11:04 am
Hi @Ajay..
Rpm meter code is not working which given here, lcd display 0000value and here not given input to controller? plz give me idea...
Thank you.
Rpm meter code is not working which given here, lcd display 0000value and here not given input to controller? plz give me idea...
Thank you.
Thu Aug 30 2012, 11:29 am
@Sonali Please create a new thread for yourself. Mention the project with link on which you're working right now.
Powered by e107 Forum System