AVR start

Borbas, Imre Imre_Borbas at or.mxim.com
Fri May 2 19:19:21 CEST 2003


Udv!
Szerintem az PORTC=0xff; utasitas helyett outp(0xff,PORTC) kellene, hogy
bekapcsold a felhuzoellenallasokat. Ez csak egy tipp, lehet, hogy hulyeseg,
de egy probat meger.
Imi

> -----Original Message-----
> From: Dukai Zoltan [mailto:dzoolee at yunord.net]
> Sent: Friday, May 02, 2003 09:24
> To: elektro at tesla.hu
> Subject: Re: AVR start
> 
> 
> Udv a listanak!
> Akik GCC-t hasznalnak vagy akarki:
> Ugy ertelemzem hogy ahhoz hogy olvassak egy portrol, akar egy 
> labrol a DDRC 
> (errol szeretnek olvasni) -t 0x00-val toltom fel, ekkor input 
> pinek lesznek.
> PORTC-be 0xFF-et irok, felhuzoellenallatok mukodesbe lepnek.
> Csinaltam egy szep futofeny progit.
> Atnezne vaaki hogy a PINC0 valtozasra miert nem reagal? mit 
> rontottam el? :(
> 
> #include <io.h>
> int main( void )
> {
> unsigned int led, i, j, k;
> 
> outp(0xff,DDRD);
> outp(0x00,DDRC);
> PORTC=0xff;
> for (;;) {
> led=1;
> for(k=1;k<8;++k){
> outp(led, PORTD);
> if(PINC0==0) outp(~led, PORTD);
>         led=led*2;
>         for (i=0; i<255; i++)
>             for(j=0; j<25;j++)
>   asm ("nop");
>          };
> led=128;
> for(k=0;k<7;++k){
>         outp(led, PORTD);
> if(PINC0==0) outp(~led, PORTD);
>         led=led/2;
>         for (i=0; i<255; i++)
>             for(j=0; j<25;j++)
>   asm ("nop");
>          };
> 
>     }
> }
> 
> 
> ---------------------------------------
> Legyszi ezentul az elektro at tesla.hu
> cimre kuldd a leveleket
> 


More information about the Elektro mailing list