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.

ATmega32 Code replacemnt for ATtiny13

Status
Not open for further replies.

Asadkh21

Junior Member level 1
Junior Member level 1
Joined
Oct 13, 2013
Messages
16
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Visit site
Activity points
119
Can anybody help me with writing a replacemnt code i wrote which should perform the same function as this one for ATtiny13.
This is what I want my AtTiny13 to do what my ATmega32 is doing right now.

Code:
#include <mega32.h>
#include <delay.h>

void main()
{
   DDRB=0xFF;
    while(1)
        {
        PORTB.0=1;
        delay_ms(2);
        PORTB.0=0;
        delay_ms(3);
        PORTB.1=1; 
        delay_ms(2);
        PORTB.1=0;
        delay_ms(3);
        }
        }
 
Last edited by a moderator:

I think it should be the same. Just properly change first #include statement (I guess even this is not necessary).
 

It is always a good idea to specify your compiler, in this case it seems to be codevision

The code is quite simple so you just need to chance the port if portb is not available in attiny and also change the pin number (PORTB.x) if you are using different pins.
You also need to chance the included header to match the chip you intend to use
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top