Hi,
having problem with xMega A3. On PortA I use ADC, but port B I need for I/O. And result is, that bits 0-3 acts as they should and other bits I can not change. For instance DDRB is $ff and PortB is $00, result on pins will read as %00001111. I have two different boards, different SW but same result.
Next step I started with STK600, 64A1 processor and LEDs connected to PortB. Running following simple code:
results with LED0 to LED3 blinking and others not.
Bug or I forgot to read proper page in manual?
Best regards,
Andrej
P.S. Should read the manual - those ports are occupied by JTAG and should be disabled.
Txn Rolf for this, really important help.
having problem with xMega A3. On PortA I use ADC, but port B I need for I/O. And result is, that bits 0-3 acts as they should and other bits I can not change. For instance DDRB is $ff and PortB is $00, result on pins will read as %00001111. I have two different boards, different SW but same result.
Next step I started with STK600, 64A1 processor and LEDs connected to PortB. Running following simple code:
Code
program xMega_test;
{$NOSHADOW}
{ $WG} {global Warnings off}
Device = xmega64A1, VCC=3.3;
{ $BOOTRST $08000} {Reset Jump to $08000}
Import ;
Define
OSCtype = int32MHz, //CPU=32MHz
PLLmul=4,
prescB=1, //PeripherX4=32MHz
prescC=1; //PeripherX2=32MHz}
StackSize = $0064, iData;
FrameSize = $0064, iData;
Implementation
{$IDATA}
{--------------------------------------------------------------}
{ functions }
{--------------------------------------------------------------}
{ Main Program }
{$IDATA}
begin
DDRB := $ff;
EnableInts( $87);
loop
PortB := not PortB;
mdelay( 500);
endloop;
end xMega_test.
{$NOSHADOW}
{ $WG} {global Warnings off}
Device = xmega64A1, VCC=3.3;
{ $BOOTRST $08000} {Reset Jump to $08000}
Import ;
Define
OSCtype = int32MHz, //CPU=32MHz
PLLmul=4,
prescB=1, //PeripherX4=32MHz
prescC=1; //PeripherX2=32MHz}
StackSize = $0064, iData;
FrameSize = $0064, iData;
Implementation
{$IDATA}
{--------------------------------------------------------------}
{ functions }
{--------------------------------------------------------------}
{ Main Program }
{$IDATA}
begin
DDRB := $ff;
EnableInts( $87);
loop
PortB := not PortB;
mdelay( 500);
endloop;
end xMega_test.
results with LED0 to LED3 blinking and others not.
Bug or I forgot to read proper page in manual?
Best regards,
Andrej
P.S. Should read the manual - those ports are occupied by JTAG and should be disabled.
Txn Rolf for this, really important help.