Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

measurement of speed with atmega

Status
Not open for further replies.

iulian2010

Newbie level 3
Joined
Jul 23, 2009
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,305
bascom lcd speed problem

I am new on this forum and say "Hello everyone!"

I want to measure and read in real time the speed in mm/sec.
I use a linear transducer (it work between 0-10 V dc.), Atmega 8, lcd 16x4 and to compile i use Bascom-AVR.
I tried several times to write the code , but without results.
Can you help me with code in Bascom-AVR (if it is possible) for this problem?
I use until now:

$regfile "m8def.dat"
Config Lcdpin = Pin , Db4 = Portd.4 , Db5 = Portd.5 , Db6 = Portd.6 , Db7 = Portd.7 , E = Portd.1 , Rs = Portd.0
Config Lcd = 20 * 4
Config Adc = Single , Prescaler = Auto , Reference = Avcc 'config ADC
Start Adc
Dim W As Word..
Do
W = Getadc(0)

....speed = ?......

Lcd "speed" ; speed ; "mm/sec"
Loop
End

Thanks



[/quote]
 

ashad

Full Member level 6
Joined
Mar 28, 2006
Messages
394
Helped
40
Reputation
80
Reaction score
27
Trophy points
1,308
Location
Trento, Italy
Activity points
3,298
config adc

why not u use C language ... i think it is easy to debug in C language
 

iulian2010

Newbie level 3
Joined
Jul 23, 2009
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,305
code lcd20*4 adc

Thanks for your advice
Say that C is easier? Think you can help me in C language with my problem? or anyone?
I chose Bascom because it can compile and simulate. I am beginner in programming languages. In C language don't know anything. For me will be difficult to learn C language.
Thanks in advance
 

doraemon

Super Moderator
Staff member
Joined
Jun 21, 2009
Messages
1,068
Helped
273
Reputation
554
Reaction score
248
Trophy points
1,343
Location
Japan
Activity points
10,597
Re: measurement speed

Hello!

Your question is to vague to be answered. Even with the code.
1. Can you read something from your transducer?
(do you have any menans of tracing whet the GetADC reads?)
2. Does the value you read seem to be correct? Try to move
something for instance by 100 mm / second, try to make a measure
3. Does your LCD work? Is there something displayed? Can you
write "hello"? Can you write an integer / float / whatever?

Dora

iulian2010 said:
I am new on this forum and say "Hello everyone!"

I want to measure and read in real time the speed in mm/sec.
I use a linear transducer (it work between 0-10 V dc.), Atmega 8, lcd 16x4 and to compile i use Bascom-AVR.
I tried several times to write the code , but without results.
Can you help me with code in Bascom-AVR (if it is possible) for this problem?
I use until now:

$regfile "m8def.dat"
Config Lcdpin = Pin , Db4 = Portd.4 , Db5 = Portd.5 , Db6 = Portd.6 , Db7 = Portd.7 , E = Portd.1 , Rs = Portd.0
Config Lcd = 20 * 4
Config Adc = Single , Prescaler = Auto , Reference = Avcc 'config ADC
Start Adc
Dim W As Word..
Do
W = Getadc(0)

....speed = ?......

Lcd "speed" ; speed ; "mm/sec"
Loop
End

Thanks
 

iulian2010

Newbie level 3
Joined
Jul 23, 2009
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,305
Re: measurement speed

Hello
Thanks a lot for your help doraemon.

For the first step I configured the adc converter and I could read on lcd from the transducer the value which I needed.
The length of transuder is 1000mm and his output voltage is between 0-10V dc.
I solved the problem with the code, with the help of a friend.
If is need I'll post the code here for those who need help.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top