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.

[AVR] code help an error coming

Status
Not open for further replies.
Re: code help an error coming pls solve

ok i watch these sites i apply this then i reply back sir thank you

- - - Updated - - -

sir these coding giving in links are for atmega8 but i m using atmega 16 so how could they work on that sir
 

Re: code help an error coming pls solve

but how sir the register they are using are different
 

Re: code help an error coming pls solve

but how sir the register they are using are different

Sorry, but you should be thinking a little bit about it. This forum is of course for help, but we couldnt write the entire source code instead of you.

If atmega16 doesnt have some register or peripheral module, so use another or rename the register. Just open the user guide for Atmega16...

Or tell us which register is different :)
 

Re: code help an error coming pls solve

i get a code from a faclity of interfacing but the he give is without LCD so i attach this pls see which variable is use to get value on lcd
Code:
#include <stdio.h>

#include<avr/interrupt.h>

#include <avr/io.h>

#include <util/delay.h>

 

char i=0,j=0,k=0,l=0,data=0;

char A[40]="                    ";

char B[40]="                    ";

char C[5]="     ";

ISR(TIMER0_OVF_vect){

data=0;

i=40;

if(j>20)k=j;

j=0;

}

 

ISR(INT0_vect){

if(i==10)data=1;

j++;

if(i==40)l=TCNT0;

if(TCNT0>100)A[i--]=1;

else A[i--]=0;

TCNT0=0;

}

 

int main(void){

DDRA=255;

enable_INT0(2);

set_timer0_normal();

set_timer0_prescalar(3);

enable_timer0_overflowint();

sei();

while(1){

while(data){

C[1]=(A[16]<<7)+(A[17]<<6)+(A[18]<<5)+(A[19]<<4)+(A[20]<<3)+(A[21]<<2)+(A[22]<<1)+(A[23]<<0);

if(C[1]==1)PORTA^= 1 << 0;

if(C[1]==2)PORTA^= 1 << 1;

if(C[1]==3)PORTA^= 1 << 2;

if(C[1]==4)PORTA^= 1 << 3;

C[1]=0;

_delay_ms(50);

data=0;

}

}

return 0;

}
 

Re: code help an error coming pls solve

Provide the link from where you got the code in post #1. I need to know the MCU he used to check its datasheet before translating it to your MCU.
 

Re: code help an error coming pls solve

**broken link removed**

this is the link ur where i got the code
 

Re: code help an error coming pls solve

it get work when i change muc freq.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top