EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / thanks for the replywhat

thanks for the replywhat

|

Microcontroller › AVR › AVR PORT pins › thanks for the replywhat

November 17, 2011 at 11:40 am #6848
Ashutosh Bhatt
Participant

thanks for the reply

what happens in proteus simulator that i tell u

 

if the following code is written to blink the LED then it blinks fine

 

PORTD = (1<<PD0);

_delay_ms(1000);

PORTD = (0<<PD0); 

 

but if the code is

 

PORTD|= (1<<PD0);

_delay_ms(1000);

PORTD| = (0<<PD0);

 

then it stays on. no blinking

 

but again if the code is changed to

 

PORTD|= (1<<PD0);

_delay_ms(1000);

PORTD& = ~(1<<PD0);

 

led starts blinking

so my questions is why and how?

 

 

RSS Recent Posts

  • CR2/CR123A Batteries In Projects February 9, 2026
  • Variable audio oscillator February 8, 2026
  • Do i need a buffer? February 8, 2026
  • ANOTHER OLD PROJECT REDO February 7, 2026
  • wall transformer polarity February 7, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise