Question on notation

This code is from the MSP430F2013 USI example #2.

;------------------------------------------------------------------------------

mov.b &P1IN,&USISRL ; init-load TX data

ResetUART bis.b #004h,&P1DIR ; Reset Slave

bic.b #004h,&P1DIR ;

In the first line above he moves the state of the P1 input bits to the serial output register. Then he pulses P1.2 to start the transfer in the selected device. But the notation reads that he is setting the direction bit in the P1 register. Is this something clever or should the lines read:

bis.b #004h,&P1OUT

bic.b #004h,&P1OUT

Crane

I think it is neither a typo nor something clever, it is just a little obscure.

P1.2 of the master is connected to the nRST pin of the slave. There is also a pull-up resistor as indicated by ‘/|\ ‘ between the slave and the master.

At power-up, P1.2 of the master is in input mode (bit2 of P1DIR is 0) and the pull-up resister allows the slave to get out of Reset state.

Subsequently, the code in the master clears bit2 of P1OUT to 0 and lets bit2 of P1DIR stays 0. Thus P1.2 stays high due to the presence of pull-up resistor.

Now, when the master change bit2 of P1DIR to a 1. P1.2 is driven low because bit2 of P2OUT is 0. This causes the slave to go to Reset state.

Next, the master changes bit2 of P1DIR back to 0. P1.2 returns to be an input and the pull-up resistor releases the slave from Reset state.

===

Looks like you and I are the only ones using assembler!

Old Cow,

Thanks for the clarification.

I think I will just pulse the pin. I’m interfacing with the 3100 UART.

Yep, not much assembler activity. The odd thing is that microcontrollers are easier to program in object code than either ‘C’ or assembler language. To do it in C the syntax burden is too great.

I am told that the efficiency of ‘C’ is 90%. That would have to be application dependent. I am writing a navigation program that involves:

C=((A^2)+(B^2))^.5 and Arc Sine

It’s only one line of code each in C but I’ll bet it’s a ton MSP430 code.

I think the assembler is a good compromise. ‘C’ is too far removed from the application.