Skip to main content
added 102 characters in body
Source Link
KIIV
  • 4.9k
  • 1
  • 14
  • 23

Your code doesn't clear anything.

    PORTB |= ~(1<<PORTB1); // set everything except PORTB1 pin
    _delay_ms(100);
    PORTB |= (1<<PORTB1);  // set PORTB1 pin
    PORTB |= ~(1<<PORTB1); // set everything except PORTB1 pin
    _delay_ms(100);
    PORTB |= (1<<PORTB1);  // set PORTB1 pin

And recommended tutorial: Bit manipulation (AKA "Programming 101") from the AVRFreaks.net

BTW: next issue might be "the pulse is way too fast so it seems there is none"

Try this:

while(1) {
    PINB = _BV(PINB1); // toggle pin
    _delay_ms(50);
}

Your code doesn't clear anything.

    PORTB |= ~(1<<PORTB1); // set everything except PORTB1 pin
    _delay_ms(100);
    PORTB |= (1<<PORTB1);  // set PORTB1 pin

And recommended tutorial: Bit manipulation (AKA "Programming 101") from the AVRFreaks.net

BTW: next issue might be "the pulse is way too fast so it seems there is none"

Your code doesn't clear anything.

    PORTB |= ~(1<<PORTB1); // set everything except PORTB1 pin
    _delay_ms(100);
    PORTB |= (1<<PORTB1);  // set PORTB1 pin

And recommended tutorial: Bit manipulation (AKA "Programming 101") from the AVRFreaks.net

BTW: next issue might be "the pulse is way too fast so it seems there is none"

Try this:

while(1) {
    PINB = _BV(PINB1); // toggle pin
    _delay_ms(50);
}
added 189 characters in body
Source Link
KIIV
  • 4.9k
  • 1
  • 14
  • 23

Your code doesn't clear anything.

    PORTB |= ~(1<<PORTB1); // set everything except PORTB1 pin
    _delay_ms(100);
    PORTB |= (1<<PORTB1);  // set PORTB1 pin

And recommended tutorial: Bit manipulation (AKA "Programming 101") from the AVRFreaks.net

BTW: next issue might be "the pulse is way too fast so it seems there is none"

Your code doesn't clear anything.

    PORTB |= ~(1<<PORTB1); // set everything except PORTB1 pin
    _delay_ms(100);
    PORTB |= (1<<PORTB1);  // set PORTB1 pin

Your code doesn't clear anything.

    PORTB |= ~(1<<PORTB1); // set everything except PORTB1 pin
    _delay_ms(100);
    PORTB |= (1<<PORTB1);  // set PORTB1 pin

And recommended tutorial: Bit manipulation (AKA "Programming 101") from the AVRFreaks.net

BTW: next issue might be "the pulse is way too fast so it seems there is none"

Source Link
KIIV
  • 4.9k
  • 1
  • 14
  • 23

Your code doesn't clear anything.

    PORTB |= ~(1<<PORTB1); // set everything except PORTB1 pin
    _delay_ms(100);
    PORTB |= (1<<PORTB1);  // set PORTB1 pin