Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: Question about how to tell if my chip is broken

2007-05-06 by kernels_nz

PORTB = PORTD; //match the ports

PORTD in this case would hold the values of the bits for which the
pullup resistors have been turned on. This will probably just set all
the bits of PORTB always off without caring about whats on PIND.

Cheers
Hein B
Auckland,
New Zealand




--- In AVR-Chat@yahoogroups.com, "kernels_nz" <kernels@...> wrote:
>
> In C it should be PIND aswell. 
> 
> Cheers
> Hein B
> Auckland, New Zealand
> 
> --- In AVR-Chat@yahoogroups.com, "David Greenberg" <dsg123456789@>
> wrote:
> >
> > I am just getting back into using AVRs with linux, and here's my
> > situation.  I'm using avr-gcc, an STK500v2, and an AT90S2313 (I know,
> > it's old, but I already have a couple) to try some test programs.
> > This is the program that builds ok, programs and verifies okay, and
> > then doesn't work.  It should let my control lights with the
> > pushbuttons, but i'm clearly doing something wrong.  Thanks for your
> > advice!
> > 
> > #include <avr/io.h>
> > 
> > int main(void)
> > {
> >         DDRB = 0xFF;    /* We put port B pins in output mode */
> >         PORTB = 0xFF;   /* put all lights in off state */
> > 
> >         PORTB = 0x00;
> > 
> >         DDRD = 0x00;    /* We put port D pins in input mode */
> > 
> >         for(;;){
> >                 PORTB = PORTD; //match the ports
> >         }
> > 
> >         PORTB = 0xAA;
> >         return(0);
> > }
> >
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.