Mega128 beépített óra kezelése

Hogyan programozzak AVR chipet? Programozók beállításai...
Bascom nyelvű programok...
Válasz küldése
Avatar
CsendesJ
Biztosítékgyilkos
Hozzászólások: 57
Csatlakozott: 2008. augusztus 31. vasárnap, 6:00

Mega128 beépített óra kezelése

Hozzászólás Szerző: CsendesJ »

Sziasztok,

Szeretném kihasználni a proci beépített óráját.
A következő rövid progival próbálkoztam:



$crystal = 16000000
$regfile = "M128def.dat"
$baud = 9600
$swstack = 128
$hwstack = 128
$framesize = 128

Led Alias Portb.1

Enable Interrupts

Config Date = Mdy , Separator = /
Config Clock = Soft , Gosub = Sectic
Date$ = "09/11/05"
Time$ = "18:56:56"

Do
Wait 1
Print Date$
Print Time$
Loop

Sectic:
Toggle Led
Return

End



Sajnos az idő nem változik, illetve a led sem villog.
Úgy tűnik nem megy a megszakítás....

Esetleg valakinek valamilyen ötlete van ezzel kapcsoltban?
Avatar
CsendesJ
Biztosítékgyilkos
Hozzászólások: 57
Csatlakozott: 2008. augusztus 31. vasárnap, 6:00

Hozzászólás Szerző: CsendesJ »

Az oszcillátor nem működött....
A quartz cseréje megoldotta a problémát.

Üdv,

CsJ
Avatar
Robert
Elektronbűvölő
Hozzászólások: 10213
Csatlakozott: 2005. december 9. péntek, 7:00

Hozzászólás Szerző: Robert »

Kompatibilis módból kikapocsoltad?
M103ként fut alapban....
Avatar
CsendesJ
Biztosítékgyilkos
Hozzászólások: 57
Csatlakozott: 2008. augusztus 31. vasárnap, 6:00

Hozzászólás Szerző: CsendesJ »

Huh, ez most pontosan mit is jelent?
Avatar
Robert
Elektronbűvölő
Hozzászólások: 10213
Csatlakozott: 2005. december 9. péntek, 7:00

Hozzászólás Szerző: Robert »

A biztosítékbiteknél kell átállítani. Alapban az M128-as chip M103 kompatibilis módban fut...
Avatar
CsendesJ
Biztosítékgyilkos
Hozzászólások: 57
Csatlakozott: 2008. augusztus 31. vasárnap, 6:00

Hozzászólás Szerző: CsendesJ »

Erre gondoltál? Nem. Nem állítottam be semmit.



The ATmega128 is a highly complex microcontroller where the number of I/O locations supersedes
the 64 I/O locations reserved in the AVR instruction set. To ensure backward compatibility
with the ATmega103, all I/O locations present in ATmega103 have the same location in
ATmega128. Most additional I/O locations are added in an Extended I/O space starting from $60
to $FF, (i.e., in the ATmega103 internal RAM space). These locations can be reached by using
LD/LDS/LDD and ST/STS/STD instructions only, not by using IN and OUT instructions. The relocation
of the internal RAM space may still be a problem for ATmega103 users. Also, the
increased number of interrupt vectors might be a problem if the code uses absolute addresses.
To solve these problems, an ATmega103 compatibility mode can be selected by programming
the fuse M103C. In this mode, none of the functions in the Extended I/O space are in use, so the
internal RAM is located as in ATmega103. Also, the Extended Interrupt vectors are removed.
The ATmega128 is 100% pin compatible with ATmega103, and can replace the ATmega103 on
current Printed Circuit Boards. The application note “Replacing ATmega103 by ATmega128”
describes what the user should be aware of replacing the ATmega103 by an ATmega128.
5
2467S–AVR–07/09
ATmega128
ATmega103
Compatibility Mode
By programming the M103C fuse, the ATmega128 will be compatible with the ATmega103
regards to RAM, I/O pins and interrupt vectors as described above. However, some new features
in ATmega128 are not available in this compatibility mode, these features are listed below:
• One USART instead of two, Asynchronous mode only. Only the eight least significant bits of
the Baud Rate Register is available.
• One 16 bits Timer/Counter with two compare registers instead of two 16-bit Timer/Counters
with three compare registers.
• Two-wire serial interface is not supported.
• Port C is output only.
• Port G serves alternate functions only (not a general I/O port).
• Port F serves as digital input only in addition to analog input to the ADC.
• Boot Loader capabilities is not supported.
• It is not possible to adjust the frequency of the internal calibrated RC Oscillator.
• The External Memory Interface can not release any Address pins for general I/O, neither
configure different wait-states to different External Memory Address sections.
In addition, there are some other minor differences to make it more compatible to ATmega103:
• Only EXTRF and PORF exists in MCUCSR.
• Timed sequence not required for Watchdog Time-out change.
• External Interrupt pins 3 - 0 serve as level interrupt only.
• USART has no FIFO buffer, so data overrun comes earlier.
Unused I/O bits in ATmega103 should be written to 0 to ensure same operation in ATmega128.
Avatar
Robert
Elektronbűvölő
Hozzászólások: 10213
Csatlakozott: 2005. december 9. péntek, 7:00

Hozzászólás Szerző: Robert »

Igen, ilyesmi... De ez a Mega panelen már át van állítva...
Avatar
gomba2
Újonc
Újonc
Hozzászólások: 4
Csatlakozott: 2012. december 19. szerda, 7:00

8 MHz-es belső oszcillátor használata

Hozzászólás Szerző: gomba2 »

//created by error
Válasz küldése