Tool/software: Code Composer Studio
Hey, i am new to F28335 board as well as CCS. I was going through some examples and had some doubts.
In the SCIA loopback enable example in CCS:
1. Why is the SCICTL2 register first set as 0x0003 in Line 3 which sets TXINTENA and RXBKINTENA and then immediately, both are set as 0. What is the significance of doing that? Instead SCICTL2 could have just been initialized as 0x0000 in a single line. Why cant that be done?
2. Or nothing needs to be initialized, since after reset, the default value itself of the register is itself 0x0000. So why should SCICTL1 register be initialized? Can that be done?
3. Similarly SCICCR register could also be set as 0x0017h, instead of separately setting 0x0007 in line 1 and enabling LOOPBKENA in line 8. Why should that be done separately?
4. What will happen if SCICTL2 register is initialized as 0x0023 in line 2 itself. Does initializing all the other registers, require software reset?
Line 1 : SciaRegs.SCICCR.all =0x0007;
Line 2 :SciaRegs.SCICTL1.all =0x0003;
Line 3 :SciaRegs.SCICTL2.all =0x0003;
Line 4 :SciaRegs.SCICTL2.bit.TXINTENA =0;
Line 5 :SciaRegs.SCICTL2.bit.RXBKINTENA =0;
Line 6 :SciaRegs.SCIHBAUD =0x0000;
Line 7 :SciaRegs.SCILBAUD =0x000F;
Line 8 :SciaRegs.SCICCR.bit.LOOPBKENA =1; // Enable loop back
Line 9 :SciaRegs.SCICTL1.all =0x0023; // Relinquish SCI from Reset