Hallo,
im Simulator kann man es nachvollziehen.
Hier ein Demo:
program ATtiny841_Test_1;
{$NOSHADOW}
{ $WG} {global Warnings off}
// Device = Tiny44A, VCC=3.3;
Device = Tiny841, VCC=3.3;
Define_Fuses
Override_Fuses;
COMport = USB;
LockBits0 = [LockBit1]; // Leseschutz ein.
FuseBits0 = [CKSEL0, CKSEL2, CKSEL3, SUT0]; // Oszillator=intern 8MHz.
FuseBits1 = [BODLEVEL1]; // Reset bei 2,5-2,9V.
FuseBits2 = [];
ProgMode = SPI;
ProgFuses = true;
ProgLock = true;
ProgFlash = true;
ProgEEprom = true;
Import SysTick;
Define
ProcClock = 4000000; {Hertz}
SysTick = 1; {msec}
StackSize = $0010, iData;
FrameSize = $0010, iData;
//--------------------------------------------------------------;
implementation
//--------------------------------------------------------------;
{$IDATA}
var
Timer_1 : SysTimer;
//--------------------------------------------------------------;
procedure pTimer_1;
begin
If IsSysTimerZero(Timer_1) Then
SetSysTimer(Timer_1, 100);
EndIf;
end pTimer_1;
//--------------------------------------------------------------;
{ Main Program }
{$IDATA}
begin
mDelay(100); // 100 msec warten.
CLKPR:= %1000 0000; // Clock Prescaler Change Enable.
CLKPR:= %0000 0001; // Clock Prescale = 4MHz.
EnableInts;
loop
pTimer_1;
endloop;
end ATtiny841_Test_1.
Weiß jemand sonst noch etwas was nicht geht?
Habe vom ATtiny44A auf den ATtiny841 gewechselt.
Gruß
Mathias
im Simulator kann man es nachvollziehen.
Hier ein Demo:
Code
program ATtiny841_Test_1;
{$NOSHADOW}
{ $WG} {global Warnings off}
// Device = Tiny44A, VCC=3.3;
Device = Tiny841, VCC=3.3;
Define_Fuses
Override_Fuses;
COMport = USB;
LockBits0 = [LockBit1]; // Leseschutz ein.
FuseBits0 = [CKSEL0, CKSEL2, CKSEL3, SUT0]; // Oszillator=intern 8MHz.
FuseBits1 = [BODLEVEL1]; // Reset bei 2,5-2,9V.
FuseBits2 = [];
ProgMode = SPI;
ProgFuses = true;
ProgLock = true;
ProgFlash = true;
ProgEEprom = true;
Import SysTick;
Define
ProcClock = 4000000; {Hertz}
SysTick = 1; {msec}
StackSize = $0010, iData;
FrameSize = $0010, iData;
//--------------------------------------------------------------;
implementation
//--------------------------------------------------------------;
{$IDATA}
var
Timer_1 : SysTimer;
//--------------------------------------------------------------;
procedure pTimer_1;
begin
If IsSysTimerZero(Timer_1) Then
SetSysTimer(Timer_1, 100);
EndIf;
end pTimer_1;
//--------------------------------------------------------------;
{ Main Program }
{$IDATA}
begin
mDelay(100); // 100 msec warten.
CLKPR:= %1000 0000; // Clock Prescaler Change Enable.
CLKPR:= %0000 0001; // Clock Prescale = 4MHz.
EnableInts;
loop
pTimer_1;
endloop;
end ATtiny841_Test_1.
Weiß jemand sonst noch etwas was nicht geht?
Habe vom ATtiny44A auf den ATtiny841 gewechselt.
Gruß
Mathias