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.

Can any one help me to write the code for ATtiny 13

Status
Not open for further replies.

Arjunkapile

Newbie level 3
Joined
Feb 2, 2011
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,313
Hello,
I am working on project of IR obstacle detector using AVR (ATTiny13)
i need code for following flowchart!
Details :
1 IR LED (always on)
1 common led (on for 5 sec when TSOP = 1)
1 buzzer (on for 5 sec when TSOP = 1)
TSOP 1738 as IR sensor o/p =1 when IR detected
Frequency of ATtiny 1MHz internal
View attachment MY FLOW.bmp

start
|
\/
initialization of i/o
3 port bits output
1 port bit input
|
\/
ON IR
|
\/
____> check if <____NO_(wait for TSOP =1___
| TSOP=1
| |
| | YES
| \/
| on LED
| on Buzzer
| for 5 sec.
|________|
 

nandhu015

Advanced Member level 5
Joined
Feb 11, 2006
Messages
1,965
Helped
300
Reputation
600
Reaction score
224
Trophy points
1,353
Location
India
Activity points
9,847
Why dont you try to write yourself instead of asking others.

Start coding, comeup when you are in trouble, you can get help here.
 

hexreader

Advanced Member level 2
Joined
Apr 7, 2011
Messages
537
Helped
194
Reputation
392
Reaction score
196
Trophy points
1,323
Location
England
Activity points
4,867
If you want to learn how to code for AVR, I would suggest that you do the following projects in order:

1 Light an LED (a visible one, not IR)
2 Flash an LED
3 Light an LED in response to a button press
4 Light an LED for 5 seconds following button press
5 Work a buzzer
6 Work a buzzer for 5 sec
7 Light an LED in response to your TSOP output.
8 Put all these together towards your final project.

Write your code one step at a time, not all at once.

Hope this helps

EDIT: just realised.... TSOP1738 will not respond to IR LED always on. It will only respond to IR LED pulsed at 38KHz. So step 6.5 will be to learn all about PWM
 

Arjunkapile

Newbie level 3
Joined
Feb 2, 2011
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,313
@nandhu015

I really dont know the programming of avr but have to make the project with ATtiny 13 so if u can plz provide me the code which i can assemble/ compile an burn on Attiny13
:roll:

---------- Post added at 19:13 ---------- Previous post was at 19:10 ----------

[/COLOR]
If you want to learn how to code for AVR, I would suggest that you do the following projects in order:

1 Light an LED (a visible one, not IR)
2 Flash an LED
3 Light an LED in response to a button press
4 Light an LED for 5 seconds following button press
5 Work a buzzer
6 Work a buzzer for 5 sec
7 Light an LED in response to your TSOP output.
8 Put all these together towards your final project.

Write your code one step at a time, not all at once.

Hope this helps

EDIT: just realised.... TSOP1738 will not respond to IR LED always on. It will only respond to IR LED pulsed at 38KHz. So step 6.5 will be to learn all about PWM

thanx hexreader but i tried but very large no. of errors are come up
TSOP output is processed under various filters so it can give logical outputs
so plz help me out in coding for that flowchart
 

alexan_e

Administrator
Joined
Mar 16, 2008
Messages
11,895
Helped
2,021
Reputation
4,158
Reaction score
2,031
Trophy points
1,393
Location
Greece
Activity points
64,375
post your code so we can correct your mistakes, it is the only way to learn.

Alex

---------- Post added at 17:06 ---------- Previous post was at 16:49 ----------

A goop place to start is with basic I/O operation , learn about the three registers that control the direction and state of a pin.


Alex
 

Arjunkapile

Newbie level 3
Joined
Feb 2, 2011
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,313
post your code so we can correct your mistakes, it is the only way to learn.

Alex

---------- Post added at 17:06 ---------- Previous post was at 16:49 ----------

A goop place to start is with basic I/O operation , learn about the three registers that control the direction and state of a pin.


Alex

I am having problem to Initialization of ATtiny13 with internal clock
also dont know how to declare the DDRB and PORTB
and no idea how to check the single bit of PORTB
i have saw ur link few days before it helps me but i am still having problems mention above :-(
 

alexan_e

Administrator
Joined
Mar 16, 2008
Messages
11,895
Helped
2,021
Reputation
4,158
Reaction score
2,031
Trophy points
1,393
Location
Greece
Activity points
64,375
The code in that website is for AVR-gcc , what compiler/IDE do you have?
You don't need to declare the ports , you only need to include the header file for your mcu but each compiler used different way.

Alex
 

nandhu015

Advanced Member level 5
Joined
Feb 11, 2006
Messages
1,965
Helped
300
Reputation
600
Reaction score
224
Trophy points
1,353
Location
India
Activity points
9,847
first download and install avr studio from atmel website.

Read the tutorials given in the above posts.

You will get better idea and you will be able to do your project easily

Happy Programming
 

Arjunkapile

Newbie level 3
Joined
Feb 2, 2011
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,313
Hey i successfully assemble the code thanks everyone !!! but this topic is not closed now i am making Hardware for that i surely require your help ones again thanks to
alexan_e, nandhu015, hexreader :-D
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top