hello all
i am thinkg of building digital speedometer published in edn.com link**broken link removed**)
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.
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.
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.
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.
fever said:
and abt using ATTiny2313,i am afraid that it might need some circuit/code modification.
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.
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 :-(
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.
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
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.
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
;############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
thanks.
i compiled this code using wavrasm.and shows "2313def.inc" not found error.so i did some googling and found this file https://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?
while searching for the simple programmer for AT90S2313 chip i found this programmer(**broken link removed** looks very simple to me.is it really gona work and safe.can i program AT90S2313 directly without destroying it.i don't want any in system programer.
just burning the chip in programmer and placing it in speedometer board.thats all i need.
The programmer I built uses 74HC244 as buffer, which is also a very common design you'll find on the net. There is certainly no harm whatsoever trying the above circuit first.
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.