Czy ktoś z Was wie w jaki sposób wyjaśnić fakt że procesor ATmega64 się restartuje w momencie zwarcia do masy pinu PG.4? W tym momencie procesor zachowuje się jakby zadziałał watchdog który nie jest przyczyną problemu, bo został wyłączony. Do tego pinu podłączony jest przycisk z kondensatorem 220n (GND), oraz rezystor 10k do VCC. Dodam że na jednym procesorze układ działa poprawnie (reaguje na naciśnięcie przycisku zgodnie z kodem programu bez restartowania), a w drugim procesorze z innej serii następuje restart. Na dodatek dodam że program reaguje prawidłowo na ten pin ale tylko w momencie startu zasilania, a potem po drugim naciśnięciu procesor się restartuje. Procesor jest taktowany z wewnętrznego oscylatora RC i nie jest podłączony żaden rezonator RTC.
W karcie katalogowej ten pin jest opisany że ma podwójne znaczenie kiedy korzysta się z trybu ATmega103 compatibility mode, ale ja z niego nie korzystam (przestawiony fusebit Extended P:1 Atmega64 mode).
Poniżej wklejam opis tego pinu z karty katalogowej:
Alternate Functions of Port G
In ATmega103 compatibility mode, only the alternate functions are the defaults for Port G, and Port G cannot be
used as General Digital Port Pins. The alternate pin configuration is as follows:
PG4 TOSC1 (RTC Oscillator Timer/Counter0)
TOSC1 – Port G, Bit 4
TOSC2, Timer Oscillator pin 1: When the AS0 bit in ASSR is set (one) to enable asynchronous clocking of
Timer/Counter0, pin PG4 is disconnected from the port, and becomes the inverting output of the 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.
Na dodatek PG.3 który również jest opisany podobnie, w programie jest ustawiony jako wyjście sterujące buzzerem i to wyście działa prawidłowo.
W karcie katalogowej ten pin jest opisany że ma podwójne znaczenie kiedy korzysta się z trybu ATmega103 compatibility mode, ale ja z niego nie korzystam (przestawiony fusebit Extended P:1 Atmega64 mode).
Poniżej wklejam opis tego pinu z karty katalogowej:
Alternate Functions of Port G
In ATmega103 compatibility mode, only the alternate functions are the defaults for Port G, and Port G cannot be
used as General Digital Port Pins. The alternate pin configuration is as follows:
PG4 TOSC1 (RTC Oscillator Timer/Counter0)
TOSC1 – Port G, Bit 4
TOSC2, Timer Oscillator pin 1: When the AS0 bit in ASSR is set (one) to enable asynchronous clocking of
Timer/Counter0, pin PG4 is disconnected from the port, and becomes the inverting output of the 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.
Na dodatek PG.3 który również jest opisany podobnie, w programie jest ustawiony jako wyjście sterujące buzzerem i to wyście działa prawidłowo.