XMEGA PortF and Uart/Pin Problem

General discussion on mikroPascal PRO for AVR.
Post Reply
Author
Message
corado
Posts: 401
Joined: 28 Mar 2009 11:03

XMEGA PortF and Uart/Pin Problem

#1 Post by corado » 26 Nov 2013 16:15

Hallo,
I set
PORTF_DIRset:= %11110011;

and then

PORTF_OUT:=%10000000; // Status LED1
delay_ms(200);
PORTF_OUT:=%00000000;
delay_ms(200);

This works..but I USE UART
UARTF0_Init(4800);

then I can't toggel the LEDs anymore?!?

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: XMEGA PortF and Uart/Pin Problem

#2 Post by marina.petrovic » 27 Nov 2013 11:41

Hi,

Please, can you tell me which microcontroller you use?

Did you test UART communication separately to make sure whether it's work properly?

Best regards,
Marina

corado
Posts: 401
Joined: 28 Mar 2009 11:03

Re: XMEGA PortF and Uart/Pin Problem

#3 Post by corado » 27 Nov 2013 11:56

Hallo, Xemag128U3.
Uart works fine, pin in and aout too..but i I use UartF0 then Portf seems disables for toggeling

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: XMEGA PortF and Uart/Pin Problem

#4 Post by marina.petrovic » 28 Nov 2013 13:53

Hi,

I can't see any problem in the part of the code that you posted.
Did you try to toggle some other port LEDs, just to be sure that problem is in PORTF LEDs?

If I am not wrong, ATxmega128A3 USARTF0 is connected with PF1 (XCK0), PF2 (RXD0) and PF3 (TXD0) pins.

Best regards,
Marina

corado
Posts: 401
Joined: 28 Mar 2009 11:03

Re: XMEGA PortF and Uart/Pin Problem

#5 Post by corado » 28 Nov 2013 14:44

yes, all other ports toggeling, if UART is on or not no problem only port f has the problem

corado
Posts: 401
Joined: 28 Mar 2009 11:03

Re: XMEGA PortF and Uart/Pin Problem

#6 Post by corado » 29 Nov 2013 20:22

I found it :-)
If I initialize Uart first and then the IN/Outputs then it works :-)

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: XMEGA PortF and Uart/Pin Problem

#7 Post by marina.petrovic » 02 Dec 2013 10:50

Hi,

I am glad that you manage to solve your problem.

Best regards,
Marina

Post Reply

Return to “mikroPascal PRO for AVR General”