onde
Junior Member level 1
keil c-Problem
hello!
I have a problem with the following program:
// Timerinterrupt
#include <reg517a.h>
void INTTIM0 (void) interrupt 1
{ if (P4 < 0x7f) P4 <<= 1;
if (P4 > 0x02) P4 >>= 1;
TH0=-39; // 10ms
TL0=0;
}
main()
{
P4 = 0x01;
TMOD = 0x01; // Timer 0 Mode 1 16 Bit
TH0 = -39; // every 10ms Int.
TL0 = 0;
ET0 = 1; // Timer 0 Interrupt disabled
EAL = 1; // enable all
TR0 = 1; //
while(1)
{
}
}
The Problem is, P4 is shifted only 1 time (from 0x01 to 0x10), after this nothing is happing.
Any Idea ???
hello!
I have a problem with the following program:
// Timerinterrupt
#include <reg517a.h>
void INTTIM0 (void) interrupt 1
{ if (P4 < 0x7f) P4 <<= 1;
if (P4 > 0x02) P4 >>= 1;
TH0=-39; // 10ms
TL0=0;
}
main()
{
P4 = 0x01;
TMOD = 0x01; // Timer 0 Mode 1 16 Bit
TH0 = -39; // every 10ms Int.
TL0 = 0;
ET0 = 1; // Timer 0 Interrupt disabled
EAL = 1; // enable all
TR0 = 1; //
while(1)
{
}
}
The Problem is, P4 is shifted only 1 time (from 0x01 to 0x10), after this nothing is happing.
Any Idea ???