CONFIG CLOCK = soft

Sezione dedicata al sistema di sviluppo BASCOM-AVR per i micro AVR
At90s, Attiny, Atmega e Xmega

CONFIG CLOCK = soft

Postby agennore » 27 May 2022, 18:49

Salve a tutti,
stò cercando di realizzare un orologio con un Atmega8, seguendo le istruzioni dell'help ho collegato un quarzo da 32768 KHz, copiato le istruzioni e voilà, non funziona.
Ho cercato in rete ma niente da fare, l'unico esempio che ho trovato si riferisce ad un Atmega32 in cui hanno collegato il quarzo sui pin TOSC1 e TOSC2, questi pin nell'Atmega8 sono quelli del quarzo per il clock di sistema.
Dove sbaglio ?


*********************************************************************************************
$regfile = "m8def.dat"
$hwstack = 40
$swstack = 16
$framesize = 32

Config Pinb.0 = Input
Config Pinc.0 = Output
Config Pinc.1 = Input
Config Pinc.2 = Input

Config Pind.1 = Output ' openLog
Config Pind.2 = Input ' puls ESC
Config Pind.3 = Input ' puls UP
Config Pind.4 = Input ' puls DN
Config Pind.5 = Input ' puls ENT
Config Pind.6 = Output ' rele
Config Pind.7 = Output

'pull up resistors
Set Portd.2 ' puls ESC
Set Portd.3 ' puls UP
Set Portd.4 ' puls DN
Set Portd.5 ' puls ENT

Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.3 , Db6 = Portb.2 , Db7 = Portb.1 , E = Portc.3 , Rs = Portb.5
Config Lcd = 20 * 4 'configure lcd screen
Cursor Off Noblink
Cls


'[now init the clock]
Config Date = Mdy , Separator = / ' ANSI-Format

Config Clock = Soft 'this is how simple it is
'The above statement will bind in an ISR so you can not use the TIMER anymore!

'assign the date to the reserved date$
'The format is MM/DD/YY
Date$ = "11/11/05"

'assign the time, format in hh:mm:ss military format(24 hours)
'You may not use 1:2:3 !! adding support for this would mean overhead
'But of course you can alter the library routines used

Time$ = "23:59:50"

Enable Interrupts

'***************************** INIZIO PROGRAMMA ******************************



Do
Waitms 500
Locate 2 , 1 : Lcd Date$ ; Spc(3) ; Time$

Loop

End
agennore
 
Posts: 4
Joined: 22 Feb 2018, 21:53

Return to BASCOM-AVR

Who is online

Users browsing this forum: No registered users and 2 guests

cron