英飞凌单片机例程tc1767_taskingv34r1_can_1
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
confidential
Page 28
Exercise CAN_1 DAvE Configurations (cont.)
Project Settings (cont.) MultiCAN / MOs
confidential
Page 29
Exercise CAN_1 DAvE Configurations (cont.)
confidential
Page 11
Exercise CAN_1 DAvE Configurations (cont.)
Configure ASC0 (cont.) Control:
Enable receiver (REN). Enable receive interrupt (RSRC).
confidential
Page 17
Exercise CAN_1 DAvE Configurations (cont.)
Project Settings (cont.) Click “Node0” Click “Configure pin”
confidential
Page 18
Exercise CAN_1 DAvE Configurations (cont.)
Project Settings (cont.) Configure Alternate Pin
Select P3.12 as can node0 input signal Select p3.13 as can node0 output signal
confidential
Page 19
Project Settings (cont.) MultiCAN / MOs/ MO2
Enable Message Object Identifier selection Message Direction Arbitration register Data length Acceptance Mask
confidential
Page 15
Exercise CAN_1 DAvE Configurations (cont.)
Click MultiCAN Module
confidential
Page 16
Exercise CAN_1 DAvE Configurations (cont.)
Project Settings (cont.) MultiCAN / Module Clock
CAN: Transmit and Receive Exercise CAN_1
Exercise CAN_1 Objective
Objective: Transmit and Receive through the CAN Node
confidential
Page 2
Exercise CAN 1 Block diagram
Click Node 1 Click ”Configure pins”
confidential
Page 22
Exercise CAN_1 DAvE Configurations (cont.)
Project Settings (cont.) Configure Alt Pin
Select P3.14 as can node0 input signal Select p3.15 as can node0 output signal
Page 14
Exercise CAN_1 DAvE Configurations (cont.)
Configure ASC0 (cont.) Functions:
Include „ASC0_vInit‟. Include „ASC0_vSendData‟. Include „ASC0_usGetData‟.
Project Settings - opens automatically General:
Compiler Settings: Tasking. Enable “Use Infineon DAvE sfr Header”
confidential
Page 5
Exercise CAN_1 DAvE Configurations (cont.)
Project Settings (cont.) MultiCAN / Functions
confidential
Page 34
Exercise CAN_1 DAvE Configurations Generate Code
Click here
confidential
Page 8
Exercise CAN_1 DAvE Configurations (cont.)
Configure ASC0 Module Clock:
Enable ASC0 module. Module clock: 40MHz.
confidential
confidential
Page 30
Exercise CAN_1 DAvE Configurations (cont.)
Project Settings (cont.) MultiCAN / MOs/ MO2/ Interrupt
Enable receive interrupt Select interrupt node pointer: CAN SRN 2
confidential
Page 31
Exercise CAN_1 DAvE Configurations (cont.)
Project Settings (cont.) MultiCAN / MOs/ SRNs
confidential
Page 32
Exercise CAN_1 DAvE Configurations (cont.)
confidential
Page 12
Exercise CAN_1 DAvE Configurations (cont.)
Configure ASC0 (cont.) Baud Rate :
Required Baud rate: 19200 Baud.
confidential
Page 13
Project Settings (cont.) MultiCAN / List
Drag MO 000 to Node 0 Drag M2 000 to Node 1
Drag from list on left
confidential
Page 26
Exercise CAN_1 DAvE Configurations (cont.)
Page 9
Exercise CAN_1 DAvE Configurations (cont.)
Configure ASC0 (cont.) Pin selection:
Click on “Configure pins ASC0_RX and ASC0_TX”.
Baidu Nhomakorabea
confidential
Page 10
Project Settings (cont.) MultiCAN / MOs
confidential
Page 27
Exercise CAN_1 DAvE Configurations (cont.)
Project Settings (cont.) MultiCAN / MOs /MO0
Enable Message Object Identifier selection Message Direction Arbitration register Data length Acceptance Mask
Project Settings (cont.) System clock:
Fvco : 640MHz System Clock:80MHz
•External oscillator
confidential
Page 6
Exercise CAN_1 DAvE Configurations (cont.)
Project Settings (cont.) Configure CAN Node 0
Module clock: 20MHz Baurate:500k
confidential
Page 21
Exercise CAN_1 DAvE Configurations (cont.)
Project Settings (cont.) Configure Node 1
Page 24
Exercise CAN_1 DAvE Configurations (cont.)
Project Settings (cont.) Configure Node 1
Module clock: 20MHz Baurate:500k
confidential
Page 25
Exercise CAN_1 DAvE Configurations (cont.)
Exercise CAN_1 DAvE Configurations (cont.)
Configure ASC0 (cont.) Pin selection / ASC0_RX and ASC0_TX:
Use Pin P3.0 as ASC0 receive signal. Use Pin P3.1 as ASC0 transmit signal.
confidential
Page 23
Exercise CAN_1 DAvE Configurations (cont.)
Project Settings (cont.) Configure Node 1
Enable “Initialize the CAN node 1
confidential
Exercise CAN_1 DAvE Configurations (cont.)
Project Settings (cont.) Configure CAN Node 0
Initialize the CAN node 0
confidential
Page 20
Exercise CAN_1 DAvE Configurations (cont.)
Project Settings (cont.) MultiCAN / MOs/ SRNs
Drag “CAN SRN 2” to Level 6
Drag from here
confidential
Page 33
Exercise CAN_1 DAvE Configurations (cont.)
RS 232
TC1767 - ASC0
TxD Receive Buffer
PC
RxD Transmit Buffer
ASC0 Receive SRN
CAN Receive SRN
CAN NODE 1 Receive
CAN NODE 0 Transmit
confidential
Page 3
Exercise CAN_1 DAvE Configurations
Project Settings (cont.) Interrupt system:
Enable globally the interrupt system (IE).
confidential
Page 7
Exercise CAN_1 DAvE Configurations (cont.)
Project Settings Close the project settings
Start DAvE for TC1767. Create a new project: Go to File New Select microcontroller: „TC1767‟.
confidential
Page 4
Exercise CAN_1 DAvE Configurations(cont.)
Exercise CAN_1 DAvE Configurations (cont.)
Configure ASC0 (cont.) Interrupts :
Drag „ASC0 Receive SRN‟ and drop it to CPU Interrupt Level 1.
confidential