xMega A3,A2, and A1 with PortB

Problem with PortB as output

Jest
 
Avatar
 
Subject:

xMega A3,A2, and A1 with PortB

 · 
Posted: 20.06.2010 - 11:25  ·  #1
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:

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.


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.
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 14 · Cache Hits: 13   36   49 · Page-Gen-Time: 0.032452s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI