Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 25th May 2006, 04:22 AM   #1
Default digital speedometer using AT90S2313

hello all
i am thinkg of building digital speedometer published in edn.com linkhttp://www.edn.com/article/ca529384.html)
it uses AT90S2313 which is pretty old but i still wana go with it.
before starting it,i want u people to have a look.
is it worth making,imean is this really gona work? it looks ok to me.

pls do post ur openion
thanks
fever is offline  
Old 25th May 2006, 08:16 AM   #2
Default

I am just start learning AVR but these are my suggestions:

1. Do not use a bridge rectifier before the 7805 on a +12V DC system in the car. You would create two different grounds which is not necessary and have no real advantages at all.

2. The AVR reset pin should have a 10K resistor pull up to +5V.

3. Consider using the ATTiny2313 instead, which is cheaper, easily available and pin/code compatible. Just remember to setup correctly the fuses for the proper clock speed.
__________________
L.Chung
eblc1388 is offline  
Old 25th May 2006, 03:27 PM   #3
Default

It uses it's own wheel sensor for some reason, rather than just using the one already in the car. It would be easier to just tap the cars VSS line.

Otherwise, it's a very simple design and project.
__________________
Mark Higgins
DirtyLude is offline  
Old 26th May 2006, 06:29 AM   #4
Default

well thanks for ur replies guys.
i wanan use it for my bike which is powred by 12v 2.5Ah battery.so i'll use my bike battery using 7805 to power this circuit.
@eblc1388
is there any particular reason why i need 10k resistor for avr reset?
and abt using ATTiny2313,i am afraid that it might need some circuit/code modification.
fever is offline  
Old 26th May 2006, 08:30 AM   #5
Default

Quote:
Originally Posted by fever
is there any particular reason why i need 10k resistor for avr reset?
Not particularily. The AVR itself already has a 100K internal pullup resistor at the reset pin but I usually use a 10K external resistor. You can say I don't trust/rely totally on the internal resistor when an external capacitor is also connected.

Quote:
Originally Posted by fever
and abt using ATTiny2313,i am afraid that it might need some circuit/code modification.
As I have said, I'm learning AVR right now so I might be wrong. As far as I know, the Tiny2313 is pin/code compatible to 90S2313.

Other AVR gurus in this forum will sure correct me if I'm wrong.
__________________
L.Chung
eblc1388 is offline  
Old 26th May 2006, 05:12 PM   #6
Default

You do not need the resistor. Though out of habit (from PICs) I sometime pop a 10K in on the AVR, though I can remove it and it works fine.

Make sure you have decoupling. Some cellphone frequencies might be a problem. I did a circuit for a friends bike, and his Nextel would reset it until we added more caps. The circuit was in a compartment where he stored his phone.

Circuit was to make his tag go up under the fender. He told me it was for when they do their trick riding videos, before you guys jump on me. hehehe.. And yea, I doubt that was what it was for, but a fun project.
mramos1 is offline  
Old 26th May 2006, 05:21 PM   #7
Default

thanks guys
i'll start making it soon.i hope it will work.
main problem iam facing with it is pcb layout.that site is't providing any layout for this ckt,and my drawing skills sucks :-(
fever is offline  
Old 26th May 2006, 05:28 PM   #8
Default

Try Eagle CAD, it is nice, capture it, click board, drag parts on the work area, autoroute, then you move them parts and traces around. Also, you can SPLIT traces, and add jumpers and not have to mess with double sided boards.
mramos1 is offline  
Old 27th May 2006, 12:04 PM   #9
Default

oooffff
making PCB layout is not really that easy.any way i'll request someone on net to design it for me.

and about the code.the default radius 0specified in the ASM is 25cm.
i found only one place where this 25 is being used.is it ok or i missing something

;########Registers used for delays############
.def low_del=r24
.def hi_del=r25
fever is offline  
Old 27th May 2006, 12:32 PM   #10
Default

No. You have look at the wrong place. See the following code.

Code:
;############For distance measurement################
;After every 100 m the registers holding distance values 
;are incremented. For this we have used following formulae
; 2*pi*R*n/100 = 100
;R = radius of the wheel in cm (In this design R=25cm)
;n is the count which signifies that 100 m has been completed 

.equ n = $40
Now $40 is a way hexadecimal number is represented so $40 is actually 64 in decimal. According to the formula, the required N is 63.66 so the author rounded it up to 64 instead.

For different radius of wheel, use the following equation that I worked out for you from the same equation:

N= 1591.54 / R ; Where R =radius of wheel (in cm)

You do not have to convert the number N into hexadecimal as the assembler understands both format. Just write it without the "$" sign.
__________________
L.Chung
eblc1388 is offline  
Old 27th May 2006, 03:50 PM   #11
Default

ohh thanks for the new equation
actaully my wheel size is 30cm so N=1591.54/30=53.051 or 53
so the new code shld be
Code:
;############For distance measurement################
;After every 100 m the registers holding distance values 
;are incremented. For this we have used following formulae
; 2*pi*R*n/100 = 100
;R = radius of the wheel in cm (In this design R=25cm)
;n is the count which signifies that 100 m has been completed 

.equ n = 53
is this right?
fever is offline  
Old 27th May 2006, 05:14 PM   #12
Default

Yes. But you should also change "in this design R=25cm" to R=30cm in the comment too to remind yourself later when you read back the code.
__________________
L.Chung
eblc1388 is offline  
Old 27th May 2006, 05:55 PM   #13
Default

@eblc1388
thanks ur really helpfull.
thanks a lot.

i think what we modified above is only For distance measurement.then what abt speed measurement.do we have to change the code there also?
fever is offline  
Old 27th May 2006, 07:46 PM   #14
Default

Quote:
Originally Posted by fever
i think what we modified above is only For distance measurement.then what abt speed measurement.do we have to change the code there also?
Yes, you're right. I missed that.

Code:
;############For speed measurement#################
;speed = 2*pi*R*3600*clk/time_count*1000*x
;R = radius of the wheel in cm (In this design R=25cm)
;time_count = value of timer counter in b/w
;two successive interrupts
;x = clock prescaler used (in this design x=1024)
;using this we have calculated the equivalent value of 
;all the constants (except time_count all other parameters
;are constants)
;sh and sl are binary equivalent of this constant

.equ sh = $56
.equ sl = $49	
.equ sht = $57		;sht = sh + 1
Now the above formula works out to be:

Speed(Km/h) = 883.56 * R / time_count

If r=25cm, then 883.56*25=22089 and that converted to hexadecimal is $5649.

So in your case with r=30cm, 883.56*30=26507 =$678B

Thus your new code shall be:
.equ sh=$67
.equ sl=$8B
.equ sht=$68 ;sht=sh+1
__________________
L.Chung
eblc1388 is offline  
Old 28th May 2006, 08:23 AM   #15
Default

thanks.
i compiled this code using wavrasm.and shows "2313def.inc" not found error.so i did some googling and found this file http://www.qsl.net/zl1vk/Atmel2313definc.txt
i placed this file in same folder and compiled the speedometer ASM once again.now it created a hex file(i think this is what i needed to burn on chip directly).
my doubt is is that Atmel2313definc.txt is universal.i mean can i use it for any source with AT90S2313 chip?
fever is offline  
Reply

Tags
digital, speedometer

Thread Tools
Display Modes




All times are GMT. The time now is 08:09 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker