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

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.