![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
hello all i am thinkg of building digital speedometer published in edn.com link http://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 | |
| |
| | #2 |
|
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 | |
| |
| | #3 |
|
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 | |
| |
| | #4 |
|
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. | |
| |
| | #5 | ||
| Quote:
Quote:
Other AVR gurus in this forum will sure correct me if I'm wrong.
__________________ L.Chung | |||
| |
| | #6 |
|
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. | |
| |
| | #7 |
|
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 :-( | |
| |
| | #8 |
|
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.
| |
| |
| | #9 |
|
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 | |
| |
| | #10 |
|
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 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 | |
| |
| | #11 |
|
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 | |
| |
| | #12 |
|
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 | |
| |
| | #13 |
|
@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? | |
| |
| | #14 | |
| Quote:
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 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 | ||
| |
| | #15 |
|
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? | |
| |
|
| Tags |
| digital, speedometer |
| Thread Tools | |
| Display Modes | |
| |