Jump to content
43oh

oPossum

Members
  • Content Count

    925
  • Joined

  • Last visited

  • Days Won

    103

Posts posted by oPossum

  1. So the basic compact serial tx is this...

    
               mov     #2, R15             ;      Serial output bitmask
               or      #0x0300, R12        ;      Stop bit(s)
               jmp     bit_low             ;      Send start bit...
    bit_loop                                ;      * Add delay here if needed*
               rra     R12                 ; 7    Get bit to tx, test for zero
               jc      bit_high            ; 8->9 If high...
    bit_low     bic.b   R15, &P1OUT         ; 1->4 Send zero/start bit
               jmp     bit_loop            ; 5->6 Next bit...
    bit_high    bis.b   R15, &P1OUT         ; 1->4 Send one/stop bit
               jnz     bit_loop            ; 5->6 If tx data is not zero, then there are more bits to send...
               ret                         ;      Return when all bits sent
    

     

    The versatile DCO can be used for common bit rates...

    115200 @ 1.0368 MHz

    57600 @ 518.4 kHz

    38400 @ 345.6 kHz

    19200 @ 172.8 kHz

    9600 @ 86.4 kHz

    3641 @ 32.768 kHz (3600 is 115200 / 32)

     

     

     

    If you are programming in assembly, and are aware of MSP430 quirks, then something like this may work...

    bit_loop                                ;      * Add delay here if needed*
               rra     R12                 ; 7    Get bit to tx, test for zero
               jc      bit_high            ; 8->9 If high...
    bit_low     bic.b   #2, &P1OUT          ; 1->4 Send zero/start bit
               jmp     bit_loop            ; 5->6 Next bit...
    bit_high    bis.b   #2, &P1OUT          ; 1->4 Send one/stop bit
               jnz     bit_loop            ; 5->6 If tx data is not zero, then there are more bits to send...
               ret                         ;      Return when all bits sent            
    
    test        mov     #bit_low, R11
               mov     #'T' | 0x0300, R12
               call    R11
               mov     #'e' | 0x0300, R12
               call    R11
               mov     #'s' | 0x0300, R12
               call    R11
               mov     #'t' | 0x0300, R12
               call    R11
               mov     #0x030D, R12
               call    R11
               mov     #0x030A, R12
               call    R11
               jmp     $
    

  2. I think you're all nuts here. This isn't 1965's mission to moon with 70k of memory, just use 2553.

    Just kidding :)

     

    Yeah, sorry Rob. I got caught up in oPossum's "this code is optimal (can not be done with fewer instruction words or cycles)" claim, which sounded like a challenge to me (grin).

     

    Thanks for taking up the challenge. You got me to take another look at optimizing the code.

     

    I really like assembly language on PIC devices so I thought it might be fun to learn assembly language on the MSP430 value line devices. So far, the von Neumann architecture on the MSP430 is proving difficult (for me), compared to the Harvard architecture on the PIC.

     

    I have been programming PIC in assembly for about 20 years. Just learning the TMS430. I like it, but miss the btfss, btfsc, bsf, bcf, and btf instructions that the PIC has. CCS is a bit unstable and slow, I like MPLAB better.

  3. Be aware that constants -1, 0, 1, 2, 4, and 8 are one word and one cycle shorter than all other constants. Use caution with constants in timing critical code.

     

    I'm not following you. Sounds like an interesting caveat though. Is there a page number in SLAU144h or SLAU131e I can refer to?

     

    Regards, Mike

     

    "3.2.4 Constant Generator Registers CG1 and CG2" (page 47) in "MSP430x2xx Family User's Guide" (slau144h)

     

    It is a quirk of the MPS430 architecture that allows smaller, faster code and is used by several pseudo-ops.

  4. May I ask what is the purpose of your CIR capture device, please? Is it to help you identify an unknown protocol being used by a remote control?

     

    It provides all the necessary info needed to reproduce a remote's transmission or respond to a remote control. So, if you want to make your own remote or make something that responds to an existing remote, then this device will provide essential information.

  5. Nice code. I like it. Great to have another MSP430 asm programmer here.

     

    To count cycles in CCS debugger, select Clock Enable from the Target menu. Note that the cycle count of the first instruction executed after enabling the clock may be incorrect, usually +1. Double click on the clock to reset it.

     

    Here is revised code that uses 25 words, 17 cycles/bit minimum, and can be packaged as a library.

     

    serial.asm

               .cdecls C, LIST, "msp430g2211.h"
    
               .bss    bit_dur, 2
               .bss    bit_mask, 2
    
               .text
               .global serial_setup, putc, puts
    
    serial_setup                            ; - Setup serial output bitmask and bit duration (17 minimum)
               mov     R12, &bit_mask      ; Save serial output bitmask
               inv     R13                 ; Delay loop counts up until overflow, so
                                           ;  count must be inverted
               add     #17, R13            ; Adjust count for loop overhead
               mov     R13, &bit_dur       ; Save bit duration initial count
               ret                         ; Return
                                           ;
                                           ; - Send a single char
    putc                                    ; Char to tx in R12
                                           ; R11, R12, R14, R15 trashed
               mov     &bit_dur, R14       ; Bit duration initial count
               mov     &bit_mask, R15      ; Serial output bitmask
               or      #0x0300, R12        ; Stop bit(s)
               jmp     bit_low             ; Send start bit...
    bit_loop    mov     R14, R11            ; Get bit duration
    bit_time    nop                         ; 4 cycle loop
               add     #4, R11             ;
               jnc     bit_time            ;
               rla     R11                 ; 0 to 3 cycle delay
               add     R11, PC             ;
               nop                         ;
               nop                         ;
               nop                         ;
               rra     R12                 ; Get bit to tx, test for zero
               jc      bit_high            ; If high...
    bit_low     bic.b   R15, &P1OUT         ; Send zero bit
               jmp     bit_loop            ; Next bit...
    bit_high    bis.b   R15, &P1OUT         ; Send one bit
               jnz     bit_loop            ; If tx data is not zero, then there are more bits to send...
    ret_ins     ret                         ; Return when all bits sent         
                                           ;
                                           ;
                                           ; - Send a NULL terminated string
    puts                                    ; Tx string using putc
               mov     R12, R9             ; String pointer in R12, copy to R9
    putsloop                                ;
               mov.b   @R9+, R12           ; Get a byte, inc pointer
               tst.b   R12                 ; Test if end of string
               jz      ret_ins             ; Yes, exit...
               call    #putc               ; Call putc
               jmp     putsloop            ;
                                           ;
               .end                        ;
    

     

    main.c

    
    #include "msp430g2211.h"
    
    // Functions in serial.asm (this really should be in a header file)
    void serial_setup(unsigned mask, unsigned duration);
    void putc(unsigned);
    void puts(char *);
    
    void main(void)
    {
       char c;
    
       DCOCTL = 0;
       BCSCTL1 = CALBC1_1MHZ;
       DCOCTL = CALDCO_1MHZ;
    
       WDTCTL = WDTPW + WDTHOLD;
       P1DIR = 0xDA;
       P1REN = 0x25;
       P1OUT = 0x07;
       P1SEL = 0x11;
    
       // Port 1.1, 9600 bps (@ 1 MHz clock)   
       serial_setup(1 << 1, 1000000 / 9600);
    
       puts("Test\r\n");
       for(c = 33; c < 127; ++c) putc(c);
       puts("\r\n");
    
       for(;;
    }
    

  6. Try this. Works on Launchpad with "MSP430 Application UART" at 9600,8,N,1

     

    main.c

    #include "msp430g2211.h" // or g2231
    
    // Functions in serial.asm (this really should be in a header file)
    void putc(unsigned);
    void puts(char *);
    
    void main(void)
    {
       char c;
    
       DCOCTL = 0;
       BCSCTL1 = CALBC1_1MHZ;
       DCOCTL = CALDCO_1MHZ;
    
       WDTCTL = WDTPW + WDTHOLD;
       P1DIR = 0xDA;
       P1REN = 0x25;
       P1OUT = 0x07;
       P1SEL = 0x11;
    
       puts("Test\r\n");
       for(c = 33; c < 127; ++c) putc(c);
       puts("\r\n");
    
       for(;;
    }
    

     

    serial.asm

    
               .cdecls C, LIST, "msp430g2211.h"
    ;            .cdecls C, LIST, "msp430g2231.h"
    
               .text
               .global putc, puts          ; Global symbols can be called by other source files
    
    putc                                    ; Char to tx in R12
                                           ; R10, R11, R14, R15 trashed
               mov     #65553 - 104, R10   ; Bit duration (18 minimum)
               mov     #0x02, R15          ; Serial output bitmask
               mov     #10, R14            ; 10 bit times (may be reduced to 9 at high bit rates)
               bic.b   R15, &P1OUT         ; Start bit
               or      #0xFF00, R12        ; Stop bit(s)
               nop                         ;
    bit_loop    mov     R10, R11            ; Get bit duration
    bit_time    nop                         ; 4 cycle loop
               add     #4, R11             ;
               jnc     bit_time            ;
               rla     R11                 ; 0 to 3 cycle delay
               add     R11, PC             ;
               nop                         ;
               nop                         ;
               nop                         ;
               rrc     R12                 ; Get bit to tx
               jc      bit_high            ; If high...
               bic.b   R15, &P1OUT         ; Send zero bit
               dec     R14                 ; Dec bit count
               jmp     bit_loop            ; Next bit...
    bit_high    bis.b   R15, &P1OUT         ; Send one bit
               dec     R14                 ; Dec bit count
               jnz     bit_loop            ; Next bit...
    ret_ins     ret                         ; Return when all bits sent         
                                           ;
                                           ;
    puts                                    ; Tx string using putc
               mov     R12, R9             ; String pointer in R12, copy to R9
    putsloop                                ;
               mov.b   @R9+, R12           ; Get a byte, inc pointer
               tst.b   R12                 ; Test if end of string
               jz      ret_ins             ; Yes, exit...
               call    #putc               ; Call putc
               jmp     putsloop            ; Loop...
                                           ;
               .end                        ;
    

  7. Uses software delay loop instead of timer [interrupt] for small code size.

    Minimum bit duration is 18 clock cycles. One cycle granularity.

    I think this code is optimal (can not be done with fewer instruction words or cycles).

     

    tx_char                                 ; Char to tx in R14
                                           ; R10, R11, R12, R15 trashed
               mov     #65553 - 104, R10   ; Bit duration (18 minimum)
               mov     #0x02, R15          ; Serial output bitmask
               mov     #10, R12            ; 10 bit times (may be reduced to 9 at high bit rates)
               bic.b   R15, &P1OUT         ; Start bit
               or      #0xFF00, R14        ; Stop bit(s)
               nop                         ;
    bit_loop    mov     R10, R11            ; Get bit duration
    bit_time    nop                         ; 4 cycle loop
               add     #4, R11             ;
               jnc     bit_time            ;
               rla     R11                 ; 0 to 3 cycle delay
               add     R11, PC             ;
               nop                         ;
               nop                         ;
               nop                         ;
               rrc     R14                 ; Get bit to tx
               jc      bit_high            ; If high...
               bic.b   R15, &P1OUT         ; Send zero bit
               dec     R12                 ; Dec bit count
               jmp     bit_loop            ; Next bit...
    bit_high    bis.b   R15, &P1OUT         ; Send one bit
               dec     R12                 ; Dec bit count
               jnz     bit_loop            ; Next bit...
               ret                         ; Return when all bits sent         
    

  8. A typical frequency counter will count cycles for a period of one second and display the resulting count. This will not work for measuring the IR remotes's carrier frequency because the carrier is being keyed on and off (OOK - on off keying).

     

    A much shorter gate time is required to get a proper measurement. A 100 us gate time is used as shown in this diagram...

    post-2341-13513550066_thumb.png

     

    The first and last non-zero counts will be excluded from the carrier frequency calculation because the carrier was probably not on for the entire period. The inner counts are summed and the period durations are also summed. The carrier frequency can then be calculated as:

     

    sum of counts / sum of periods

     

    For this example:

     

    20 counts / .0005 seconds = 40000 Hz

     

    The period of the carrier is simply the reciprocal:

     

    500 us / 20 counts = 25 us

     

    To determine the carrier on duration for the first and last period, the pulse count is multiplied by the pulse period. So the first period with one pulse has a duration of 25 us, and the last period with three pulses has a duration of 75 us. So the total duration of the burst is 25 + (100 * 5) + 75 = 600 us

     

    This will be shown like this:

    post-2341-13513550067_thumb.png

     

    Here is a real remote using the Sony protocol - it is very close to the above idealized example.

    post-2341-135135500664_thumb.png

     

    Next post will explain how the pulse counts are sent to the PC. (hint)

  9. There is a cool trick that can be used with LEDs (IR and visible) when repetition rate is low ( a few Hz at most).

     

    Charge the LED with reverse bias (diodes have a small capacitance) and then measure the time it takes for the charge to drop below the logic threshold of the micro.

     

    The small photocurrent generated by the LED discharges the small charge stored in it. The shorter the discharge time, the brighter the light. Elegant and effective.

  10. To measure the CIR carrier frequency, each individual pulse of IR must be detected. Common IR demodulator modules can not do this - they respond to a burst of IR, not each pulse.

     

    There are parts made for this specific application such as the Vishay TSOP98200 and TSOP98260. Unfortunately these parts are difficult to obtain.

     

    There are general purpose IR detectors like the Fairchild QSE159 and Osram SFH5140, but they require 5 volts.

     

    A photodiode and a transimpedance amplifier works well, but requires careful construction (not a breadboard) to work well.

     

    I used an ordinary IR LED as a detector. Here is a video showing how it works...

     

     

    Here is the code...

     

    #include "msp430g2211.h"
    
    main(void)
    {
    volatile unsigned d;
    unsigned n, p;
    
    P1DIR = 0xDA;				// Setup I/O
    P1REN = 0x25;				// Pullup on P1.0 - counter input
    P1OUT = 0x07;				// Ground on P1.3 - IR LED ground
    P1SEL = 0x11;				// Enable external counter input
    TACTL = 0x0024;				// Continuous count up, no prescale
    
    p = 0;						// Reset previous count
    
    for(; {
    	n = TAR;				// Get current count
    
    	if(n != p) {			// Compare to previous
    		P1OUT |= 0x40;		// Turn on green LED if count has changed
    	} else {
    		P1OUT &= ~0x40;		// Turn off green LED if count is the same
    	}
    
    	p = n;					// Set previous count to current count
    
    	d = 10;					// Wait a while
    	do { --d; } while(d);	//
    }
    }
    

     

    Measuring the carrier frequency requires counting pulses in a specific time period. Next post will show how that is done.

  11. The following posts describe a simple method of CIR capture that can be done with almost any MSP430. The prototype shown uses the Launchpad with a MSP430G2211.

     

    This device that will show in detail the signal sent by IR remote controls. It measures the carrier frequency, on duration, off duration, and pulse count per burst. The Launchpad fitted with a MSP430G2211 running at 1 MHz sends all this information to a PC where a Windows program is used for graphic display. Capture is done in real time and there is no limit to the duration.

     

    The following screen captures are from a remote using RC5 and another using NEC protocol. The top line shows the carrier frequency and a summary of the first 300 milliseconds. The following lines show the details - on duration, off duration, and pulse count.

     

    How does a 1 MHz G2211 do this? More info soon...

    post-2341-13513550038_thumb.png

    post-2341-135135500649_thumb.png

  12. Inline asm version

     

    void tx(unsigned c)
    {
       __asm(" mov     0(SP), R14");   // Get the char passed on the stack to R14
                                       //
       __asm(" mov     #0x02, R15");   // Setup bitmask in R15
                                       //
       __asm(" bic.b   R15, &P1OUT");  //  0 Start bit
       __asm(" jmp     $ + 2");        //
                                       //
       __asm(" rrc     R14");          // Bit 0
       __asm(" jc      $ + 18");       //
       __asm(" bic.b   R15, &P1OUT");  //  9
       __asm(" nop");                  //
       __asm(" rrc     R14");          // Bit 1
       __asm(" jc      $ + 24");       //
       __asm(" bic.b   R15, &P1OUT");  // 17
       __asm(" jmp     $ + 24");       //
       __asm(" bis.b   R15, &P1OUT");  //  9
       __asm(" nop");                  //
                                       //
       __asm(" rrc     R14");          // Bit 1
       __asm(" jc      $ + 8");        //
       __asm(" bic.b   R15, &P1OUT");  // 17
       __asm(" jmp     $ + 8");        //
       __asm(" bis.b   R15, &P1OUT");  // 17
       __asm(" jmp     $ + 2");        //
                                       //
       __asm(" rrc     R14");          // Bit 2
       __asm(" jc      $ + 8");        //
       __asm(" bic.b   R15, &P1OUT");  // 26
       __asm(" jmp     $ + 8");        //
       __asm(" bis.b   R15, &P1OUT");  // 26
       __asm(" jmp     $ + 2");        //
                                       //
       __asm(" rrc     R14");          // Bit 3
       __asm(" jc      $ + 18");       //
       __asm(" bic.b   R15, &P1OUT");  // 35
       __asm(" nop");                  //
       __asm(" rrc     R14");          // Bit 4
       __asm(" jc      $ + 24");       //
       __asm(" bic.b   R15, &P1OUT");  // 43   
       __asm(" jmp     $ + 24");       //
       __asm(" bis.b   R15, &P1OUT");  // 35
       __asm(" nop");                  //
                                       //
       __asm(" rrc     R14");          // Bit 4
       __asm(" jc      $ + 8");        //
       __asm(" bic.b   R15, &P1OUT");  // 43   
       __asm(" jmp     $ + 8");        //
       __asm(" bis.b   R15, &P1OUT");  // 43
       __asm(" jmp     $ + 2");        //
                                       //
       __asm(" rrc     R14");          // Bit 5
       __asm(" jc      $ + 8");        //
       __asm(" bic.b   R15, &P1OUT");  // 52
       __asm(" jmp     $ + 8");        //
       __asm(" bis.b   R15, &P1OUT");  // 52
       __asm(" jmp     $ + 2");        //
                                       //
       __asm(" rrc     R14");          // Bit 6
       __asm(" jc      $ + 18");       //
       __asm(" bic.b   R15, &P1OUT");  // 61
       __asm(" nop");                  //
       __asm(" rrc     R14");          // Bit 7
       __asm(" jc      $ + 24");       //
       __asm(" bic.b   R15, &P1OUT");  // 69
       __asm(" jmp     $ + 24");       //
       __asm(" bis.b   R15, &P1OUT");  // 61
       __asm(" nop");                  //
                                       //
       __asm(" rrc     R14");          // Bit 7
       __asm(" jc      $ + 8");        //
       __asm(" bic.b   R15, &P1OUT");  // 69
       __asm(" jmp     $ + 8");        //
       __asm(" bis.b   R15, &P1OUT");  // 69
       __asm(" jmp     $ + 2");        //
                                       //
       __asm(" nop");                  // Stop Bit
       __asm(" jmp     $ + 2");        //
       __asm(" bis.b   R15, &P1OUT");  // 78
    }
    

  13. To measure the CIR carrier frequency, each individual pulse of IR must be detected. Common IR demodulator modules can not do this - they respond to a burst of IR, not each pulse.

     

    There are parts made for this specific application such as the Vishay TSOP98200 and TSOP98260. Unfortunately these parts are difficult to obtain.

     

    There are general purpose IR detectors like the Fairchild QSE159 and Osram SFH5140, but they require 5 volts.

     

    A photodiode and a transimpedance amplifier works well, but requires careful construction (not a breadboard) to work well.

     

    I used an ordinary IR LED as a detector. Here is a video showing how it works...

     

     

    Here is the code...

     

    #include "msp430g2211.h"
    
    main(void)
    {
    volatile unsigned d;
    unsigned n, p;
    
    P1DIR = 0xDA;				// Setup I/O
    P1REN = 0x25;				// Pullup on P1.0 - counter input
    P1OUT = 0x07;				// Ground on P1.3 - IR LED ground
    P1SEL = 0x11;				// Enable external counter input
    TACTL = 0x0024;				// Continuous count up, no prescale
    
    p = 0;						// Reset previous count
    
    for(; {
    	n = TAR;				// Get current count
    
    	if(n != p) {			// Compare to previous
    		P1OUT |= 0x40;		// Turn on green LED if count has changed
    	} else {
    		P1OUT &= ~0x40;		// Turn off green LED if count is the same
    	}
    
    	p = n;					// Set previous count to current count
    
    	d = 10;					// Wait a while
    	do { --d; } while(d);	//
    }
    }
    

     

    Measuring the carrier frequency requires counting pulses in a specific time period. Next post will show how that is done.

  14. Here is some code that can tx at 115.2 kbps while running at only 1 MHz clock. This can be useful for "printf debugging" with minimal impact on code speed.

     

    The bit time of 115.2 kbps is aprox 8.68 us. The timing granularity at 1 MHz is only 1 us, so dithering is used to maintain correct average bit time. Most UART look at the middle of the bit, so this generally works well. The jitter is under 500 ns as shown in the following table.

     

    ;	 Bit	Exact	Int	  Delta	 Error
    ;	----------------------------------
    ;	Start	 0.00	 0		-	  -
    ;	0		 8.68	 9		9	+0.32
    ;	1		17.36	17		8	-0.36
    ;	2		26.04	26		9	-0.04
    ;	3		34.72	35		9	+0.28
    ;	4		43.40	43		8	-0.40
    ;	5		52.08	52		9	-0.08
    ;	6		60.77	61		9	+0.23
    ;	7		69.44	69		8	-0.44
    ;	Stop	78.13	78		9	-0.13
    

     

    This is the code to send one bit...

     

    bN	 rrc	  R14						    Move the next bit to send in to the carry flag, shift all others
    	jc		bNh				 --+		Test the carry flag and jump if one
    	bic.b   R15, &P1OUT		 |		The carry flag was zero, so put a zero on the serial output
    	jmp		nxb				--|--+	Jump to the next bit
    bNh	bis.b   R15, &P1OUT	  <-+  |	The carry flag was one, so put a one on the serial output
    	jmp		nxb				-----+	Jump to the next bit - this jump is required to keep the
    							 	       |	  code path for the bit isochronous
    nxb	next bit				    <----+
    

     

    9 cycles are required for each bit using that code, so something must be done for the 3 bits that must be sent in 8 cycles.

    The last jmp can be replace with a nop to reduce the cycle count when a one is sent. To reduce the cycle count when a zero is sent, the second jump is also replaced with a nop and part of the code for the next bit is copied to directly after the nop.

     

    This is the code for sending a byte...

                                           ; Data to tx is in R14
               mov     #0x02, R15          ; Setup serial output bitmask in R15
                                           ;
                                           ; Start bit
               bic.b   R15, &P1OUT         ;  0
               jmp     bit0                ;
                                           ;
    bit0        rrc     R14                 ; Bit 0
               jc      bit0h               ;
               bic.b   R15, &P1OUT         ;  9
               nop                         ;
               rrc     R14                 ; Bit 1
               jc      bit1h               ;
               bic.b   R15, &P1OUT         ; 17
               jmp     bit2                ;
    bit0h       bis.b   R15, &P1OUT         ;  9
               nop                         ;
                                           ;
    bit1        rrc     R14                 ; Bit 1
               jc      bit1h               ;
               bic.b   R15, &P1OUT         ; 17
               jmp     bit2                ;
    bit1h       bis.b   R15, &P1OUT         ; 17
               jmp     bit2                ;
                                           ;
    bit2        rrc     R14                 ; Bit 2
               jc      bit2h               ;
               bic.b   R15, &P1OUT         ; 26
               jmp     bit3                ;
    bit2h       bis.b   R15, &P1OUT         ; 26
               jmp     bit3                ;
                                           ;
    bit3        rrc     R14                 ; Bit 3
               jc      bit3h               ;
               bic.b   R15, &P1OUT         ; 35
               nop                         ;
               rrc     R14                 ; Bit 4
               jc      bit4h               ;
               bic.b   R15, &P1OUT         ; 43    
               jmp     bit5                ;
    bit3h       bis.b   R15, &P1OUT         ; 35
               nop                         ;
                                           ;
    bit4        rrc     R14                 ; Bit 4
               jc      bit4h               ;
               bic.b   R15, &P1OUT         ; 43    
               jmp     bit5                ;
    bit4h       bis.b   R15, &P1OUT         ; 43
               jmp     bit5                ;
                                           ;
    bit5        rrc     R14                 ; Bit 5
               jc      bit5h               ;
               bic.b   R15, &P1OUT         ; 52
               jmp     bit6                ;
    bit5h       bis.b   R15, &P1OUT         ; 52
               jmp     bit6                ;
                                           ;
    bit6        rrc     R14                 ; Bit 6
               jc      bit6h               ;
               bic.b   R15, &P1OUT         ; 61
               nop                         ;
               rrc     R14                 ; Bit 7
               jc      bit7h               ;
               bic.b   R15, &P1OUT         ; 69
               jmp     bitstop             ;
    bit6h       bis.b   R15, &P1OUT         ; 61
               nop                         ;
                                           ;
    bit7        rrc     R14                 ; Bit 7
               jc      bit7h               ;
               bic.b   R15, &P1OUT         ; 69
               jmp     bitstop             ;
    bit7h       bis.b   R15, &P1OUT         ; 69
               jmp     bitstop             ;
                                           ;
    bitstop     nop                         ; Stop Bit
               jmp     $ + 2               ;
               bis.b   R15, &P1OUT         ; 78
    

  15. I am using Code Composer Studio (CCS), not IAR Kickstart - sorry that wan't clear. Target is the Launchpad with G2231.

     

    It is running on the hardware because the I/O responds as expected. A software simulator would certainly be a great addition to CCS.

     

    I have also noticed that the first cycle count after enabling the timer is often 1 higher than it should be. Anyone else see this behavior?

  16. Enabling the clock really slows down execution. It seems to single step and count the cycles of each instruction. Is this a limitation of the G series parts or do all MSP430 lack a hardware instruction cycle counter? Is there any way to enable/disable the clock with the keyboard?

×
×
  • Create New...