Hallo, ich versuche gerade eine Uhr in Bascom mit dem Mega8 zu programmieren. Folgendes habe ich selbst schon versucht und auch über die Suche im Forum gefunden. Leider war der Treat an dieser Stelle zu Ende ... $regfile = "m8def.dat" $crystal = 4000000 $hwstack = 32 $swstack = 10 $framesize = 40 Enable Interrupts Config Clock = Soft Config Lcdpin = Pin , Db4 = Portd.4 , Db5 = Portd.5 , Db6 = Portd.6 , Db7 = Portd.7 , Rs = Portd.2 , E = Portd.3 Config Lcd = 16 * 1a Date$ = "18.07.06" Time$ = "10:20:00" Do Cls Lcd Time$ Waitms 500 Loop End Eigentlich sollte die Uhr doch so laufen. (Abgesehen davon das Sie nicht die korrekte Zeit zählt weil nicht der richtige Quarz drin ist) Warum funktioniert es nicht? Gruß Dani
Aus der Hilfe von Bascom: The compiler also creates an ISR that gets updates once a second. This works only for the 8535, M163 and M103 and M603, or other AVR chips that have a timer that can work in asynchrony mode. For the 90S8535, timer2 is used. It can not be used my the user anymore! This is also true for the other chips async timer. Notice that you need to connect a 32768 Hz crystal in order to use the timer in async mode, the mode that is used for the clock timer. Du mußt draußen einen 32,768Khz-Quarz dransetzen. MfG Paul
Woher weis der µC das ein 8MHz Quarz anstelle des 32,768Khz ageschlossen ist? Wir der interne Takt dafür weiter verwendet? Ist der eigentliche Takt mit dem das Programm abgearbeitet wird dann auch nur 32,768KHz? Gruß Dani
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.