Continue to Site

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.
|________|
 

Why dont you try to write yourself instead of asking others.

Start coding, comeup when you are in trouble, you can get help here.
 
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
 
@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
 

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
 
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 :-(
 

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
 

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
 

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top