Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

tachometer

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
fogassa

Bascom Member



Joined: 19 Dec 2005
Posts: 3

blank.gif
PostPosted: Mon Dec 19, 2005 4:19 am    Post subject: tachometer Reply with quote

Confused

HI All,
I'm tring to make a simple tachometer that reads from 100 to 65000 rpm.and display it on lcd
I'm using bascom and at90s2313 with 4mhz cristal(can use 10mhz)
I've adapted the code bellow from BAsic stamp, I can get a reading but it's not correct.
I've read thebascom help files but not much about pulsein, it says it will increment count by 10us but that varies with cristal.
If I'm using a 4mhz cristal what is the pulsein increment?
Could someone point me in the right direction?


Dim Rpm As Word
Config Portb = Output
Config Portd = Input
Portd = 255 'enable Portd pullup's

Config Lcdbus = 4
Config Lcd = 16 * 2
'Config Lcdpin = Pin , Db4 = Pb.4 , Db5 = Pb.5 , Db6 = Pb.6 , Db7 = Pb.7 , E = Pb.3 , Rs = Pb.2
Cls
Cursor Off Noblink
Cls


Tach:
Do
Wait 1
Pulsein Rpm , Pind , 6 , 1
Rpm = Rpm / 100
Rpm = 60000 / Rpm



Cls
Lcd "RPM ;rpm
Loop



'----

Fogassa.
Back to top
View user's profile
kazi

Bascom Member



Joined: 21 Oct 2005
Posts: 19
Location: Cape Town

southafrica.gif
PostPosted: Sun Apr 16, 2006 11:56 am    Post subject: tachometer Reply with quote

Hi

I hope I can still help you.

The way I did it is to count the amount of pulsses per second.

I used a 1 second timer and in0 or in1 to count the pulses.

If you have the amount of pulses/second (hz) then you can convert to rpm.
Back to top
View user's profile Visit poster's website
erwin4838

Bascom Member



Joined: 24 Feb 2012
Posts: 39
Location: Indonesia

indonesia.gif
PostPosted: Sat Feb 25, 2012 10:26 am    Post subject: Reply with quote

can u share output 2digit with 7segment,tks
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum