Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

ATXMEGA - USART flags ?

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR
View previous topic :: View next topic  
Author Message
kulisek

Bascom Member



Joined: 04 Jul 2006
Posts: 51

blank.gif
PostPosted: Wed Nov 23, 2011 1:30 pm    Post subject: ATXMEGA - USART flags ? Reply with quote

Hi,

How can I read Frame error "FERR" flag in ASM for Atxmega ?

For Atmega works this

SBRC Uart_status,fe0

but for Atxmega this does not work

SBRC Uart_status,USARTC0_STATUS.4

Thanks
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5093
Location: Holland

blank.gif
PostPosted: Wed Nov 23, 2011 1:55 pm    Post subject: Reply with quote

it is better to code it in basic. after all this is the bascom-avr forum.

The problem with asm is that it is different depending on the chip. the compiler handles this automatic.
if you use asm, you can not port your code simple to a different chip.
normally, adjusting the $regfile is sufficient.
but if you include asm, you can not port.

you can use bitwait to wait for a bit state.
of course there are cases where every tick counts, and while asm is not really supported (that you can use it does not mean it is supported) i do not want to stop anyone from coding in asm.

SBRC requires a register and a bit.
thus the Uart_status must have been a register (.def). And the fe0 was a constant from the dat file.

you need a register to load the register content; LDS will do best. :
LDS R23, USARTC0_STATUS
sbrc r23,4 ; skip if bit 4 is cleared in register r23

_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum