EmbeddedRelated.com
Forums
Jacob Beningo
Live online course · Jacob Beningo
AI for Embedded Developers
$100 off for EmbeddedRelated readers until Dec 6 · 5 live sessions, Dec 7-11
Discount ends in
21days 00hrs 27min 52sec
Learn More →

GPIO on ATmega168 on pins PB6 (TOSC1) and PB7 (TOSC2)

Started by P.Marek ●January 2, 2006
Hello everybody!


I have a problem with ATmega168 (will later be an mega88) and PB6/PB7.
I'm trying to use these as output pins, ie. drive low-current LEDs by
connecting PB6/PB7 via resistor and LED to +5V.

That worked very good when I used PD5; but I need the PWM now and
wanted to use PB6/PB7.

I'm using the internal RC oscillator; timer 2 is currently unused, and
if I need it later I'll only use it with clkIO and not asynchrone.

Maybe I'm reading the datasheet wrong - but I believe these two pins
are GPIO in my circumstances.


Thank you for your hints!


Regards,

Phil

Remark:

When I said that it doesn't work, I meant that pulling them low gives
the pin 3.8V - not the expected 0V (GND).

On 2 Jan 2006 07:31:10 -0800, "P.Marek" <philipp.gg@marek.priv.at> wrote:


>When I said that it doesn't work, I meant that pulling them low gives >the pin 3.8V - not the expected 0V (GND).
Sounds like they are not correctly configured as outputs? (DDRB) Geo