Hello,
I am currently trying to implement an TWI client. I am using an XMega32A4AU.
To show the error I have written a small blink programme.
When I include the interrupt routine in the code I get an error. (Error: parameter error)
I am not sure whether an interrupt routine cannot be implemented in this way or whether the error is due to something else.
I would be very grateful for any suggestions. Thank you!
(Compiler version 6.00.05)
Best regards,
Torsten
program ClientI2C;
{$WG} {global Warnings on}
Device = xmega32A4, VCC=3.3;
{ $BOOTRST $04000} {Reset Jump to $04000}
Define_Fuses
// Override_Fuses;
NoteBook = A;
Supply = 3.3, 100;
LockBits0 = [];
FuseBits0 = [];
FuseBits1 = [];
FuseBits2 = [];
FuseBits3 = [];
FuseBits4 = [];
FuseBits5 = [];
FuseBits6 = [];
FuseBits7 = [];
Import SysTick;
From System Import ;
Define
OSCTYPE = INT32MHZ, PRESCA = 1, PRESCB = 1, PRESCC = 1;
SysTick = 10; {msec}
StackSize = $0100, iData;
FrameSize = $0100, iData;
Implementation
{$IDATA}
{--------------------------------------------------------------}
{ Type Declarations }
type
{--------------------------------------------------------------}
{ Const Declarations }
{--------------------------------------------------------------}
{ Var Declarations }
{$IDATA}
var LED1[@PortB,1]:bit;
var LED2[@PortB,2]:bit;
{--------------------------------------------------------------}
{ functions }
Interrupt TWIE_INTSLAVE;
begin
asm:NOP;
end;
procedure InitPorts;
begin
DDRB:= %00000110;
// led 1&2 off
LED1 := true;
LED2 := true;
end InitPorts;
{--------------------------------------------------------------}
{ Main Program }
{$IDATA}
begin
InitPorts;
EnableInts($87);
loop
mdelay(800);
toggle(LED1);
endloop;
end ClientI2C.
I am currently trying to implement an TWI client. I am using an XMega32A4AU.
To show the error I have written a small blink programme.
When I include the interrupt routine in the code I get an error. (Error: parameter error)
I am not sure whether an interrupt routine cannot be implemented in this way or whether the error is due to something else.
I would be very grateful for any suggestions. Thank you!
(Compiler version 6.00.05)
Best regards,
Torsten
Code
program ClientI2C;
{$WG} {global Warnings on}
Device = xmega32A4, VCC=3.3;
{ $BOOTRST $04000} {Reset Jump to $04000}
Define_Fuses
// Override_Fuses;
NoteBook = A;
Supply = 3.3, 100;
LockBits0 = [];
FuseBits0 = [];
FuseBits1 = [];
FuseBits2 = [];
FuseBits3 = [];
FuseBits4 = [];
FuseBits5 = [];
FuseBits6 = [];
FuseBits7 = [];
Import SysTick;
From System Import ;
Define
OSCTYPE = INT32MHZ, PRESCA = 1, PRESCB = 1, PRESCC = 1;
SysTick = 10; {msec}
StackSize = $0100, iData;
FrameSize = $0100, iData;
Implementation
{$IDATA}
{--------------------------------------------------------------}
{ Type Declarations }
type
{--------------------------------------------------------------}
{ Const Declarations }
{--------------------------------------------------------------}
{ Var Declarations }
{$IDATA}
var LED1[@PortB,1]:bit;
var LED2[@PortB,2]:bit;
{--------------------------------------------------------------}
{ functions }
Interrupt TWIE_INTSLAVE;
begin
asm:NOP;
end;
procedure InitPorts;
begin
DDRB:= %00000110;
// led 1&2 off
LED1 := true;
LED2 := true;
end InitPorts;
{--------------------------------------------------------------}
{ Main Program }
{$IDATA}
begin
InitPorts;
EnableInts($87);
loop
mdelay(800);
toggle(LED1);
endloop;
end ClientI2C.