Gast
#254535
Hallo!
Ich möchte den Zählerstands des Timers ausgeben. Ist der Quellcode
soweit richtig?
#include <stdio.h>
#include <LCDIO.h>
#include <REG8252.h>
int stand=0; //globale Variabeln
//Programmfunktionen:
//Zeigt einmal den Zählerstand in HEX an
void test(void) interrupt TF0_VECTOR //Interrupt
{
stand=(TH0*256)+TL0; //High und Low miteinander verknüpfen
}
//interrupt ENDE
//Main
void main(void)
{
TMOD=0x10; //Timer Modus festlegen
ET0=1; //Timer 0 Interrupt Enable: 1=Enabled
TR0=1; //Timer 0 Run Control Bit
EA=1; // Global Interrupt Enable, 0=Disable all interrupts
do
{
clrsc(); //Display leeren
printf(%x,stand); //Ausgabe des Zählerstands
}
while(1);
}
//Main ENDE