;******************************************************************************
Hex2bcd ;Subroutine for converting 16bit hexadecimal value to BCD value
;input in DIGITS 16bit hexadecimal, output in DIGITS 16bit BCD
;******************************************************************************
MOV #16,r9 ; R9 no of bits
clr r8 ; Clear R8
clr r7 ; Clear R7
L$1 rla DIGITS ; Rotate left arithmetic DIGITS
dadd r7,r7 ; Add source and carry decimally
dadd r8,r8 ; to destination
dec r9 ; Decrement bit counter
jnz L$1 ; Is 16 bits over ?
MOV r7,DIGITS ; Result in DIGITS
ret ; Return from subroutine
;******************************************************************************
COMMON INTVEC ; MSP430x41x Interrupt vectors
;******************************************************************************
ORG BASICTIMER_VECTOR
BT_VEC DW BT_ISR ; Basic Timer Vector
ORG TIMERA1_VECTOR ; Timer_AX Vector
TIMA_VEC DW TAX_ISR ;
ORG RESET_VECTOR
RESET_VEC DW RESET ; POR, ext. Reset, Watchdog
;******************************************************************************
END
我连材料清单都提供给你,问你心动吗?
-----------------------------------------------------------------------------
元件编号 参数值
R1 200K 1 % - 0805 SMD
R2, R3, R4, R6, R7, R12 100K 1 % - 0805 SMD
R5 1.8K 0.1 % - 0805 SMD
R8, R9, R10 10K 0.1 % - 0805 SMD
R11 560 5 % - 0805 SMD
C1, C3, C4, C8, C9 0.1uF 16V PPS 1210 SMD
C6, C7 2 X 0.1uF 16V PPS 1210 SMD
C5 22pF 50V CERM 0805 SMD
C2 4.7F 10V CERM 0805 SMD
Q1 NPN 三极管 MMBT3904
X1 40KHz QUARTz Crystal
TX1 TRANS 40KHz 超声波 S类型
RX1 RCVR 40KHz 超声波 S类型
LED1 RED LED
S1 滑动开关
9V 电池合(PCB装配式)
9V 9V碱性的电池
U1 MSP430F413 单片机
U2 TI LDO稳压器 TPS77001
U3 TI 运放 TLV2771
U4 十六进制反相缓冲器 SO-16
J1 14 Pin插座
LCD1 LCD 0.5” 2 Digit
PCB 自制PCB
上一页 [1] [2] [3] [4] [5] [6] [7]
本文关键字:超声波 MSP430单片机,单片机-工控设备 - MSP430单片机