beginner questions...

General discussion on mikroPascal for AVR.
Post Reply
Author
Message
pfannkuchen2001
Posts: 3
Joined: 08 Nov 2007 12:20

beginner questions...

#1 Post by pfannkuchen2001 » 08 Nov 2007 13:24

hi, i*m very very new to programming microcontrollers.
can someone tell me how i can "read" inputs on a atmega8?

at PD2 there is a sinus-curve (0-5V) betwen 40hz an 1000hz. and i want to write a litle program, that calculates the frequency.

how would be the code when i want, that an LED (at PD4) swiches on everytime, when there were 10000 "highs" and swiches off for the next 10000 "lows" at PD2 and then again and again...

is it possible to get a signal high or low with "if portd.2 = 0" or "if portd.2 = 1"???

please help.

(sorry that my english is sooo bad...)



Pfken

pfannkuchen2001
Posts: 3
Joined: 08 Nov 2007 12:20

#2 Post by pfannkuchen2001 » 08 Nov 2007 14:17

aahh!

i know why this was not working.... ....i wanted to read PD2 with portd.2 but this should be pind.2.....

pfannkuchen2001
Posts: 3
Joined: 08 Nov 2007 12:20

#3 Post by pfannkuchen2001 » 08 Nov 2007 16:15

hey again,

i need help.
i want to work with frequences. and i found a realy nice source code for this. but it is not for AVR chips. its for PIC.

could someone be sooo nice, and translate this for me? i want to use an atmega8....

i dont need to have this on an lcd. a variable whith the frequency is enough.

here is the code: http://tinyurl.com/yq3d3b (in the second post)


THANKS A LOT!!!!

Hannes

earlyperl
Posts: 23
Joined: 04 Nov 2007 22:51
Location: Germany
Contact:

#4 Post by earlyperl » 02 Dec 2007 15:02

Hallo Hannes,
ist ja beruhigend, dass ich hier nicht der einzigste deutsche bin,
der mit mikropascal arbeitet.

Aber die Arbeit dass zu übersetzen, musst du dir wohl selber machen.

Gruß
Marco

Post Reply

Return to “mikroPascal for AVR General”