1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

AVR simulator problem

Discussion in 'Oshonsoft' started by magnatro, Mar 18, 2011.

  1. magnatro

    magnatro New Member

    Joined:
    Mar 23, 2010
    Messages:
    295
    Likes:
    0
    Location:
    India
    i programmed the simulator for reading an input port of atmega 8 and then tensmit it over a distance by using 648 L encoder.. but i cant read the value, tried DDRx , Config, but of no use. if you have, can you post a basic code (or asm) that assigns a port as input. or suggest another compiler? (basic) ?
    regards
    Magnatro
     
  2. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    In order to set a port as input DDRx has to be set to 0, PORTx has to be set to 0, and you read the PINx register. If any bit on PORTx is set to 1 while the corresponding DDRx bit is 0 the internal pullup on that I/O line will be enabled.
     
    Last edited: Mar 18, 2011
    • Like Like x 1

Share This Page