Ich habe hier ein ATMega48 und möchte die Pins PC6 und PC7 als I/Os
nutzen. Im Datenblatt steht (Int. RC Osc. fuse ist gesetzt):
TOSC1: Timer Oscillator pin 1. Used only if internal calibrated RC
Oscillator is selected as chip clock source, and the asynchronous timer
is enabled by the correct setting in ASSR. When the AS2 bit in ASSR is
set (one) to enable asynchronous clocking of Timer/Counter2, pin PB6 is
disconnected
from the port, and becomes the input of the inverting Oscillator
amplifier. In this mode, a crystal Oscillator is connected to this pin,
and the pin can not be used as an I/O pin.
Also dachte ich wenn ich ASSR &= ~ AS2; setzte habe ich das Bit gelöscht
(0) und somit kann ich den Pin nutzen... Dem ist aber nicht so... Der
Pin ist immer High.
der Code:
1 | int main(void)
|
2 | {
|
3 |
|
4 |
|
5 | ASSR &= ~ AS2;
|
6 |
|
7 | /* Setzt das Richtungsregister des Ports auf 0xff
|
8 | (alle Pins als Ausgang): */
|
9 | DDRB = 0xff;
|
10 | PORTB = 0;
|
11 | ....
|
Pin 7 brauche ich nicht unbedingt, aber auch der ist immer auf High...
ich hoffe es kann mir jemand sagen was ich machen muss...
Danke.
mfg Andreas