Discussion in "8051 Discussion Forum" started by    vudiepdh1    Jan 8, 2010.
Fri Jan 08 2010, 08:14 pm
#1
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
#2
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:
	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
#3
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 ! =.=
Mon Jan 11 2010, 12:08 am
#4
Any help ?? =.=
Tue Jan 12 2010, 10:24 pm
#5
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.
Tue Jan 12 2010, 10:24 pm
#6
[Topic moved to 8051 Discussion forum]
 vudiepdh1 like this.
Thu Jan 14 2010, 07:56 am
#7
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
#8
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.


[ Edited Sat Jan 16 2010, 01:39 pm ]
Wed Aug 29 2012, 11:04 am
#9
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.
Thu Aug 30 2012, 11:29 am
#10
@Sonali Please create a new thread for yourself. Mention the project with link on which you're working right now.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Danielnof
Sat May 04 2024, 11:12 pm
oriminna
Sat May 04 2024, 08:28 pm
scaneraNom
Sat May 04 2024, 02:21 am
gtaletrzua
Fri May 03 2024, 10:55 am
Clydehet
Wed May 01 2024, 06:44 pm
Davidoried
Wed May 01 2024, 06:11 pm
KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am