1. Trang chủ
  2. » Kỹ Thuật - Công Nghệ

msp430x20x3 usi 01

1 97 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 1
Dung lượng 2,81 KB

Nội dung

;******************************************************************************* ; MSP430F20xx Demo - USICNT Used as a One-Shot Timer Function, DCO SMCLK ; ; Description: USI conunter is used as a one-shot timer The USI ; conunter ISR toggles P1.0 using software As coded ACLK is pre-divided by ; 128 and the USICNT loaded with 32, for a total divided of 4096 or ; 12-bits USICNT must be reloaded after each interrupt which also clears ; interrupt flag ; ACLK = VLO, MCLK = SMCLK = default DCO ; ; MSP430F20xx ; ; /|\| XIN|; | | | ; |RST XOUT|; | | ; | P1.0| >LED ; ; M.Buccini / L Westlund ; Texas Instruments, Inc ; October 2005 ; Built with IAR Embedded Workbench Version: 3.40A ;******************************************************************************* #include "msp430x20x3.h" ; ORG 0F800h ; Program Reset ; RESET mov.w #0280h,SP ; Initialize stackpointer StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer SetupP1 bis.b #01h,&P1DIR ; P1.1 output direction SetupBC SetupUSI bis.b bis.b bis.b mov.b bic.b mov.b #LFXT1S_2,&BCSCTL1 ; ACLK = VL0 #USIMST,&USICTL0 ; SPI master #USIIE,&USICTL1 ; Counter interrupt, flag remains #USIDIV_7+USISSEL_1,&USICKCTL ; /128 ACLK #USISWRST,&USICTL0 ; Enable USI #08h,&USICNT ; init-load counter ; Mainloop bis.w #LPM0+GIE,SR ; Enter LPM0, enable interrupts jmp Mainloop ; Again ; ; USI_ISR ; ; xor.b #01h,&P1OUT ; Toggle P1.0 bis.b #01Fh,&USICNT ; re-load counter reti ; ; ; ; Interrupt Vectors Used MSP430x2013 ; ORG 0FFFEh ; MSP430 RESET Vector DW RESET ; ORG 0FFE8h ; USICNT DW USI_ISR ; END

Ngày đăng: 26/12/2017, 08:22

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN

w