atmega16 pins trouble

Discussion in 'Homework Help' started by jose_007, Jul 7, 2012.

  1. jose_007

    Thread Starter New Member

    May 3, 2011
    24
    0
    A few pins of atmega16 (D0,D1,D2) are always high when uC is powered.Does it mean those pins are damaged ??
    Or is there a way to reset those pins to low ?

    ** I have tried programming the output of those pins

    Thanks
    jose
     
  2. jose_007

    Thread Starter New Member

    May 3, 2011
    24
    0
    Request to moderator
    Can you please move this thread to General electronics section ?
     
  3. MrChips

    Moderator

    Oct 2, 2009
    12,432
    3,360
    Simple way to tell, try another chip.

    Or try connecting 4k7Ω (or anything from 1k to 10kΩ) from the pin to GND and see if the voltage is still high.
     
  4. Jony130

    AAC Fanatic!

    Feb 17, 2009
    3,957
    1,097
    Which pins you have in mind?
    D0 = PB0 ?? or what ?
     
  5. jose_007

    Thread Starter New Member

    May 3, 2011
    24
    0
    @Jony130
    PD0,PD1,PD2
     
  6. Jony130

    AAC Fanatic!

    Feb 17, 2009
    3,957
    1,097
    Have you set DDRD to 1 and set PORD = 0
    Or maybe by accident you enable USART?
     
    Last edited: Jul 8, 2012
  7. jose_007

    Thread Starter New Member

    May 3, 2011
    24
    0
    i set port D to 0

    No , I didnt enable USART

    Also, pins C5,C6 show the same problem ...
     
  8. Jony130

    AAC Fanatic!

    Feb 17, 2009
    3,957
    1,097
    Show as your program code.
     
  9. jose_007

    Thread Starter New Member

    May 3, 2011
    24
    0
    void main(void)
    {
    DDRD=0x00;
    DDRA=0xFF;
    DDRB=0x00;
    DDRC=0x00;
    PINB=0x00;
    PINC=0x00;
    PIND=0x00;
    PORTA=0x00;
    <.......code.......>
    }


    I am using D as i/p port and A as o/p port...but as precaution I set B and C to 0 as well.....
    Kindly point the error
     
  10. bretm

    Member

    Feb 6, 2012
    152
    24
    Does the chip have a bootloader installed? If so, it might enable UART before main() starts. Explicitly disable subsystems you don't need. This also helps battery life if applicable. Also see the PRR register which is often overlooked.
     
  11. jose_007

    Thread Starter New Member

    May 3, 2011
    24
    0
    I just burned the hex file...so I think bootloader is already installed

    Can you elaborate please...

    And kindly explain cause of pins C5 and C6
     
Loading...