My hardware is: SAMD20J18, on a SAMD20XPLAINED board.
My software is: Atmel Toolchain (arm-gcc)
I am trying to set up SERCOM3 as an UART.
I have the following code:
Code: Select all
//Elsewhere #define PX24 (1 << 24) //Set up TX pin to be output PORT->Group.DIRSET.reg = PX24; PORT->Group.OUTSET.reg = PX24; //Set up mux to enable UART PORT->Group.PINCFG.bit.PMUXEN = 1; PORT->Group.PMUX.bit.PMUXE = 0x02; //Enable UART Clock PM->APBCMASK.bit.SERCOM3 = 1;
If I do something like:
PM->APBCMASK.reg |= (1 << 5);
it compiles fine. Shouldn't the two statements do the same thing? What is wrong with the earlier statement?
Edit: Apparently I am not the only person having this issue. Looking at the code in this post:
discussions/viewtopic.php/f,31/t,22481.html, it looks like he has both lines as well (with the *.bit.SERCOMx = 1 line commented out).