Setting PB6 and PB7 to Output High

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, hope someone can save me some time here once again.

I am running an Atmega88 using internal 8MHz no divide by 8. I want to utilize PORTB , Pin 7 to turn high or low to enable/disable another IC.

Datasheet says that this is the external oscillator pin but can still be used as an IO pin if it is not configured to run an oscillator. I set DDRB to all 1s and then I set Port B to all 1s, every pin turns on except from pins 6 and 7.

What am I forgetting to do? Do I have to explicitly tell the thing that it is NOT running a crystal? How do I do this? I must have missed it in the datasheet but idk...

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Datasheet says that this is the external oscillator pin but can still be used as an IO pin if it is not configured to run an oscillator. I set DDRB to all 1s and then I set Port B to all 1s, every pin turns on except from pins 6 and 7.

How are you testing this? If you answer "STK500" then search the forum for "pb6 pb7 mega8".

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I do answer STK500.... appreciated

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And PB6 and PB7 are not attached to the respective header pins but the XTAL1 and XTAL2,

What a good guy you are, thank you.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think everyone who's ever used that 28 pin socket on the STK500 has been bitten by the fact that PB6/7 come out on PORTE X1/X2 !

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I thought I was doing good for a while =) haven't had to ask much of you all lately, silly AVR board designers lol

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

silly AVR board designers

Not really. There have been some minor updates (basically due to obsolete components) but the design has remained the same since...the last millennium. At that time, there was no PB6/PB7 on the 28-pin chips. (well, I think of it as "chip"--AT90S4433--but there was an obscure AT90S2433 as well)

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, I love it!